Syndicate content

Help with monster eventing please

5 posts / 0 new
Last post
Offline
Townie
Joined: 3 Jan 2010
Help with monster eventing please

I'd like to know if you can make monsters walk around normally but when you approach them they notice you and run after you is that possible?

And if there is an other thread about this please tell me.

*Insert Random Signature Here*

Offline
Great TownieTownie
Joined: 10 Oct 2007

A basic system of that type shouldn't be too difficult. Just use an event with a random motion path.

You'd probably need a little scripting to identify the difference between the player and npc x and y co-ordinates; that you'll need someone else to help with; and use the correct distance to activate a self switch.

The second page you activate with the self switch, set it to approach hero, and then initiate your battle on player touch.

egg_dragon's picture
Offline
Ultra TownieMega TownieSuper TownieGreat TownieTownie
Joined: 23 Oct 2005

It's possible, but this should have been posted under Game Making Support Wink

On page 1 of your monster event, set it as a parallel process trigger with a random move route. Then, add the following to your event commands:

Spoiler: Highlight to view
@>Control Variables: [0001: Monster X] = This event's Map X
@>Control Variables: [0002: Monster Y] = This event's Map Y
@>Control Variables: [0003: Player X] = Player's Map X
@>Control Variables: [0004: Player Y] = Player's Map Y
@>Conditional Branch: This event is facing Down
@>Conditional Branch: Variable [0004: Player Y] > Variable [0002: Monster Y]
@>Control Variables: [0002: Monster Y] += 10
@>Conditional Branch: Variable [0004: Player Y] <= Variable [0002: Monster Y]
@>Control Self Switch: A =ON
@>
: Branch End
@>
: Else
@>
: Branch End
@>

On the second page of the monster event, you would set it to a parallel process trigger, activated by Self Switch A, with the autonomous movement set to "Approach" or a custom route, and set it up however you want. The list of event commands on page 2 would be the same as on page 1, but for the two conditional branches inside the "Facing Down" branch you would set handling when conditions do not apply (else) and turn control switch A OFF.

The code above is just for the monster facing down. You'd do the same thing for the other three directions, but instead of using the Y coordinate variables for facing right and left, you would use the X coordinate variables instead. Also, you would need a pair of variables (for both X and Y coordinates) per each monster event you wanted to use this on. You can reuse the same variables for other events on different maps, but monsters on the same map would require unique variables.

Also, if you did some searching around the internet I'm sure you could find some RGSS or RGSS2 scripts that might make this easier.

Any questions don't hesitate to ask!

Offline
Townie
Joined: 3 Jan 2010

Thankyou it works!

*Insert Random Signature Here*

egg_dragon's picture
Offline
Ultra TownieMega TownieSuper TownieGreat TownieTownie
Joined: 23 Oct 2005

Glad I could help Smile

Topic locked

Who's online

There are currently 0 users and 2 guests online.