Chaos Project

RPG Maker => Event Systems => Event System Troubleshooting => Topic started by: Darok on June 28, 2009, 09:43:10 pm

Title: [XP] Script Call
Post by: Darok on June 28, 2009, 09:43:10 pm
Hi... Im making a "Vampire" Event System that, pressing W you can down people life. After Variable Life is 15[ That mean that you press key W 15 times] That person die. But, i dont want to use a Variable for each people so, at the beggining of each person event i set Variable life to 0. That way i can make that if you stop attacking an enemy they will restore Life and im using only 1 Variable. But that way the variable never increase. So i want to make a conditional branch of a Script that make something like "If the Character is near the Person" all the evet happens, if not, variable go to 0.
Is that posible?

Title: Re: [XP] Script Call
Post by: Calintz on June 28, 2009, 09:55:48 pm
I don't fully understand what you want. I can make out that you want something to happen if the player gets too close, and this is totally possible, but I don't understand what you mean when you say "all" events happen.

BTW:
This won't be a script, it is best done through events with a conditional branch utilizing the "Call Script" condition.

I also understand that you are using one variable and all that good stuff, just explain in more detail exactly what you want to happen if the player gets too close.
Title: Re: [XP] Script Call
Post by: Darok on June 28, 2009, 11:20:20 pm
If the player get to close, you can start the Event and start increasing the Life Variable to kill the person. If you are not to close, the Variable life go to 0

Srry, i dont speak english very well  :^_^':
Title: Re: [XP] Script Call
Post by: Calintz on June 28, 2009, 11:25:03 pm
Alright ...
I can whip something up for you tomorrow.

I know how this can be done. It's late now though, and I have to get up for work at 5:00AM tomorrow morning.

You will have to set up the condition for every event separately, but upon activation, it will be calling a common event, so you won't have to do too much, but you will have to do a little.
Title: Re: [XP] Script Call
Post by: Darok on June 28, 2009, 11:26:57 pm
Ok, thanks!
Title: Re: [XP] Script Call
Post by: Aqua on June 28, 2009, 11:30:48 pm
Techinically... a script could be made that checks for whichever events on the screen are within X tiles of the player and push them into an array.
Of course... this method will most likely cause a lot of lag do to constant checking.
Title: Re: [XP] Script Call
Post by: Calintz on June 28, 2009, 11:35:08 pm
If you make a script, how will it determine if the event is a vampire or a door, etc...

The event's ID is constantly changing from map to map which is why I think this is best constructed while you are making the vampires on the map. You only need to do two things when making the vampires, so it won't really be that bad. You will set up the conditional branch, and then activate the switch.
Title: Re: [XP] Script Call
Post by: Aqua on June 28, 2009, 11:38:11 pm
@Cal:
Either a comment or a nametag? ^_^"
And the player is the vampire that is attacking people, not the other way around.
Title: Re: [XP] Script Call
Post by: Calintz on June 28, 2009, 11:43:06 pm
No, I mean ... when making the script, how would you check if the player is close enough to only the events that are capable of being attacked, because their IDs will change with every map that the player goes to. There are going to be multiple targets, so how can the script check only certain ones??

I can't see storing the events IDs into an array, and checking all events in the array constantly, because when you go to a new map, then the script won't recognize the same event IDs.
Title: Re: [XP] Script Call
Post by: Aqua on June 28, 2009, 11:45:27 pm
Just like the way Blizz-ABS determines an Enemy from a normal event.
A nametag XD
Title: Re: [XP] Script Call
Post by: Ryex on June 28, 2009, 11:47:32 pm
Quote from: Calintz on June 28, 2009, 11:43:06 pm
No, I mean ... when making the script, how would you check if the player is close enough to only the events that are capable of being attacked, because their IDs will change with every map that the player goes to. There are going to be multiple targets, so how can the script check only certain ones??

I can't see storing the events IDs into an array, and checking all events in the array constantly, because when you go to a new map, then the script won't recognize the same event IDs.

do you remember my contribution to Blizz's little tricks thread in the tut section? that makes it easy as pie. you could run it in a parallel process event and bang you got it. I could even edit it a bit to better suit the purpose.
Title: Re: [XP] Script Call
Post by: Calintz on June 28, 2009, 11:52:12 pm
I don't know enough about scripting to understand Aqua, so I won't even try, Lol.

And no Ryex, I don't.
Title: Re: [XP] Script Call
Post by: Ryex on June 28, 2009, 11:59:55 pm
I posted a snippet that searches events a given distance in front of the player for a string in a comment in the first line, ie. 'victim', and then flips a self switch on that event. sound like you could use it?
Title: Re: [XP] Script Call
Post by: Calintz on June 29, 2009, 12:40:24 am
Hold on, let me look real quick. That sounds cool, and VERY useful.
Title: Re: [XP] Script Call
Post by: Darok on June 29, 2009, 01:00:12 pm
Mmm, i remember the stealth system of nortos so, i try to copy that. But i always have an error :'( "Undefined method `X' for nil:NILClass"
Two questions.
Why i get this error?
Can this be the solution?
The nortos event make for each directionns one of this:
($game_player.x - $game_map.events[2].x >= 1) && ($game_player.x - $game_map.events[2].x <= 5) && ($game_player.y - $game_map.events[2].y >= -1) && ($game_player.y - $game_map.events[2].y <= 1)

EDIT:
I reaaally need this! Actually i need it for today, but one more day wont kill me xD
Maybe this is simpler: Using conditional branchs Script, something like "if event touching" go to the event system, if not, variable Life go to 0. This must be in paralel.
Pleaaaase! O reaaly need this!