Status
Not open for further replies.

Somnus

Villager
Member
Joined
Feb 5, 2020
Messages
12
Reaction score
4
First Language
English
Primarily Uses
RMMV
I'm looking for a plugin that will make enemies move towards the player when not being looked at, essentially just like Weeping Angels from Dr. Who. I've tried eventing using conditional branches but the results have been janky and inconsistent, and I've been looking for plugins for a while now and while other people have asked for similar things in the past, the only ones I can seem to find that would accomplish what I need are for VX Ace. If anyone could write something up I'd be eternally grateful, or if someone knows a plugin that already exists or a mixture of plugins that could accomplish this and point me in the right direction that works too. Thanks guys!

-If it could be activated on an event by a Comment or Script Command that would be best and easiest to implement with Chrono engine I believe.
 
Last edited:

coyotecraft

Mythographer
Veteran
Joined
Mar 13, 2012
Messages
375
Reaction score
207
First Language
English
Primarily Uses
N/A
Let's think. The Player can only face 4 directions which ⬆⬇⬅➡ which correspond to 8,2,4,6 on the number pad.

So, something like
JavaScript:
switch ($gamePlayer.direction()) {
    case 8: //when player is facing up
            //change event page if Player is below Event
        if ($gamePlayer.y > $gameMap._events[this._eventId].y){$gameSelfSwitches.setValue([this._mapId, this._eventId, "A"],true)};
        break;
    case 2: //when player is facing down
            //change event page if Player is above than Event
        if ($gamePlayer.y < ...
        break;
    case 4: //when player is facing right
            //change event page if Player is left of event
        if ($gamePlayer.x > ...
        break;
    case 6: //when player is facing left
        break;

I'm not going to write the whole thing out.
You can put that in the Weeping Angel event as a parallel process. It'll turn selfswitch A on, and switch to another event page. Presumably with no movement, and a similar script with reversed logic to turn the switch off once the player looks away

You can also compress this to a single line like
switch ($gamePlayer.direction()) {case 8:if ($gamePlayer.y > $gameMap._events[this._eventId].y){$gameSelfSwitches.setValue([this._mapId, this._eventId, "A"],true)};break;}
And use that as a script in the Angel's Move Route rather than the event command.
That way you can have the event do some other command with a touch trigger, rather than parallel process. But you'll want the event frequency set to "highest".
 

Somnus

Villager
Member
Joined
Feb 5, 2020
Messages
12
Reaction score
4
First Language
English
Primarily Uses
RMMV
Thanks for the kickstart! I have absolutely no experience with coding (yet) but I'll try my best to reverse engineer the reverse script.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
5,459
Reaction score
3,536
First Language
English
Primarily Uses
RMMV
I'll try my best to reverse engineer the reverse script.
You don't need to...the Conditional Branch event command's third tab allows you to check for a character's facing, including the player and This Event.

So everything coyote wrote out could be represented with event commands (and I'm not even sure why you might need different event pages, if the result of the conditionals is simply to move the event one tile toward the player).

The real question is why you feel you need a plugin for it - if you've tried events with janky and inconsistent results, you'd do better to post those events and get help, because there's no reason they shouldn't work.
 

Somnus

Villager
Member
Joined
Feb 5, 2020
Messages
12
Reaction score
4
First Language
English
Primarily Uses
RMMV
You don't need to...the Conditional Branch event command's third tab allows you to check for a character's facing, including the player and This Event.
I hadn't looked at the script in engine yet as I'm at work, but from what Coyote said I thought I would need another script since they said I would need a similar script with reverse logic. If I don't need to then that's great.

The real question is why you feel you need a plugin for it - if you've tried events with janky and inconsistent results, you'd do better to post those events and get help, because there's no reason they shouldn't work.
The reason I ditched evented conditional branches is because they don't play well with with MOGS Chrono engine in ABS mode and quickly become much more complicated and convoluted. I believe a clean backend script would be much more preferable and easy to work with.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
5,459
Reaction score
3,536
First Language
English
Primarily Uses
RMMV
I hadn't looked at the script in engine yet as I'm at work, but from what Coyote said I thought I would need another script since they said I would need a similar script with reverse logic. If I don't need to then that's great.
You might not know the coding, but you can formulate the logic :smile:

If you're to my left and not facing right
OR
If you're to my up and not facing down
OR
If you're to my down and not facing up
OR
if you're to my right and not facing left
-- I move toward you.

Could be done in one if statement, certainly one page. I don't see how using multiple pages or any switches benefits you. Simply have that one check with the one movement command, run it every second or however frequently you want.
 

coyotecraft

Mythographer
Veteran
Joined
Mar 13, 2012
Messages
375
Reaction score
207
First Language
English
Primarily Uses
N/A
I was imagining the weeping angel event as having 2 states, therefore 2 pages. Probably 2 graphics. 2 different event triggers.
One where they're moving towards the player while the player's back is turned
Another when they are frozen while the player is facing their general direction.

Assuming the player has some extra movement control, like holding shift to maintain their direction.
I imagine the player could go up to it while frozen and press the action button to do something. Or, while they're not looking the Angel would touch the player and do whatever.
 

Somnus

Villager
Member
Joined
Feb 5, 2020
Messages
12
Reaction score
4
First Language
English
Primarily Uses
RMMV
I was imagining the weeping angel event as having 2 states, therefore 2 pages. Probably 2 graphics. 2 different event triggers.
One where they're moving towards the player while the player's back is turned
Another when they are frozen while the player is facing their general direction.

Assuming the player has some extra movement control, like holding shift to maintain their direction.
I imagine the player could go up to it while frozen and press the action button to do something. Or, while they're not looking the Angel would touch the player and do whatever.
That is exactly what the event is supposed to do yeah. I'm still working on it, making slow but steady progress.
 

Somnus

Villager
Member
Joined
Feb 5, 2020
Messages
12
Reaction score
4
First Language
English
Primarily Uses
RMMV
For those that may want them.
 

Attachments

  • StalkerMovement.js
    2.3 KB · Views: 5
  • StalkerMovementReversed.js
    2.3 KB · Views: 5

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
5,459
Reaction score
3,536
First Language
English
Primarily Uses
RMMV
I was imagining the weeping angel event as having...2 graphics. 2 different event triggers.
That makes sense, I didn't get that implication from the OP.
 

Somnus

Villager
Member
Joined
Feb 5, 2020
Messages
12
Reaction score
4
First Language
English
Primarily Uses
RMMV
That makes sense, I didn't get that implication from the OP.
Sorry, I only said Weeping Angel without explaining it further. Thought you might of known what I meant since you jumped in, my bad. All good and working now though.
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
6,289
Reaction score
2,461
First Language
Dutch
Primarily Uses
RMMV
@Somnus as you used to, I alter the code and combine the 2 into 1 for you.
which does the same effect, but cleaner in it's way.

there was also 2 mistakes with an extra "}" which break the plugin as well
when you want to run it.
 

Attachments

  • StalkerMovement.js
    2.8 KB · Views: 5

Somnus

Villager
Member
Joined
Feb 5, 2020
Messages
12
Reaction score
4
First Language
English
Primarily Uses
RMMV
@Somnus as you used to, I alter the code and combine the 2 into 1 for you.
which does the same effect, but cleaner in it's way.

there was also 2 mistakes with an extra "}" which break the plugin as well
when you want to run it.
Thank you!
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
6,289
Reaction score
2,461
First Language
Dutch
Primarily Uses
RMMV
it can be cleaner, but that, I'm not entirely sure, not even the exact effect for it.
but I would love to see a gif of the desire effect as I dont know the game either.

if this solved your problem, report your post to be closed, else we try to help
further to what you seek :)
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
9,943
Reaction score
6,304
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Made some new ground textures for our game, lots of textures still to be made but I think it start to look good =3
FddE0coWIAUA5Vy
People are stupid.
"Hello, our electricity has stopped working."
"Yeah, it just stopped for the entire area a couple mins ago."
"And why?"
"I don't know, need to investigate."
"And how long's it gonna last?"
Dude... Seriously?

Clarn Hold
(No storylines)

Forum statistics

Threads
125,549
Messages
1,171,867
Members
164,624
Latest member
Masachus
Top