How do I can work with timer and value ?

Get help using Construct 2

Post » Thu Jun 16, 2016 8:30 am

Hi

exp: I have 1000 gold and I wand buy flowers . Price of each flower is 250 gold so I can buy 4 flowers but times for each flower is 1 hour to build (how can i set this action) . And then I want the player see subtract timer and also add flower value every 1 hour (after 4 hours increase flower value to 4).

another thing : how can i save this data ? and load again ? automaticly
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Thu Jun 16, 2016 8:53 am

First question.
i answerd wrong, gonna retry.

Second question.

You need to learn how to use Local Storage.
https://www.scirra.com/tutorials/1461/h ... age-plugin

Once you got that it is easy.
Timer has an expression: CurrentTime(tag)
The time in seconds since On timer last triggered, for a timer with a specific tag.

Write that in the Local Storage.
When relaoding the game, start the timer with the same tag for the remaining time in the layer startup.
Last edited by 99Instances2Go on Thu Jun 16, 2016 12:31 pm, edited 1 time in total.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Jun 16, 2016 10:06 am

I don't understand at all :(
can you explain me clearerly
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Thu Jun 16, 2016 12:58 pm

B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Jun 16, 2016 1:10 pm

@sadism I`m just saying , if you make kinda games like you just say.. ANd it is offline, so if i was bored of waiting I will use some sort of technique that can hack the timer...
Just change your Time or date in Windows 7 :lol: .. That`s always work at Plant V Zombie for me.. Just saying..
B
13
S
5
G
4
Posts: 119
Reputation: 3,353

Post » Thu Jun 16, 2016 4:54 pm

@99Instances2Go thanks very much
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Thu Jun 16, 2016 4:57 pm

@fathijack1999 yes i know :) but i want save data on server and each time player played server check the time
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Fri Jun 17, 2016 2:44 am

sadism wrote:@fathijack1999 yes i know :) but i want save data on server and each time player played server check the time

You have a server 8-) Oh my gosh. I can`t even have one.. To expensive for me...
B
13
S
5
G
4
Posts: 119
Reputation: 3,353

Post » Fri Jun 17, 2016 7:15 am

@99Instances2Go sorry bro but i have a problem !!!!!?
when click buy , flower build 10 second later that's nice but when click twice we have two flowers build in 10 second and i don't wanna this. i want build a flower in 10 second and system wait for build one of the flowers then start the next one .
this is simple:
https://
drive.google.com/open?id=0BxuM6uiMrxpqdjI2RlFIcTBhX28
B
11
S
4
G
3
Posts: 50
Reputation: 2,431

Post » Fri Jun 17, 2016 8:00 am

Click Buy ?? a sprite or button ? @sadism
Why dont you just destroy the button
B
13
S
5
G
4
Posts: 119
Reputation: 3,353

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests