Announcement

Collapse
No announcement yet.

Making enemies "spot" you w/o moving

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Making enemies "spot" you w/o moving

    I'm working on a stealth-based system and I've been having trouble with the following problem:

    I cannot get the enemies to "spot" the character unless if the character moves. The idea I have is that for every visible event, there will be upwards of 15 other invisible events, depending on the range of view, extending in front of it. The problem is that I am unsire about how to make these invisible events check whether they're occupying the same space as the party.

    I know the key is probably in having the event repeatedly check the difference between all of the event location variables and the party location variables and activate the desired script when those variables are the same.

    If nothing else, I'll probably have to make an explanation for why the events can't see characters standing still.
    Last edited by tjoris9; 07-10-2005, 01:39 PM.

    #2
    Re: Making enemies "spot" you w/o moving

    You are on the right track when you say you'll need to check if the event occupies the save coordinates as the party. RPG Maker 2 was never designed to have events activate independent of the player's actions so you'll need to do some fancy scripting to get this to work. Good luck.




    The Crown of Order demo is here.

    Comment


      #3
      Re: Making enemies "spot" you w/o moving

      There is a way you can script in the enemies field of view. For an example of this Download my Stealth Ninja demo I made ages ago. Basically in the enemies action script apply together a script that checks it's events xy, write the proper equation for their view (mine was basically I graphed the two >/< equations and then did a distance to make a triangular field of vision exactly like on Metal Gear Solid). Then it checks if the party is in view, and flips a flag or does what-not if so. Now in the characters [] script have it run the right condition and also in the characters indirect effect after every step have it apply this condition, weather it be game-over or change of enemy actions etc...
      Everything is a Riemann sum of a lot of nothing.

      Comment


        #4
        Re: Making enemies &quot;spot&quot; you w/o moving

        I think I may have an idea, which is dependent on properly coordinating visible and invisible event movement.

        I create five scripts titled, Move Guard, Move View, Spot Check, Move & Spot, and Fight.

        I'm scripting this from memory, I doubt I'm using the exact names of script commands, and I haven't tried it yet, but here goes:

        Move Guard (Action):
        Repeat until Flag (Fixed off) = Off
        Event movement West 10, 60 F
        Wait 29 F
        Event facing East, 1 F
        Event Movement East 10, 60 F
        Wait 29 F
        Event facing West, 1 F
        Repeat end

        Move View (Action):
        Repeat until Flag (Fixed off) = off
        Event Movement West 10, 60 F
        Wait 29 F
        Event Movement 6 East, 1 F
        Event Movement 10 East, 60 F
        Wait 29 F
        Event Movement 6 West, 1 F
        Repeat End

        Spot Check (Action):
        Repeat until Flag (Fixed off) = Off
        Script Branch if Var (Event X) = Var (Party X)
        Script Branch if Var (Event Y) = Var (Party Y)
        Call script (Fight)
        Branch end
        Branch end
        Repeat end

        Move and Spot (Action):
        Apply together:
        Script (Spot Check)
        Script (Move View)

        Fight (Content):
        Event Battle
        Switch (Guard 1 Dead) = on

        I then create two events, Guard 1 and View 1

        Guard 1:
        Page 0:
        Condition: Switch (Guard 1 Dead) = off
        Image: Guard
        Action = Move Guard
        Page 1:
        Condition: Switch (Guard 1 Dead) = on
        Image: none
        No scripts

        View 1:
        Page 0:
        Condition: Switch (Guard 1 Dead) = off
        Image: none
        Action: Move & Spot
        Page 1:
        Condition: Switch (Guard 1 Dead) = on
        Image: none
        No scripts

        This script set is primarily designed for narrow corridors (1-3 spaces wide). View 1 should always lead Guard 1 on a East/ West patrol route spanning 10 spaces.

        I'll give it a try and tell you what happened.

        Wish me luck.

        Edit: Nevermind, the setup does work to an extent, but looks like it'll take too long to get the timing right. I'm actually not even sure if the automatic spot check works at all.
        Last edited by tjoris9; 07-11-2005, 02:40 AM.

        Comment


          #5
          Re: Making enemies &quot;spot&quot; you w/o moving

          My way only requires the enemy event to be placed and it checks all the info in his action script. It takes some fancy scripting but it is clearly worth it for this effect.
          Everything is a Riemann sum of a lot of nothing.

          Comment


            #6
            Re: Making enemies &quot;spot&quot; you w/o moving

            Yeah, I'll DL your demo. Anything is better than the jumbled mess I wound up with trying my own theory.

            Edit: Nash, which one is it? Is your demo still up on the site? If it isn't can you give me a description of the scripting commands involved?
            Last edited by tjoris9; 07-11-2005, 11:57 AM.

            Comment


              #7
              Re: Making enemies &quot;spot&quot; you w/o moving

              TRY HERE!

              I made this demo waaaay long time ago, so its not the best but it shows you a few enemy field of visions. You get to see an enemy that walks around and can spot you in the 3rd training world map.
              Everything is a Riemann sum of a lot of nothing.

              Comment


                #8
                Re: Making enemies &quot;spot&quot; you w/o moving

                I tried to check out the code, and got a pasword prompt. Send me a PM if you're not comfortable posting it here.

                Comment


                  #9
                  Re: Making enemies &quot;spot&quot; you w/o moving

                  to be honest I don't know the password off hand...I hope I can remember it if I load it up. But in the meantime just play through the demo, I have a spot on the 3rd demo map where a guard wanders around and can spot you. I'll work on it maybe when I get back rom work today. I'll edit some stuff and post a new demo for it and give ya a password.
                  Everything is a Riemann sum of a lot of nothing.

                  Comment


                    #10
                    Re: Making enemies &quot;spot&quot; you w/o moving

                    Valhalla RPG has a password recovery service for RPGM 1 & 2.
                    You can try him if you want your password.

                    Comment

                    Working...
                    X