Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Timer for FPSC

Author
Message
GDBman
FPSC Reloaded TGC Backer
5
Years of Service
User Offline
Joined: 21st Mar 2014
Location: Apache Junction, Az.
Posted: 21st Mar 2014 04:02
Can some one help me. I would like to have a timer count down in place of health. When Timer gets to 000 the player lose a life. I have been able to put the word Timer in Place of Health but haven't found any code for the count down. I'm a grandpa and I'm trying to learn how to build games. I'm not good at coding so that's why I've gotten involved with FPSC.

Thanks
ncmako
7
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 21st Mar 2014 15:33 Edited at: 21st Mar 2014 17:22
Hi GDBman, and welcome
I'm a grandpa also and would be glad to help you. If you haven't
yet, grab a copy of the "Official Community Guide" here..
http://forum.thegamecreators.com/?m=forum_view&t=170978&b=21 It has a wealth of info, and also a copy of the latest
"Syntax" list here for scripts/scripting...http://forum.thegamecreators.com/?m=forum_view&t=180924&b=23
In the syntax list page #157 are the "Internal Variables" One
listed is "$PL=Player’s lives" so with that I can set the player lives (increase or decrease) using a timer. Here is a quick script,

Have not tested, but should work. Copy this script and attach to
an entity or trigger anywhere in your level. Timer is set to one minute. Timers are in milli-seconds,hence 60,000 (60 sec's). After one min. player loses one life (decvar=$PL 1). Change the timer to suite your needs. Look over the syntax list for more info.
Hope this helps.
best

Edit:tested and works. I attached to a triggerzone and set my timer to 10sec's(10000). Every 10sec's player loses 1 life.

You know you're a bad gamer when you're able to run out of infinite lives.
GDBman
FPSC Reloaded TGC Backer
5
Years of Service
User Offline
Joined: 21st Mar 2014
Location: Apache Junction, Az.
Posted: 21st Mar 2014 18:53
Thanks mcmako;
Great to hear from another grandpa. I still really confused but I followed your advise and down loaded both pdf's. I'll get going on studying this. I'm retired and I've kind of made this my hobby. I've got to keep my brain working.

Can I also sow om the game screen?

GregB
ApertureGFX
5
Years of Service
User Offline
Joined: 5th Mar 2014
Location: United Kingdom
Posted: 22nd Mar 2014 12:03
If you wish to show the timer on screen, that's very possible.

I'd recommend checking this out:

http://forum.thegamecreators.com/?m=forum_view&t=130281&b=24

It's a prime example of a scripting system that uses a numeric HUD. I'd recommend taking a look and working out wha it's doing, you'll both see how the numeric HUD works and you'll begin to understand FPI scripting - that's how I did it.

-ApertureGFX.
GDBman
FPSC Reloaded TGC Backer
5
Years of Service
User Offline
Joined: 21st Mar 2014
Location: Apache Junction, Az.
Posted: 22nd Mar 2014 22:00
Thanks ApertureGFX

I'm Learning I just love visiting the UK ... Been there many of times.


-=GregB=-
ncmako
7
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 23rd Mar 2014 16:57
GDBman
Are you looking for something like this..???

Used a trigger to run script. Once countdown ends, game over.
It's a very simple short script. If so, I can send it your way.
best

You know you're a bad gamer when you're able to run out of infinite lives.
GDBman
FPSC Reloaded TGC Backer
5
Years of Service
User Offline
Joined: 21st Mar 2014
Location: Apache Junction, Az.
Posted: 24th Mar 2014 18:03
Hi ncmako
That's perfect .... Yea!

Thanks

GregB the grandpa
ncmako
7
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 24th Mar 2014 19:24 Edited at: 26th Mar 2014 16:42
GDBman
Here you go, just drop into your fpsc files folders. I included two
sample maps using stock media. One triggers when player enters a zone, the other when player pushes a switch. You can study the scripts to get an idea. Any terminology that isn't clear, look
it up in the "syntax" list for a quick description.
Any problems, just ask.
best ncmako

You know you're a bad gamer when you're able to run out of infinite lives.

Attachments

Login to view attachments
GDBman
FPSC Reloaded TGC Backer
5
Years of Service
User Offline
Joined: 21st Mar 2014
Location: Apache Junction, Az.
Posted: 25th Mar 2014 01:26
Thanks so much I'll give it a try and get back to you

GregB
GDBman
FPSC Reloaded TGC Backer
5
Years of Service
User Offline
Joined: 21st Mar 2014
Location: Apache Junction, Az.
Posted: 25th Mar 2014 04:31
ncmako

I know your going to think this is trivial But for me what a break through When I first loaded up your countdown_timer.fpm the only thing that showed up on the screen was TimeLeft.dds no numbers
and the same for countdown_timer_activated.fpm. So I loaded up countdown_timer.fpi in the editor. I found it pointing to red.dds so I change the path and file to numeric1.dds and it works.

Thanks so much for the code and I not knowing anything was able to figure it out.

I will pass on the kindness to some newbie as I get more advance in my code abilities.


GregB -=grandpa=-
ncmako
7
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 25th Mar 2014 14:05
GDBman "aka-grandpa"
Quote: "I found it pointing to red.dds "

Ah yes, Sorry about the custom "red.dds", I forgot about that one.
And I looked over to make sure all was stock also. But getting older eyes/mind aren't so good anymore...
Very glad you figured it out though As always, any problems
ask for help.
best

You know you're a bad gamer when you're able to run out of infinite lives.
GDBman
FPSC Reloaded TGC Backer
5
Years of Service
User Offline
Joined: 21st Mar 2014
Location: Apache Junction, Az.
Posted: 26th Mar 2014 01:14
ncmako;
You were a great help. Without your guidance . I'd still be struggling

Thanks GregB -=grandpa=-
ncmako
7
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 26th Mar 2014 16:46
Updated scripts for the download above so others who may
download don't have any problems. Hud now points to stock
"numeric2.dds" file.
best

You know you're a bad gamer when you're able to run out of infinite lives.

Login to post a reply

Server time is: 2019-09-19 10:28:03
Your offset time is: 2019-09-19 10:28:03