[XP] Script Call

Started by Darok, June 28, 2009, 09:43:10 pm

Previous topic - Next topic

Darok

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?


Calintz

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.

Darok

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  :^_^':

Calintz

June 28, 2009, 11:25:03 pm #3 Last Edit: June 28, 2009, 11:27:19 pm by Calintz
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.

Darok


Aqua

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.

Calintz

June 28, 2009, 11:35:08 pm #6 Last Edit: June 28, 2009, 11:36:36 pm by Calintz
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.

Aqua

@Cal:
Either a comment or a nametag? ^_^"
And the player is the vampire that is attacking people, not the other way around.

Calintz

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.

Aqua

Just like the way Blizz-ABS determines an Enemy from a normal event.
A nametag XD

Ryex

June 28, 2009, 11:47:32 pm #10 Last Edit: June 28, 2009, 11:50:08 pm by Ryexander
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.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Calintz

I don't know enough about scripting to understand Aqua, so I won't even try, Lol.

And no Ryex, I don't.

Ryex

June 28, 2009, 11:59:55 pm #12 Last Edit: June 29, 2009, 12:48:22 am by Ryexander
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?
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Calintz

Hold on, let me look real quick. That sounds cool, and VERY useful.

Darok

June 29, 2009, 01:00:12 pm #14 Last Edit: June 30, 2009, 08:48:59 pm by Darok
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!