1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Zombie-Mod - Removing Blob

Discussion in 'Modding Help' started by silelmot, Jan 4, 2014.

  1. silelmot

    silelmot Catapult Fodder

    Messages:
    6
    Hello,
    i tried a bit along with the zombie_rules.as
    a got a lot working, but there is one thing, i can't figure out:

    the zombies at the zombi-mod are created with
    Code:
    server_CreateBlob( "Skeleton", -1, sp);
    how do i let them dissapear?
    i cant find the code "create" at angelscript.com and so the opposite neither

    thanks for help.
     
  2. Aphelion

    Aphelion Wunderkind Donator
    1. Aphelion's Roleplay

    Messages:
    180
    Here is how:
    Code:
    CBlob@ zombie = server_CreateBlob( "Skeleton", -1, pos);
    
    zombie.server_Die(); // destroys the blob
    
    server_CreateBlob returns the object created
     
  3. silelmot

    silelmot Catapult Fodder

    Messages:
    6
    Hello again.
    now i have the problem, how to know the pos. of the "skeletons"?
    i found the code
    Code:
    getBlobsInRadius
    , but how do i get it worked, that
    it found all blobs on the map?
    to see , if it is a zombie i can use the question for
    Code:
    hasTag("flesh")
    , it think.

    i hope this will be the last dumb question from my side. thanks for your help so far.
     
  4. ZeroZ30o

    ZeroZ30o Haxor

    Messages:
    119
    Not a dumb question, but anyway, to get the pos, simply do:
    blob.getPosition()

    To damage them, you can also use the following: blob.server_Hit( blob, blob.getPosition(), Vec2f(0,0), 4.0f, 0);
    However, this might make them drop as corpses, but you can use other commands for that if that's the case.

    Also, for your "getBlobsInRadius", function, I believe you need to use a "for" loop to get each blob, as the best way to do it is to store those blobs in an array, to check if they're skeletons, players...
    An example of this is:
    Edit: this code was taken from vehicle/hall conversion, to check the amount of red/blue players nearby.

    So in your case, instead of checking "if (b !is this && b.hasTag("player") && !b.hasTag("dead"))", you should use something similar to "if (b.hasTag("skeletonOrWhatever")).
    Not the actual code you should use, but yeah. Hope that helped.
     
    Last edited: Jan 5, 2014
  5. silelmot

    silelmot Catapult Fodder

    Messages:
    6
    hey. thanks. i was really close, but your explanation fo the blobserver_Hit did it.
     
  6. ZeroZ30o

    ZeroZ30o Haxor

    Messages:
    119
    Glad I could help :P.