Help - Search - Members - Calendar
Full Version: Timed event
RPG RPG Revolution Forums > Scripting > Event Emporium
Pharonix
In my intro I have it so that after mandatory events and you gain control of your character
your partner comes to you after 'x' amount of time

The only problem I have is when the player enters the shop - the player has free time to shop around, and when time's up the other player
will come to you, and inform you it's time to go.

sorry this is vague, I can't really think of how to explain it.



HERES THE TEXT

your partner:
You should look around for a bit and buy
any items we may need for this journey.
Here's some money the King gave us.
Use it however you want.
I will come get you when it is time to go.
Alt_Jack
I'm going to assume you know that there's a timer on the 2nd page of the event commands box.
you need 2 events; one that runs the timer, and another parallel process/condition branch one that stops it.
Keep in mind that I'm assuming that the other guy just leaves.
try:

friend

text: (batched, of course)
your partner:
You should look around for a bit and buy
any items we may need for this journey.
Here's some money the King gave us.
Use it however you want.
I will come get you when it is time to go.
start timer: XX : XX
set move route: this event: (to the door, then)transparent on, through on
erase event (don't panic, just keep reading)


timer switch

You're just reverse engineering the previous one
stick a "blank" (sprite-less) event somewhere inaccessible(like in a wall or shelf)
condition branch: if timer = 1 sec or less
>stop timer
>sent event location: this event to (where the last one was erased, so it just looks like they came back in)
>set move route-change graphic
> (whatever you want to happen in the scene)
Mazel
I try using parallel event :

CODE
[b]Timer mode[/b]

[u][i]Page 1[/i][/u]
setting : parallel process

Control Timer : Start Up (MM SS)
Wait : X amount of waiting time (mine is 20frames for each second)
Control Variable :[0001:Timer] = Timer
Conditional Branch : variable :[0001:Timer] == 0
Control Timer : Stop
         Set move route : [friend route]
         Text : "Time Up"
Control Self Switches : A = ON

[u][i]Page2[/i][/u]
setting : action button
self switches A is ON

Blank



or

CODE
[b]Step count[/b]
[u][i]Page 1[/i][/u]
setting : parallel process

Control Variable :[0002:Map X starter] = Player's Map X
Control Variable :[0003:Map Y starter] = Player's Map Y
Control Self Switches : A = ON

[u][i]>Page 2[/i][/u]
setting : parallel process
self switches A is ON

Control Variable :[0004:Map X modify] = Player's Map X
Control Variable :[0005:Map Y modify] = Player's Map Y
Conditional Branch : Variable [0002:Map X starter] != Variable [0004:Map X modify]
         Control Variable :[0002:Map X starter] = [0004:Map X modify]
         Control Variable :[0006:step taken] += 1
    Else
         Branch End

Conditional Branch : Variable [0003:Map Y starter] != Variable [0005:Map Y modify]
         Control Variable :[0003:Map Y starter] = [0005:Map Y modify]
         Control Variable :[0006:step taken] += 1
    Else
         Branch End

Conditional Branch : Variable [0006:Step taken == 10 #can be any number
         Set move route : [friend route]
         Text : "Time Up"        
         Control Self Switches : A = OFF
         Control Self Switches : B = ON
    Else
         Branch End

[u][i]>Page 3[/i][/u]
setting : action button
self switches B is ON

Blank



There you go ^^~
I hope it can be some used.
Sorry if it doesn't >_______<,,,
lilcooldude69
QUOTE (Mazel @ Jul 8 2011, 08:16 AM) *
I try using parallel event :

CODE
[b]Timer mode[/b]

[u][i]Page 1[/i][/u]
setting : parallel process

Control Timer : Start Up (MM SS)
Wait : X amount of waiting time (mine is 20frames for each second)
Control Variable :[0001:Timer] = Timer
Conditional Branch : variable :[0001:Timer] == 0
Control Timer : Stop
         Set move route : [friend route]
         Text : "Time Up"
Control Self Switches : A = ON

[u][i]Page2[/i][/u]
setting : action button
self switches A is ON

Blank



or

CODE
[b]Step count[/b]
[u][i]Page 1[/i][/u]
setting : parallel process

Control Variable :[0002:Map X starter] = Player's Map X
Control Variable :[0003:Map Y starter] = Player's Map Y
Control Self Switches : A = ON

[u][i]>Page 2[/i][/u]
setting : parallel process
self switches A is ON

Control Variable :[0004:Map X modify] = Player's Map X
Control Variable :[0005:Map Y modify] = Player's Map Y
Conditional Branch : Variable [0002:Map X starter] != Variable [0004:Map X modify]
         Control Variable :[0002:Map X starter] = [0004:Map X modify]
         Control Variable :[0006:step taken] += 1
    Else
         Branch End

Conditional Branch : Variable [0003:Map Y starter] != Variable [0005:Map Y modify]
         Control Variable :[0003:Map Y starter] = [0005:Map Y modify]
         Control Variable :[0006:step taken] += 1
    Else
         Branch End

Conditional Branch : Variable [0006:Step taken == 10 #can be any number
         Set move route : [friend route]
         Text : "Time Up"        
         Control Self Switches : A = OFF
         Control Self Switches : B = ON
    Else
         Branch End

[u][i]>Page 3[/i][/u]
setting : action button
self switches B is ON

Blank



There you go ^^~
I hope it can be some used.
Sorry if it doesn't >_______<,,,

make sure in this event that you dont set the npc x and y the same as the player or your game event will just go on hold, you need to make your x or y be subtracted 1 so the engine doesnt think the npc needs to be on top of the player, also parallel event will make the player movable so my suggestion is u use something that will hold the player in place (autorun), kinda like on a pokemon game when walk in front of a trainer and the player cant move, but the trainer walks towards you, that will hold ur player in place while he runs up and says times up or whatever,just my input S:
Mazel
Thanks for the advice ^^
Umm... sorry >____<,,, guess I misunderstanding these line

QUOTE
HERES THE TEXT

your partner:
You should look around for a bit and buy
any items we may need for this journey.
Here's some money the King gave us.
Use it however you want.
I will come get you when it is time to go.


I thought he want to shop around before the time is up,
but I forget to stop the player moving. Sorry for the mistake.

I've try it again and here some edit

u]>Page 2[/u]
CODE
setting : parallel process
self switches A is ON

Control Variable :[0004:Map X modify] = Player's Map X
Control Variable :[0005:Map Y modify] = Player's Map Y
Conditional Branch : Variable [0002:Map X starter] != Variable [0004:Map X modify]
         Control Variable :[0002:Map X starter] = [0004:Map X modify]
         Control Variable :[0006:step taken] += 1
    Else
         Branch End

Conditional Branch : Variable [0003:Map Y starter] != Variable [0005:Map Y modify]
         Control Variable :[0003:Map Y starter] = [0005:Map Y modify]
         Control Variable :[0006:step taken] += 1
    Else
         Branch End

Conditional Branch : Variable [0006:Step taken == 10 #can be any number
         Control Self Switches : A = OFF
         Control Self Switches : B = ON
    Else
         Branch End


>Page 3

CODE
setting :autorun
self switches B is ON


Set move player [friend route]
wait for  move completion
Control Variable :[0007:friend direction] = [friend's] Direction
Text : Friend
          "Hey, Bro"
Conditional Branch [0007:friend direction] == 2
     set move route : Player
                                Turn up
Branch end
Conditional Branch [0007:friend direction] == 4
     set move route : Player
                                Turn right
Branch end
Conditional Branch [0007:friend direction] == 6
     set move route : Player
                                Turn left
Branch end
Conditional Branch [0007:friend direction] == 8
     set move route : Player
                                Turn down
Branch end

Text : Hero
         "Yeah?"
Text : Friend
         "Time to go, man" etc XD

Control Self Switches : B = OFF
Control Self Switches : C = ON


]u]>Page 4[/u]
CODE
setting : action button
self switches C is ON
Blank


If you found something wrong again, feel free to submit. And sorry for error >_________<,,,,
I'll try better next time ^^
lilcooldude69
lol no no, u were right i was just saying, when the time is up, and the npc comes to tell you, make sure your player cant move or it can mess up the routine of things because if you move, the variables will have already loaded a coordinate into the engine and it will stop at the last position the player was at before the player moved, which we dont want if the player cant move, the npc can tell him its time to go, then leave, then the player will be able to make his choice or whatever they wanted, after all that tho id suggest deleting the whole autorun event so the player can move again xD
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.