...create a timed quest?

Get help using Construct 2

Post » Sun Sep 18, 2011 6:29 pm

Suppose I have a quest which requires say a 24 hour wait time to update (for example, a town simulation where it takes 24 hours to complete the building of a lumber mill), how is the timer applied (so that the player must wait 24 hours until the lumber mill updates to being finished)?

*note* I'm not making a city simulator, but the application is the same, and it's the best example I could think of for now.
B
7
G
2
Posts: 12
Reputation: 1,112

Post » Sun Sep 18, 2011 6:45 pm

There's no way to get the time of day yet - only the time since the game started. I can add something to the next build if you like.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Mon Sep 19, 2011 8:43 am

I had implemented a 'date' plugin simply wrapped from javascript's Date object.
Here is the zip file.
You can get full year, month, date, hours, minutes, seconds, milliseconds from expression.

And provided an action:Start timer, expression: Timer to get delta time in milliseconds. See the capx in zip file for example.rexrainbow2011-09-26 15:26:19
B
97
S
22
G
177
Posts: 4,111
Reputation: 103,525

Post » Mon Sep 19, 2011 9:29 am

@rexrainbow

The link looks like your prototype for the 'Function' plugin. Wrong file?
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,843
Reputation: 48,287

Post » Mon Sep 19, 2011 10:26 am

Oops, sorry, I had fix it, try again.

Edit:
Expression:CurTicks is wrapped from Date.getTime()rexrainbow2011-09-19 11:19:07
B
97
S
22
G
177
Posts: 4,111
Reputation: 103,525

Post » Mon Sep 19, 2011 11:20 am

That's the correct one :)

On my system, Date.Date is just returning the 'Day' part of GetDate(). Is this an issue on my side or with the plugin?
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,843
Reputation: 48,287

Post » Mon Sep 19, 2011 11:26 am

Date.Day is weekday
0 ="Sunday"
1 ="Monday"
2 ="Tuesday"
...

Date.Date is day in a month (1~31)
B
97
S
22
G
177
Posts: 4,111
Reputation: 103,525

Post » Mon Sep 19, 2011 11:30 am

Oh. It says in the expression: 'Get current Date from system'.

See below:

zenox982011-09-19 11:32:45
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,843
Reputation: 48,287

Post » Mon Sep 19, 2011 11:42 am

Date.Year, Date.Month for year and month.

Year/Month/Date
Hours : Minutes : Seconds : Milliseconds

like that
http://forums.wasabistudio.ca/download/file.php?id=39902rexrainbow2011-09-19 11:44:35
B
97
S
22
G
177
Posts: 4,111
Reputation: 103,525

Post » Mon Sep 19, 2011 11:50 am

I understand. It's easy enough to concatenate the relevant expressions, I just thought the wording was slightly ambiguous. I'm lazy so was looking for the 'quick' way :)
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,843
Reputation: 48,287

Next

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 23 guests