Detecting if a mob is spawned
Detecting if a mob is spawned
Is there any way to detect whether a particular mob has been spawned? I've been trying to figure it out and am currently stumped... I would greatly appreciate any info to get me pointed in the right direction. Thanks.
Re: Detecting if a mob is spawned
I'm no longer stuck on this as I figured out a way around my problem from earlier, but if anyone knows if detecting whether certain mobs are spawned via a Lua script is possible I'd still like to know how...
Thanks.
Thanks.
Re: Detecting if a mob is spawned
all the commands that can be done to a baseentity (mobs included) are in lua_baseentity.h. if there isn't one, you'd have to make your own binding for it (which isn't really too hard: copy and paste something else related to mobs, add a line in .h and the lunar declares at the bottom of the .cpp, and then find a way to find if it's dead or not in the core. likely something to do with their current ACTION or animation)
sorry i don't have anything better to offer, i don't really deal much in the way of mobs in the scripts
sorry i don't have anything better to offer, i don't really deal much in the way of mobs in the scripts
-
- Developer
- Posts: 539
- Joined: Sun Jul 22, 2012 12:17 am
Re: Detecting if a mob is spawned
GetMobAction(########) might work for you.
See the qm1 in Dragon's Aery for ways this can be used. If you need to check what's returned from a mob, I usually just modify Cure or something to print(GetMobAction(#)) and check my server log. There's names for the different states somewhere in the core. I believe they all start with ACTION_
See the qm1 in Dragon's Aery for ways this can be used. If you need to check what's returned from a mob, I usually just modify Cure or something to print(GetMobAction(#)) and check my server log. There's names for the different states somewhere in the core. I believe they all start with ACTION_
Test Server: Hanekawa | Fantasy World: Naito
An occasionally updated list of what works
Bugs reports go here. | Project chat here.
Things I've found, but don't plan to work on.
An occasionally updated list of what works
Bugs reports go here. | Project chat here.
Things I've found, but don't plan to work on.
Re: Detecting if a mob is spawned
correctPrBlahBlahtson wrote: There's names for the different states somewhere in the core. I believe they all start with ACTION_
ai_general.h line 37
Re: Detecting if a mob is spawned
I really appreciate the responses, my earlier 'fix' didn't end up working out and I was back to detecting if the mobs had been spawned. Was planning on adding a new binding but noticed the other posts concerning GetMobAction... GetMobAction( mobid) == ACTION_NONE worked perfectly! Thanks!