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 / NEED HELP with Time Bomb Planting Script

Author
Message
Minimovies Inc
16
Years of Service
User Offline
Joined: 22nd Feb 2008
Location: Reeedwwwaaallll!!!
Posted: 21st Jul 2008 01:27
Hi all! This is my very first script, and it's coming along well. I need help to fix some things of which I don't know any scripts for. It would help if there was a "setentityhealth=0" script, but is there actually one?
Anyway, here it is:

;Artificial Intelligence Script

;Header

desc = "Use" Action near a red Bomb indicator then setting the bomb, then the bomb will explode after some seconds.

;Triggers

:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertouse.tga,hudname=plantbombprompt,hudhide=1,hudmake=display,state=1
:state=1,plrdistwithin=60:hudshow=plantbombprompt,hudfadeout=plantbombprompt

:state=1,plrdistwithin=60,plrusingaction=1:state=2
:state=2:alttexture=1,setalphafade=100,sound=gamecore\guns\modernday\uzi\dryfire.wav,hudhide=plantbombprompt,timerstart,state=3
:state=3,timergreater=6000:sound=gamecore\guns\ww2\bazooka\explode.wav,rundecal=1,triggerforce=600,state=4
:state=4,:destroy

;End of Script

EXPLANATION:
The player will walk to the entity which resembles a bright red shape of the bomb (the red colour is it's primary texture). If the player is close to the bomb placement slot, you can see a hud. The player presses enter.
A 'click' is heard, the entity switches to its Alternative Texture (which makes it appear as if the bomb appears in the previously red bomb slot).
After 6 seconds, the bomb should explode (i.e. run an explosion decal, run a sound file, cause enities and player nearby to suffer damage and knockback force, and the bomb entity itself should then be destroyed).

That's what's supposed to happen. Everything works fine, but it doesn't run any decal, and doesn't affect nearby entities and player at all.

How can I fix this? Can anyone tell me?

Thanks

A starting Games Designer. Need levels, characters and anything drawn and designed? Let me know...
Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 21st Jul 2008 02:25
did you make it explodable?

I know not what WWIII will be fought but I do know that WWIV will be fought with sticks and stones-Albert Einstein
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 21st Jul 2008 03:02 Edited at: 21st Jul 2008 03:04
First error, you use hudfadeout as well as hudhide. This is redundant. take out the hudhise command.

Also, Plain as day, in state=4,: Take out the comma.

I think that that is it. Nice script.

Also, make it explodable and set the dammage to 1000.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 21st Jul 2008 23:42
I'm sure it doesn't appear to make a difference because "hudhide" does not hide the HUD during execution of the script. It just tells the engine that the HUD should be hidden by default when you are creating it. This is why there is a "hudhide=1" when you make the HUD. To instantly hide a HUD, use the command "hudunshow=<hud name>".

Also, just as has been mentioned, remove the unnecessary comma in state 4. Call it a good habit to get into.


That is a great script you made! Very nice "first" especially. Reminds me of the bomb points in Metal Arms.

You deserve a cookie!


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Minimovies Inc
16
Years of Service
User Offline
Joined: 22nd Feb 2008
Location: Reeedwwwaaallll!!!
Posted: 22nd Jul 2008 01:14
Thanks Ply and Hybrid!
I should have spotted that comma... I'll post again after I beta test it with faults removed. Should I make it explodable and set the damage in the entity properties field?
The hudhide isn't a problem. The hud disappears as it should when I press the use key.

@Ply,I actually based my idea on the bomb objectives in Medal of Honor Allied Assault and Hidden&Dangerous 2.

A starting Games Designer. Need levels, characters and anything drawn and designed? Let me know...
Minimovies Inc
16
Years of Service
User Offline
Joined: 22nd Feb 2008
Location: Reeedwwwaaallll!!!
Posted: 22nd Jul 2008 01:26
Ok, I tested it and the script is cleaned up. This happened:
It doesn't run any decal, it blows nearby dynamic entities away (which is an improvement), but doesn't cause any damage to the player or the entities...
I also set the bomb's destroy fpi to flamable.fpi, and set its physics to explodable YES and Explode damage 1000.
What went wrong? And how could I make the explosion radius higher?

A starting Games Designer. Need levels, characters and anything drawn and designed? Let me know...
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 23rd Jul 2008 00:50
Applying a force does not cause damage, it simply forces objects away.

In order to cause it to truely "explode" you'll need to have the entity destroy itself with it's properties set up so that it's explodable. You can do this a number of ways.

Your decal not running could be that you didn't give your entity a decal in it's FPE file. You may have given it one, but without seeing it's FPE file, I can't say for sure, but that's the likely cause.


The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Minimovies Inc
16
Years of Service
User Offline
Joined: 22nd Feb 2008
Location: Reeedwwwaaallll!!!
Posted: 24th Jul 2008 00:24
Can you tell me how I would activate the bomb's explosion properties (in the editor) using an fpi file command?
And no, I don't have an FPE file made.

A starting Games Designer. Need levels, characters and anything drawn and designed? Let me know...
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 24th Jul 2008 01:07
Well, decals are assigned to an entity inside their FPE file. So if you are wanting a decal to be run with your entity then it needs to have an FPE file that gives it the proper decal.


There are a lot of Editor properties that cannot be changed using FPI commands. Sorry. However, there may be work arounds for it depending on what you are trying to accomplish.



The one and only,


Whosoever says, "Don't sweat the small stuff," is obviously not a programmer.
Minimovies Inc
16
Years of Service
User Offline
Joined: 22nd Feb 2008
Location: Reeedwwwaaallll!!!
Posted: 24th Jul 2008 15:43
Yeah, thanks anyway! I'll have to wait for the entityhealth=X script to come along. Is that in your Mod, Ply?

A starting Games Designer. Need levels, characters and anything drawn and designed? Let me know...
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 24th Jul 2008 17:13
That is in the 1.13 beta now.

Minimovies Inc
16
Years of Service
User Offline
Joined: 22nd Feb 2008
Location: Reeedwwwaaallll!!!
Posted: 24th Jul 2008 21:00
1.13 isn't out yet though, is it?
Oh by the way, have any of you heard of the Sensei AI package?
It's very useful, and I'm trying to improve his Ally script at the moment. I like scripting more than I first imagined!
I bought FPSC since I want to be involved in the Games Design business later in life, and now I like designing games AND scripting. Anyway, thanks for all the help!

A starting Games Designer. Need levels, characters and anything drawn and designed? Let me know...
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 25th Jul 2008 00:20
Sensei requires empty's mod to work. Also, 1.13 BETA is out as of now.

Minimovies Inc
16
Years of Service
User Offline
Joined: 22nd Feb 2008
Location: Reeedwwwaaallll!!!
Posted: 26th Jul 2008 22:29
When will it be officially released for download? No wonder those scripts didn't work properly... I'm not downloading any mods for now.

I like the new elemental avatar, Hybrid!

A starting Games Designer. Need levels, characters and anything drawn and designed? Let me know...
Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 26th Jul 2008 22:34
Thx.

Login to post a reply

Server time is: 2024-11-24 11:30:40
Your offset time is: 2024-11-24 11:30:40