Tio Akima 74 Posted August 27, 2017 Hello guys How can I make a MOB that self destructs when someone gets close? I looked at the Creator's skill (MARINE SPHERE) but I did not understand how self-destruction works. The idea is to make a mob that walks around the map and when it finds another MOB or player, it self destroys. Can someone help me? Quote Share this post Link to post Share on other sites
0 meko 170 Posted August 27, 2017 You could spawn your monster with the monster() command to get its GID, and then periodically (like every 100ms) check for nearby units using the getunits() command. If a unit is found that matches your criteria (ie type being MOB or PC) you kill it using unitkill() and you can make it spawn a new one after a timeout to begin the cycle again. If you want something simpler look for NPC_SELFDESTRUCTION in the mob skill db Quote Share this post Link to post Share on other sites
0 Tio Akima 74 Posted August 27, 2017 1 hour ago, meko said: You could spawn your monster with the monster() command to get its GID, and then periodically (like every 100ms) check for nearby units using the getunits() command. If a unit is found that matches your criteria (ie type being MOB or PC) you kill it using unitkill() and you can make it spawn a new one after a timeout to begin the cycle again. If you want something simpler look for NPC_SELFDESTRUCTION in the mob skill db Thanks Meko for the tip .. I'm doing everything in SRC myself .. so I guess the NPC_SELFDESTRUCTION might help. I'm summoning a mob and making it walk in one direction (by skill) ... And the idea is if this mob finds something on the way, it destroys itself .. (Auto destroy equal to marine sphere) But I still do not understand how the self-destruct of the Marine Sphere works. Getunits () and unitkill () are script commands? Is there any function in src similar to getunits ()? And also similar to unitkill ()? Does unitkill do the same thing as mob-> dead ()? Sorry for the many questions, but I have many doubts. I'm almost finished, I just need to make the mob self-destruct when I find something Quote Share this post Link to post Share on other sites
0 fxfreitas 102 Posted August 28, 2017 you can make the mob agressive, with 3 cell range of attack and 3 cells range of sight, and in mob_skill add NPC_SELFDESTRUCT when Attack or Chase with 100% chance, The mob will self destruct every time someone gets on his attack range, in theory looks very simple. 1 malufett reacted to this Quote Share this post Link to post Share on other sites
0 malufett 247 Posted August 28, 2017 fxfreitas answer will do no more source edit needed... Quote Share this post Link to post Share on other sites
0 Tio Akima 74 Posted August 29, 2017 On 28/08/2017 at 10:11 AM, fxfreitas said: you can make the mob agressive, with 3 cell range of attack and 3 cells range of sight, and in mob_skill add NPC_SELFDESTRUCT when Attack or Chase with 100% chance, The mob will self destruct every time someone gets on his attack range, in theory looks very simple. Thanks for the message fxfreitas I'll test this. On 28/08/2017 at 7:09 PM, malufett said: fxfreitas answer will do no more source edit needed... So I do not know if it's going to work out because I'm using the unit-> walktoxy to make the Mob walk ... So while the mob is walking with this function, it does not attack etc ... Just walk in the direction .. The idea to make it self destruct is to check if the next cell is a cell "Not walkable" or if there is any wall. This is looking like a collision test the mob colliding with something. hahahaha Quote Share this post Link to post Share on other sites
Hello guys
How can I make a MOB that self destructs when someone gets close?
I looked at the Creator's skill (MARINE SPHERE) but I did not understand how self-destruction works.
The idea is to make a mob that walks around the map and when it finds another MOB or player, it self destroys.
Can someone help me?
Share this post
Link to post
Share on other sites