Once again I find myself relying on the good graces of the rpg maker community in my journey from VX to MV.
I am a Yanfly loyalist who uses a lot of her scripts. One I love is the 'approach' script, which just gives events a line of sight, perfect for doing on-field encounters. Surprisingly enough though, it doesn't offer options to have different distance reactions to the player.
What I mean is the behaviors of my different enemies.
The basic enemy "The Leezard" will see you at a range of 7 and merely approach you. The script is perfect for this. Later, you encounter a wolf, who, at a range of 10, will simply face you and stare you down. Walking away will make it go back into its random patrolling pattern, but getting closer will cause it to charge you down. The script cannot support this more complex movement.
I have some enemies with complex movement and proximity conditions I'd like to implement, and this was easy to do with the old proximity script, (I think Galv's not sure which one it was) but when I search out proximity plugins, the script call always looks like this...
Galv.DETECT.event(id,dist,los)
// id = event ID that is a detector
// dist = tile distance from player
// los = true or false for line of sight
This specific one obviously is from Galv, another plugin maker I love going to.
https://galvs-scripts.com/2016/08/01/mv-event-detectors/
With the amount of enemies in the game with complex movements, I need to be able to copy/paste them, and every one of them will have a different ID. The old scripts just grabbed the ID of the event that called it, and checked that against the players position. Once again, sorry for being so long winded, but would there be any way to tell the script to just use the calling event's ID instead of needing to input it every time?
The event ID for 'self'
● ARCHIVED · READ-ONLY
-
-
I am guessing you are using a script call in an event, and you want to use the event's id without having to change it for each event? If that's the case, this._eventId will do it for you.
You really only needed to provide the script call and the actual question, rather than a wall of text filled with irrelevant info. I couldn't actually find what you were asking for until the very last line. -
Get event ID from current running event : this._eventId
So what you need to write in the script call will be like this example : Galv.DETECT.event(this._eventId, 10, true) -
Thank you, for the quick reply. Works fine, and I will try to condense future questions.