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 script?

Author
Message
twitchy 624
18
Years of Service
User Offline
Joined: 18th Jul 2006
Location:
Posted: 15th Mar 2008 18:36
Does anybody have a script that starts a timer counting down at the start of a level, shows the timer in the HUD and if the payer does not get do the win zone/satisfy all of the objectives, they die?
Also, does anybody have a script that limits the number of weapons the player can have and when they want to get a new weapon they must swap a weapon? Thanks.
CoffeeGrunt
17
Years of Service
User Offline
Joined: 5th Oct 2007
Location: England
Posted: 15th Mar 2008 19:01
First one is possible, I think, by using a numeric HUD, but I'm not sure.....

Second one ain't possible....

woot for toot
16
Years of Service
User Offline
Joined: 13th Apr 2008
Location: a box
Posted: 15th Apr 2008 00:05
kind of wondering bout the first one myself.... sigh guess we'll have to get into scripting
Jesper
17
Years of Service
User Offline
Joined: 14th Oct 2007
Location: Hämeenlinna
Posted: 5th May 2008 16:04
I think this is good script to that:

:state=0,plrinzone=1;state=1
:state=1,starttimer
:state=1,timergreaterthan=x,addplrhealth=-500

freewebs.com/jespergames
Visit there!
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 5th May 2008 16:37 Edited at: 5th May 2008 17:07
Quote: "First one is possible, I think, by using a numeric HUD, but I'm not sure....."

No it is not possible to display the timer using a numeric HUD at this time.
The reason is that the numeric HUDs are associated to a HUDTYPE...
HUDTYPE=1 (Lives)
HUDTYPE=2 (Health)
HUDTYPE=3 (Ammo)

There is no HUDTYPE for the timer.
I was hoping that Lee would add a few HUDTYPEs for displaying the Global variables.
However, now that we have 99 of them instead of 5 it would have to be limited to a few instead of all.
I doubt we will get any new HUDTYPEs soon, but I have no clue as to what Lee will do next.

I have already made a script system for displaying the globalvar1 as a six digit number.
This gives me a running balance of the variable since I use it for an in-game cash system.

So, I could get a display working off the timer now that we have variables with v109, but not with a numeric hud.
My cash system uses 10 seperate images (0-9) to create the huds for each digit, instead of one condensed image like the numeric displays.

So yes, number one can be done, and yes I will script it for release in a pack.
Although I have to finish the cash system first for its release, which is almost done.
The scripts are finished and you can see them in action in the video in the STORE SCRIPTS thread.
I am still working on the items used to hold the scripts, so once those models are done then I'll release it.

Here are my scripting plans to utilize the first 5 global variables...

1) Used to hold Cash value
2) Used as a Counter for the Cash Display
     3) Used for displaying Timer Minutes
     4) Used for displaying Timer Seconds
     5) Body Armor

Once these are finished then I'll make plans for more.
So don't worry, crazy things are going to happen now that we have variables. (v109 is still in beta but im not waiting)


Quote: "Also, does anybody have a script that limits the number of weapons the player can have and when they want to get a new weapon they must swap a weapon? Thanks. "

As said before that one is not possible, because the plrdrop action is non-functional at the moment.
However Plystire and Airslide have both mentioned considering adding that action to their modified engines.

Don't forget to visit Conjured Entertainment

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 6th May 2008 02:44
Here are the possible numeric HUDs:

1) Lives
2) Health
3) Ammo
4) Frags
5) Timer


However, the timer it uses is not the "timerstart" timer from scripting, it's a timer that gets started at the beginning of an MP match.


Just thought I should clear that up.


The one and only,


Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 6th May 2008 07:03
Oh yeah, I forgot about multiplayer.

Don't forget to visit Conjured Entertainment

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 29th May 2008 01:37 Edited at: 29th May 2008 01:57
Here is an update on the timer script I am working on, and my first five variables.

1) Used to hold Cash value
2) Used as a Counter for the Cash Display
3) Used for displaying Timer Seconds
4) Used for Timer Objective's Success/Failure
     5) Body Armor


You'll notice that I changed the plan to exclude minutes.
That made the scripting a lot easier and allows for the other variable to be used to dectect a success/failure.
Besides, I thought that 60 seconds is plenty of time to make someone sweat.

The thinking behind the new use of global variable 4 is to determine whether timer based objectives were successful or not.
By incrementing this number, any new timer based objectives can determine whether previous ones have been completed.
This will assist in creating a linear motion, or dynamic gameplay based on the progress to that point.

The reason I double posted was to bump this because I want to know what people think about the change I made.
Otherwise, no one would have seen my edited post since it was buried.

Don't forget to visit Conjured Entertainment

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 29th May 2008 09:40
I'm curious about number 5 in your list.

Can you make it so when the person gets shot, only a percentage of the damage goes to the armor and the rest of it leaks through to the player's health?

Lmao, yeah, okay, I'm just yanking your chain. I'd be satisfied to see some armor that's just an extension of the player's health and can regenerate after a set amount of time has passed since the player was last shot.


The one and only,


Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 29th May 2008 17:23
I was thinking of having a value #5 that has a range os say 1 to 10 for example.

First the script will take off 10 health for the shot.
Then the armor value gets added back to the health.
Then the armor value gets decremented.

For this example, having no body armor would result in 10 health lost each shot.

Full body armor would result in zero loss.
9/10 body armor would result in loss of 1 health.
8/10 body armor would result in loss of 2 health.
7/10 body armor would result in loss of 3 health.
6/10 body armor would result in loss of 4 health.
5/10 body armor would result in loss of 5 health.
4/10 body armor would result in loss of 6 health.
... and so on.

This is an easy way to take more damage as the armor wears out and all using one variable.

Don't forget to visit Conjured Entertainment

rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 30th May 2008 04:13
It would be entirely possible to have a 60sec hud timer,I've already used up to 60frames in hud animations.It wouldn't take much to include gradual health loss into this,would make a great poisoned scenario.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 30th May 2008 05:47
@Conjured:

But then aren't you simply limiting how much health is going to be taken away if the player has armor left over?

I mean, what if the player gets hit with a very strong weapon? Will he still lose the same amount of health from that as he would from a weak pistol?


The one and only,


Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 30th May 2008 19:03 Edited at: 30th May 2008 19:43
Quote: "It would be entirely possible to have a 60sec hud timer,I've already used up to 60frames in hud animations.It wouldn't take much to include gradual health loss into this,would make a great poisoned scenario. "

Yeah, I already have it scripted and working and with only 20 huds. (0-9 for each digit)
I use the same hud images as the Cash System, so no new images had to be created for testing. (saves file space too)
I had a poisoned script with my cactus plant and cactus juice years ago, but I didn't have a display for the timer because it took health until you found antidote.
But you're right, this will be good for time based poisons as well as challenges.
I am thinking of using a challenge that incorporates global 6 & 7.

Quote: "But then aren't you simply limiting how much health is going to be taken away if the player has armor left over?

I mean, what if the player gets hit with a very strong weapon? Will he still lose the same amount of health from that as he would from a weak pistol?"

Well so far, this is planned to simply add to the built in damage by scripting additional damage.
In other words, all guns get a damage boost as a result of this system.
I have no control over the damage being done internally as you know, so this is a real add-on.
The idea is that the added damage is equal to all guns, so the originial damage variances in the guns would remain unchanged.
In the end, a big gun still does more damage than a pistol.
It is an effort to simplify.

I guess I could get elaborate and use a couple variables to check and store an old health value to the current health state.
Then save that difference (yes I mean subtraction) to another variable to determine the strength of the gun being used.
But that is too complex for right now because I am pressed for time, so I will keep it simple for now.
I am stil undecided on which way to do this is best, but it is on my mind all the while.
For now I will get the timer scripts tweaking finished.
Did you see I decided a use for var 6 & 7 in that other thread?
Those turned out to be a really easy to write destroy script.

6) Enemy Frag Counter
7) Civilian Frag Counter

Don't forget to visit Conjured Entertainment

djmaster
User Banned
Posted: 31st May 2008 12:04
hmm for counter if fpsc would support gifs for huds or other animated pictures you could set the hud to display and a script that invisibly counts from 0 to 60 seconds and after that end the game or something,but animated pics are more a problem

Soldier of Fortune Episode 1
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 31st May 2008 12:10
Using an animated image would not work because you are not guaranteed that it will accurately count seconds. (I.e. Lag)


The one and only,


Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 31st May 2008 15:28
I use a one second timer for the display.
Each second that passes increments the variable by one and activates the display script.
Then it resets the timer and does it again.

The Display script then displays the timer counter.
All the display script does is display the time, and it serves no other purpose.
Any conditioning is done is the first script that is making the adjusments.

My time display system is very dynamic.
If you change the timergreater=x from 1000 to 60000, then we are now counting/displaying minutes instead of seconds.

I am making two HUDs/scripts for the display where one is incrementing the "Time elapsed" and the other decrements with "Time Remaining".

Don't forget to visit Conjured Entertainment

Login to post a reply

Server time is: 2024-11-24 09:08:31
Your offset time is: 2024-11-24 09:08:31