gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
Hey all,

I'm trying in vain to to come up with a way for an event to activate via a parallel process when it is next to another event (X or Y, so when it is in the radius directly around an event)

So far I've tried putting both Events X,Y locations into seperate variables and using conditional branches to compare them but I can't quite get my head around it.

Has anybody managed this, any ideas would be awesome!

EDIT: I'm also using Galv's Move Route Extras for extra functionality but I think this query can be solved without having to borrow script calls from that script, if however you're familiar with this script and have an idea/workaround let me know!

Cheers.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,183
Reaction score
10,821
First Language
Czech
Primarily Uses
RMMV
This actually is correct, saving events' X and Y locations into variables and then compare it in conditional branches. However, you have to watch out. There are X, Y and Screen X, Screen Y. You need to choose the X,Y. Screen X, Screen Y serves for capturing their position in pixels on the screen.
 

gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
Hey dude,

So at the moment I have 2 events that have a parallel process tracking their location that updates every 10 frames. I'm using Map X/Map Y not Screen X/Y (This is right yeah?)

I have 4 Variables:

EVENT 1 USES: X FRIENDLY, Y FRIENDLY
EVENT 2 USES: X ENEMY, Y ENEMY

How do I get it so that when X FRIENDLY is next to X ENEMY (or Y FRIENDLY is next to Y ENEMY) to activate one of my events?

I have a conditional branch that checks a Variable X FRIENDLY == X ENEMY then Y FRIENDLY == Y ENEMY running on a parralel process but it doesn't activate for me so I'm doing something wrong.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,732
Reaction score
12,293
First Language
English
Primarily Uses
RMMZ
'Game Mechanics Design' is for looking at aspects of game play from a more conceptual level. Implementation "How do I...?") questions belong in the Support forum for the engine you are using. Based on the info under your avatar...
[move]RPGMaker VX Ace[/move]
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,183
Reaction score
10,821
First Language
Czech
Primarily Uses
RMMV
Screenshots would be better, because if you are describing it like this, it is not so easy to track your mistake.
Because you can have it set in a way where it checks if the two variables are equal, but completely ignore the Y if they are not,
or you can set it in a way that the X gets checked and then regardless of the result Y gets checked.

Or there can be other problems, like scripts overwriting these variables (which I doubt) or a badly set parallel process event location thing).
 

gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
I'll whip a few screenshots together shortly.
 

gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
Ok the parallel process:

ParallelProces.png

The condtional branch:

Conditonal Branch.png

At present the event recognizes the other event is at X or Y and play an animation but it doesnt matter how far away the event is it still play the animation.

I need it so that when the event is 1 tile away from this event it then plays said animation.

Any ideas guys?
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,183
Reaction score
10,821
First Language
Czech
Primarily Uses
RMMV
That is because the X and Y comparisons are running independently of each other. You need to make the conditional branch like this.
Code:
If their x are equal:
    if Friendly Y - Enemy Y is equal to +1 or -1:
        do the stuff you want to do.
Else:
    if their Y are equal:
        If friendly X - Enemy X is equal to +1 or -1:
            do the stuff you want to do.
 

gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
Thanks a bunch dude I'll give that a try and post my results!! This knowledge will create some really powerful systems in my project!
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,183
Reaction score
10,821
First Language
Czech
Primarily Uses
RMMV
It is a basic feature of Action battle systems. But the potential of basics in rpg maker is infinite :)
 

gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
Ok I'm trying to get my head around it.

" if Friendly Y - Enemy Y is equal to +1 or -1:" how do i put this in a conditonal branch?

(I'm using Pearl ABS but trying to create AI so certain "NPCS" (technically need to be classed as enemies in the ABS) attack other enemies which is sadly not an in built feature of the ABS.)
 

Lord Vectra

Master Eventer
Veteran
Joined
Dec 6, 2015
Messages
250
Reaction score
359
First Language
English
Primarily Uses
RMVXA
Var.Friend Y - Var.Enemy Y
If Var.Friend Y < 0
Var.Friend Y * - 1
end

If Var.Friend Y == 1
blah blah blah
End

That should work.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,183
Reaction score
10,821
First Language
Czech
Primarily Uses
RMMV
Or simply

if variable is equal to 1:
code
else:
if variable is equal to -1:
code.
 

gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
* - 1 = What does this translate too in terms used in a conditional branch?

"Less than Or Equal Too"
"Greater Than or equal too"

etc
 

gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
Hey!

Var.Friend Y * - 1

What does the * equate too in my conditional branch or is this called via a script call?
 
Last edited:

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,183
Reaction score
10,821
First Language
Czech
Primarily Uses
RMMV
Nope, he meant this:
If the Y-Y variable is less than 0: Multiply it by -1, to make sure the absolute value is 1.
 

gregbaby

Evil Genius. o_O
Veteran
Joined
Jan 20, 2013
Messages
257
Reaction score
11
First Language
English
Primarily Uses
RMVXA
I've been trying my damdest to get this working but I'm banging my head against a wall here lol

I've uploaded a bare bones project file all setup. (All you need to do is paste it into a new project (I've removed various DLLS and the Executable files due to filesize being to big at 1.4mb lol)

The NPC named FRIENDLY has the move route I'm trying to accomplish when they are 1 tile away from the ENEMY event.

If anybody can have a crack at it for me I'd be eternally grateful, I'll keep trying on my end but I'm tending to make one thing work and breaking something else haha.
 

Attachments

  • Variable Headache.zip
    211.1 KB · Views: 6

Latest Threads

Latest Posts

Latest Profile Posts

And today we got some insides maps from the town i posted last time.

Map044.png
Map045.png
Map046.png
Map047.png Map048.png Map049.png Map050.png
So a big bug that was on a glue trap at home is now magically not on the glue trap. This feeling of terror I'm experiencing could be a fun thing to put in my game project (not the IGMC one).
Hoping that Unite has a character generator with black hairs/lips and other features.. it is such a pain making characters without these...
Today is my dad's birthday! And he's still going strong in his retirement days!

Forum statistics

Threads
123,398
Messages
1,156,272
Members
161,853
Latest member
sxxsxx777
Top