Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Help please. Event

I was just wondering, im making an event that makes you faster for a short period of time, but i don't know how to setup a time limit that you'll have the speed, if this makes sense, can anyone answer this?
 
The specifics will depend on how you're increasing speed, but to explain, let's assume that your increased speed is activated by a switch being ON, activating a common event.

You might use, for example, a second common event, parallel process, activated by the same switch.  This event would wait, say, 600 frames, then turn the switch OFF. 

For more specific help, I'd need to see how you set up the speed increase event.
 
Well I have an event like a button thing I guess. And I have 5 event pages, with self switches. And I want it so you increase your speed from the original "Fast" to "Faster". SO I know I didn't do this right, but I made 2 switches. Both have the "Control Timer" event. On the first one I put 0. 30 secs. And on the other one I put stop. So on the button on the fifth page which will do those switches I put "Set Move Route" on player and I did Switch "SpeedStart" ON. Then did Change Speed "Faster". Then did Switch "SpeedStart" OFF. Then the SpeedStop follows, then I do "Change Speed" To "Fast" again.

Kinda hard to understand that.
 
Uh, yes, I did find that a bit hard to follow.  Also overcomplicated, I think.

Here's a Running event that I'm using in my current project.  I know that this isn't the way that you want to do it, but you might find it helpful.

http://i234.photobucket.com/albums/ee103/UnkaJosh/RunningEventScreenshot.png[/img]
The Change Blending is irrelevant for these purposes-- it ties in to certain puzzles in my game.  How this works is pretty simple-- if the "Running Allowed" switch is on, it checks the event.  This is important, because this event will interrupt any "Set Move Route" event, which would make certain cutscenes either fail or look really stupid.  If the switch is on, it checks the event, which looks to see if the "Run" button is being pushed.  If it is, it makes the player move at speed 5.  Otherwise, it sets the speed to 4.  That "Wait 1" at the end is actually helpful-- it reduces lag.

If I were to do something similar, I wouldn't use the timer-- I'd use a second parallel process event with a wait command, unless you want the visible timer countdown going on on-screen at the same time. 

You will need a parallel process event, I'm fairly sure, to check that timer-- anything else will either freeze the player while the timer runs, or simply not check the timer at all.
 

Zeriab

Sponsor

Hey bubbaclark. I have a few clarification questions:

Can the amount of time change?
How is the extra speed triggered? Is it for example on the press of a button?
Assuming this is the case what should happen if the player let go of the button? Is it like you can only run a while before you get tired?
Can you press the button again immediately after letting go? Does it depend on how long the button was held down? (Indicating fatigue)
You said you used the timer. Do you want a timer visible for the player to see how much time there is left? If yes, should the time remaining be indicated in any special way?
Can you change map while the player has the extra speed? If so, what should happen on map change? Should the extra speed just end? Should the time remaining be unaltered? Something else?

Please take the time to answer as many questions as you can since it will definitely help us help you.

I know that you replied. Even so some of the questions here still apply. What happens when you change map? Cutscenes?
Be aware that the system has side effects

*hugs*
- Zeriab
 
Zeriab":2d0tasfc said:
Hey bubbaclark. I have a few clarification questions:

Can the amount of time change?
How is the extra speed triggered? Is it for example on the press of a button?
Assuming this is the case what should happen if the player let go of the button? Is it like you can only run a while before you get tired?
Can you press the button again immediately after letting go? Does it depend on how long the button was held down? (Indicating fatigue)
You said you used the timer. Do you want a timer visible for the player to see how much time there is left? If yes, should the time remaining be indicated in any special way?
Can you change map while the player has the extra speed? If so, what should happen on map change? Should the extra speed just end? Should the time remaining be unaltered? Something else?

Please take the time to answer as many questions as you can since it will definitely help us help you.

I know that you replied. Even so some of the questions here still apply. What happens when you change map? Cutscenes?
Be aware that the system has side effects

*hugs*
- Zeriab

Ok ill answers those:

1. No it cannot change.
2. Triggered by a button
3. Yes you can only run for a little while, then you lose stamina.
4. No you cannot. No it does not. Push the button and run until you lose stamina.
5. Yes I want the timer visible. Well i'd like it in the a corner showing the time, then near like 5, it changes to red to let you know your time is almost up.
6. Yes you can change map. No it shouldnt end, go until timer hits 0. Yes unaltered time, unless you run into like mud whatever. :/
 
Make a C-Branch "when button '(whatever)' is pressed"= Turn on Self switch A.

Make a new page and the little boxes in the upper right hand corner that has "Self Switch" next to it, Check it and make it to "A"
On this page go to "Move route" and click the "Change Speed" to the highest or whatever, You can do it on Frequency to make him super fast
Now enter "Wait X amount of frames"
Wait for Move's completion (Maybe, Not sure, I don't have the program anymore. I'm doing this in my head)
Self switch B= On

Make a new page the same way to did with "A" but turn "A" to "B"
Now enter another "Wait X amount of frames and then another Wait for move's completion.
Then enter "Self switch A&B=Off"

Ta-daa! Sorry if it doesn't work. It was created in my head
 

Zeriab

Sponsor

NEVER use a Wait for move's completion for a DASH SYSTEM or other GENERALLY ACTIVE systems.
It can cause hard-to-spot game freezing errors.

The reason is that Wait for move's completion waits for all Set Move Route's to complete not just the ones given previously in the event.

I have made a quick prototype: http://www.sendspace.com/file/5gkz3z
Is it something in that direction you want?
Note that the timer goes red when there are 5 seconds left. (You can use the Sprite_Timer in the scripts editor in your own game if you want)
The change will make the timer go red when there are 5 or less seconds left always. (I can change it so it's activated upon a switch and the seconds left is determined with a variable if you want)
I have made it so you have to wait 5 seconds after the dash is ended before you can dash again.
If you go to another map the timer will continue to count down.
If you have fatigue and go to another map the fatigue ends no matter how long time there is left.

You talk about running into mud. Do you want mud or other substances which removes the running?
You could also consider making the player speed changes with script calls to prevent overriding other move routes set for the player.
It's pretty obvious but I feel like I should mention that should you have a timer running due to something else the timer will naturally be overwritten by this system.

*hugs*
- Zeriab
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top