Gw Temp

Menu

Tutorial - 'Sneaking Minigame' by LORd

An item about RPGMaker 2000 posted on

Blurb

A more advanced tutorial for "sneaking past guards" minigames!

Body

Alright. This is a small (or a little larger) tutorial for making a vision system, usable for sneaking minigames and such. This system's weakness is that that the "guards" can see only DIRECTLY in front of themselves, and you have to be careful with map design, because otherwise the guards may see through walls since this system relies on variables. OR you could make the "dungeon" be full of glass walls 8-)))

Okay. Now to the tutorial. This system requires lots of variables. First make all the guard events with a By a Route movement (the route should not make the guard face to a thin wall any closer than 7 squares in vertical and 9 squares in horizontal situations). Then, each of the guards should have an Auto Start second page that launches when a switch called something like “Guard1Sawyou!” is on. Make this page contain all you want to happen when a guard sees you.

Now, to the hard part. Make a Paraller Process event. Make it write down all the time the X and Y pos of hero and all the guards to variables for each guard & hero. Then make four variables for each guard:

GuardXYVisionUp
GuardXYVisionDown
GuardXXVisionLeft
GuardXXVisionRight

Naturally, the first X is the number of the guard.

Now, make something like this for each guard:

>Fork Condition: If Event: GuardX: Face Down:
:>Change Variable: GuardXYVisionUp: Set GuardXYPos
:>Change Variable: GuardXYVisionUp: Add 1
:>Change Variable: GuardXYVisionDown: Set GuardXYPos
:>Change Variable: GuardXYVisionDown: Add 7
>END Case

>Fork Condition: If Event: GuardX: Face Up:
:>Change Variable: GuardXYVisionDown: Set GuardXYPos
:>Change Variable: GuardXYVisionDown: Subtract 1
:>Change Variable: GuardXYVisionUp: Set GuardXYPos
:>Change Variable: GuardXYVisionUp: Subtract 7
>END Case

>Fork Condition: If Event: GuardX: Face Right:
:>Change Variable: GuardXXVisionLeft: Set GuardXXPos
:>Change Variable: GuardXXVisionLeft: Add 1
:>Change Variable: GuardXXVisionRight: Set GuardXXPos
:>Change Variable: GuardXXVisionRight: Add 9
>END Case

>Fork Condition: If Event: GuardX: Face Left:
:>Change Variable: GuardXXVisionRight: Set GuardXXPos
:>Change Variable: GuardXXVisionRight: Subtract 1
:>Change Variable: GuardXXVisionLeft: Set GuardXXPos
:>Change Variable: GuardXXVisionLeft: Subtract 9
>END Case

Ringing any bells yet? Then, make lots of Fork Conditions like this:

>Fork Condition: If Event: Guard X: Face Down:
:>Fork Condition: If Variable: HeroYPos: Is equal or above: GuardXYVisionUp
::>Fork Condition: If Variable: HeroYPos: Is equal or below: GuardXYVisionDown
:::>Fork Condition: If Variable: HeroXPos: Is equal to: GuardXXPos
::::>Change Switch: GuardXSawyou!: ON
:::>END Case
::>END Case
:>END Case
>END Case

>Fork Condition: If Event: Guard X: Face Up:
:>Fork Condition: If Variable: HeroYPos: Is equal or above: GuardXYVisionUp
::>Fork Condition: If Variable: HeroYPos: Is equal or below: GuardXYVisionDown
:::>Fork Condition: If Variable: HeroXPos: Is equal to: GuardXXPos
::::>Change Switch: GuardXSawyou!: ON
:::>END Case
::>END Case
:>END Case
>END Case

>Fork Condition: If Event: Guard X: Face Right:
:>Fork Condition: If Variable: HeroXPos: Is equal or above: GuardXXVisionLeft
::>Fork Condition: If Variable: HeroXPos: Is equal or below: GuardXXVisionRight
:::>Fork Condition: If Variable: HeroYPos: Is equal to: GuardXYPos
::::>Change Switch: GuardXSawyou!: ON
:::>END Case
::>END Case
:>END Case
>END Case

>Fork Condition: If Event: Guard X: Face Left:
:>Fork Condition: If Variable: HeroXPos: Is equal or above: GuardXXVisionLeft
::>Fork Condition: If Variable: HeroXPos: Is equal or below: GuardXXVisionRight
:::>Fork Condition: If Variable: HeroYPos: Is equal to: GuardXYPos
::::>Change Switch: GuardXSawyou!: ON
:::>END Case
::>END Case
:>END Case
>END Case

And all that into one invisible Paraller Process event, and you’re done. Thank you for your time!