(late edit: Figured it out.(kinda). I'll leave the thread open for ideas on how to optimize this)
I want to dynamically create an event.
On top of that, said event will trigger a common event upon contact with the player.
ON TOP OF THAT, the condition for that event will be an area-based check.
(on the tippity top of that, I'm making two different triggers: radial and square, but that's another story)
I got the dynamic creation figured out.
I can create characters and random events, program them on the fly, put them on the map, send them wherever, make them do all sort of things. That works.
I got the area check part figured out, through some customization of the MoveRoute class and some tweaking of the Victor Engine plugin, which includes the function .in_rect?() and .in_radius?()
The problem comes when firing up the target common event.
I got the AreaCheck object coded, placed, and enabled.
I got the link to the common event, and I got the hook to the interpreter to run it.
The problem is, the event runs when the player gets in, and out, of the target zone.
It should run as the player enters the target zone.
(late edit: FIXED. Works as intended)
the RadiusCheck object works (ish, through a different approach), and it triggers the events within a map event manually placed and filled with its instructions.
(as in, it's an autorun event that fires when the player enables a variable, through the RadiusCheck)
what I need, is to do the same thing, via plain code, not by map eventing.
I know I'd have to inject a line somewhere down the run of the interpreter on watch, or pause it somehow, but $game_temp.reserve_common_event(id) does what I just explained.
I need not reserve it but run it, on the fly.
(late edit: NOT FIXED. Very crappy resolution)
any thoughts?
I can provide code examples if requested.... I don't want to overload the post.
I want to dynamically create an event.
On top of that, said event will trigger a common event upon contact with the player.
ON TOP OF THAT, the condition for that event will be an area-based check.
(on the tippity top of that, I'm making two different triggers: radial and square, but that's another story)
I got the dynamic creation figured out.
I can create characters and random events, program them on the fly, put them on the map, send them wherever, make them do all sort of things. That works.
I got the area check part figured out, through some customization of the MoveRoute class and some tweaking of the Victor Engine plugin, which includes the function .in_rect?() and .in_radius?()
The problem comes when firing up the target common event.
I got the AreaCheck object coded, placed, and enabled.
I got the link to the common event, and I got the hook to the interpreter to run it.
The problem is, the event runs when the player gets in, and out, of the target zone.
It should run as the player enters the target zone.
(late edit: FIXED. Works as intended)
the RadiusCheck object works (ish, through a different approach), and it triggers the events within a map event manually placed and filled with its instructions.
(as in, it's an autorun event that fires when the player enables a variable, through the RadiusCheck)
what I need, is to do the same thing, via plain code, not by map eventing.
I know I'd have to inject a line somewhere down the run of the interpreter on watch, or pause it somehow, but $game_temp.reserve_common_event(id) does what I just explained.
I need not reserve it but run it, on the fly.
(late edit: NOT FIXED. Very crappy resolution)
any thoughts?
I can provide code examples if requested.... I don't want to overload the post.