Any help appreciated :) (Timing, savestates)

For questions about using Classic.

Post » Thu Feb 18, 2010 1:02 am

Hi guys,

I am working on a project and can do most what I want to achieve but there are some basics I can't quite figure out.

First one is Grenades, How do you set a timer to an object so that once you spawn an object you start subtracting 1 every 5 ticks in a private variable, so that when it reaches zero I can tell it to destroy and do other stuff?

Second one is save states, so I'm making a largish game and I have multiple layouts for different levels, but say I have a house and each room is a layout, I want to go in one room and kill everything but when I leave and enter the room again I want them to remain dead.

Third one is similar, I exit one layout but when I re-enter the previous the player is at the beginning, I want the player to be where I exited the first layout originally.

Any guidance would be sah-weeet!

Cheers,
Mik
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Thu Feb 18, 2010 2:34 am

Timer is a behavior, so you can add a timer behavior to an object if you want a timer. Then you can control it from events, you can activate it and set it to repeat itself and do whatever you want when it "ticks" by using the event "on Timer".

I can't help you with the other ones becuase I'm new too :)
B
5
G
2
Posts: 46
Reputation: 817

Post » Thu Feb 18, 2010 2:42 am

saving is complicated and there are a ton of ways to do it, arrays, ini, files check them out.

for the grenade thing, remember you dont have to be counting down, you can simply add to a variable every 5 ticks and when its >/= "greater or equal" to whatever amount you want do all your stuff.
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Thu Feb 18, 2010 5:44 pm

[quote="QuaziGNRLnose":1lzkb08k]saving is complicated and there are a ton of ways to do it, arrays, ini, files check them out.

for the grenade thing, remember you dont have to be counting down, you can simply add to a variable every 5 ticks and when its >/= "greater or equal" to whatever amount you want do all your stuff.[/quote:1lzkb08k]

AHHHHH of course greater or equal I totally didn't think of that...obviously, thanks for the help. I'll look into .ini files thanks for the tip.
[quote="FunEffect":1lzkb08k]Timer is a behavior, so you can add a timer behavior to an object if you want a timer. Then you can control it from events, you can activate it and set it to repeat itself and do whatever you want when it "ticks" by using the event "on Timer".

I can't help you with the other ones becuase I'm new too :)[/quote:1lzkb08k]

Thanks, I did look at that object but couldn't seem to do much with it, I'll explore it more.
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Fri Feb 19, 2010 4:39 am

if you're doing timers with events do NOT use ticks, DO use timedelta!
This will ensure your grenades always take the same to detonate, no matter what computer the game is running in.

Signed
CEAT: Coalition for the Ethical Advancement of Timedelta
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Feb 19, 2010 10:44 am

[quote="madster":2xwlburp]if you're doing timers with events do NOT use ticks, DO use timedelta!
This will ensure your grenades always take the same to detonate, no matter what computer the game is running in.

Signed
CEAT: Coalition for the Ethical Advancement of Timedelta[/quote:2xwlburp]

Yeah I'm getting into Timedelta stuff now I've used it before for regenerating ammo, works well.
B
39
S
12
G
8
Posts: 580
Reputation: 7,108


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest