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 / player wins level when dies?

Author
Message
Hador
User Banned
Posted: 14th Dec 2009 01:41 Edited at: 14th Dec 2009 01:42
how would this script be made? I want the player to be "incapacitated", and then win the level. is it even posible?
I am using fenix mod.

DevBox forum http://www.devbox.6te.net
RATE PIXEL game ratings http://ratepixel.orgfree.com
My site http://www.hador1996.webs.com
The Fps Creator rocks!
16
Years of Service
User Offline
Joined: 24th Oct 2008
Location: Sneaking down your chimney.
Posted: 20th Dec 2009 17:30
I wanted a feature like that as well.

Hador
User Banned
Posted: 20th Dec 2009 22:11
oo bad noone knows how. the helth could be lower than 1 or 2 and then go to the next level, but I have no clue how to script it.

DONATE TO FENIX MOD!
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 21st Dec 2009 01:41
Attach this script to a random dynamic entity (preferably hidden) in your level. Give this entity an "IsObjective" value and make sure it is the ONLY thing in your level that is an objective. Make it AlwaysActive as well so that the script will always run:




Now, when the player's health becomes less than 0, the script will force the player to "take" the entity, thus completing the objective and finishing the level.

That's the idea, anyway. Haven't tested, but it makes sense, right?


The one and only,


Hador
User Banned
Posted: 21st Dec 2009 04:13
picking it up and it ending the level makes sense. will test tommorow.

DONATE TO FENIX MOD!
Flatlander
FPSC Tool Maker
18
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 21st Dec 2009 04:15 Edited at: 21st Dec 2009 04:17
It probably depends on what is checked first. The entities script, then the objective or the players health. I haven't looked at Lee's code but if the player's health is checked first then the player will die regardless of the entity script. It needs to be checked but that won't be too hard.

Hador, let us know thanks.

-----------------------------------------------
OliveTreeGames
Hador
User Banned
Posted: 21st Dec 2009 04:56
most likely the health needs to be higher than 0, but too tired to test. going to bed.

DONATE TO FENIX MOD!
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 21st Dec 2009 06:03
I made a script that forced a quickload upon player's death, so I know for a fact that scripts are running while the player death sequence is going.

The only question left is whether or not the level can be completed with the player dead.


The one and only,


Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 21st Dec 2009 07:11
Quote: "Attach this script to a random dynamic entity (preferably hidden) in your level. Give this entity an "IsObjective" value and make sure it is the ONLY thing in your level that is an objective. Make it AlwaysActive as well so that the script will always run:"


Well this is a first, play wrote a script wrong

Ply wrote it

:plrhealthless=0:plrtake

first off it can't be less then 0 because if the internal player health variable is less then 0 it is set to 0

and its playertake not plrtake
so the proper script is



Hador
User Banned
Posted: 21st Dec 2009 15:29 Edited at: 21st Dec 2009 16:04
wow, ply wrote a script wrong and then hockeykid corrected him
I'm gonna test this now.

EDIT: it worked! when the player died, it picked it up, and faded out before it tried to respawn me.

DONATE TO FENIX MOD!
Flatlander
FPSC Tool Maker
18
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 21st Dec 2009 23:43 Edited at: 21st Dec 2009 23:45
Cool. Thanks for letting us know Hador.

I've never seen plralive used or knew a good way to use it. Well, here we go.

-----------------------------------------------
OliveTreeGames
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 24th Dec 2009 23:20
Quote: ":plrhealthless=0:plrtake

first off it can't be less then 0 because if the internal player health variable is less then 0 it is set to 0"


In that respect, you are wrong. The way the "less" and "greater" commands are written is more of a "less than or equal to" and a "greater than or equal to".

At least, tehy were the last time I checked the source, but it's been a while.

Quote: "and its playertake not plrtake"


Touché
Guess I'm a bit rusty having not touched a script in ages. Doing 'em all from memory. Gotta stop doing that.


The one and only,


Login to post a reply

Server time is: 2025-05-26 00:42:59
Your offset time is: 2025-05-26 00:42:59