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 / Destroy entity script chain help

Author
Message
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 13th Mar 2011 16:17
i tried and tried, even searched... and everything seems to be as it should be - properly set up and i dont see any real errors in the code.
im using a older "explosive doors" scripts.
But all im usign it for is a sewer crate (got 2 versions, one is broken "after explosion" one.
The main entity uses following scripts:
Start: appear1.fpi
Main:

Destroy:


Its dynamic, IfUsed field is set to "expl1"

expl1 is a simple transparent entity for the explosion.
Start: appear1.fpi
Main: default.fpi
Destroy:


Its dynamic.
Respawn at start is set to NO.
Spawn after delay is YES.
Spawn Life = 1 (so when it is called, it destroys itself fast).
Explodable = Yes


The trigger key (code 50) is M.
setvar=1 value is from:

Thats the main script in the explosive itself.


So i can pick it up, i get the option to use M, and then.. nothing.
The original door doesn't disappear. So i didn't even bother linking the replacement entity (after explosion) to the expl1 entity, since it doesn't seem to reach this far.


So does anyone see any errors in this?
Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 13th Mar 2011 16:46 Edited at: 13th Mar 2011 19:37
:::::REDACTED BY SETH BLACK:::::

dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 13th Mar 2011 17:15
yeah as i said, it wasnt originally my script. Im just starting with scripts.
Tho interesting, the pickup part actually works, it does confirm it and lets me activate the pickup script (since i can hear the audio being played).

Also the Respawn on start = no should mean that the entity doesent spawn until its called, but it does.

So somehow it like runs the script partially (but the main item that i want to destroy, doesn't disappear - and it has 1 Strenght, its also dynamic)
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 13th Mar 2011 17:31
Turn on the Show entity game information, under the debug, under File, Preferences.

There is a part in that info when you run the test game that shows what state the script is in. (S)0 it will also show you what frame is being played and some other stuff that are useful for testing.

Keep at it. In about a week it will all start making more sense.

Nothing but coffee in my veins 'Insomnia is Coming'
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 13th Mar 2011 17:59
right, the replacement (damaged) entity i was gonna replace with... was static...

So it does disappears now.. But apparently the whole loop is stuck in the main entity part (the one that reads keystroke to activate) - it rusn the audio but doesn't seem to call the expl1 or destroy itself.

also one of the destroy scripts had
:state=1,timergreater=1000:state=2,destroy
... but there is no state=2..
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 13th Mar 2011 18:39 Edited at: 13th Mar 2011 19:00
That is correct, Some of the actions are called this way to break the loop of that particular script. This will cause the engine not to have to process that anymore.

You need to use the action Explode somewhere in the main AI script, before the entity is destroyed by losing all it health.

Ex:

State=25,plrdistwithin=100,cantake:Explode,rundecal=0,state=26

This will explode the entity when the player comes within 100 unit of the entity.

In the download button there is a test map and script for a simple explode, using the explode action.

Nothing but coffee in my veins 'Insomnia is Coming'

Attachments

Login to view attachments
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 13th Mar 2011 19:12
how about this part - if fbi script follows common programming logic:
:state=0:state=1,plrsound=$0,activateifused=1,timerstart
:state=1,timergreater=1000:state=2,destroy


doesent it go to state=1 (does everything in state=1) then continues state=0.
However Timerstart is declared after it has executed to the timergreater=1000.

And since its always false, it doesn't destroy.
perhaps:


so it starts the timer before checking if its true.
Seth Black
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location: Pittsburgh, PA
Posted: 13th Mar 2011 19:21 Edited at: 13th Mar 2011 19:38
:::::REDACTED BY SETH BLACK:::::

...ignore this as well.

Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 13th Mar 2011 19:30
Your first one: Script starts at state0, then goes to state1. starts timer and checks its condition in the same state. That does not work. Need separation like you did in the code snippet.

The one in the code snippet looks like it will work better, because the timerstart and timergreater= are in two different states.

Might consider etimerstart and etimergreater. Works for just that entity (local) and does not interfear with or get interfeared with anything else.

Somethings need to be seperated to get them to work.

I need to go off to work. If you zip up the assets and test map with the scripts. I can get a better handle on it. The puzzle is not complete. I will look at it when I get home, if you have not gotten it by then.

You can send it to my email posted in my profile. or post it in the download button, and I will get it later today. Same with your other post.

Nothing but coffee in my veins 'Insomnia is Coming'
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 13th Mar 2011 20:24
my latest change + using etimer-s instead fixed it

All i need now is a some kind of explosion effect on it
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 13th Mar 2011 21:30
PS, still wouldnt mind help...

Can i use script itself to activate a entity - since the model wont drop the bomb, i thought of faking it by placing a 2nd copy (without pickup script), at the proper position,set spawn to NO and then use script to activate at the same time i "set the bomb" so it appears and gets destroyed when it should.

But i cant find a command or proper info.. i did see "activatetarget=" but no info as of what value or where/how do i specify the target.
Pirate Myke
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, Ca
Posted: 14th Mar 2011 04:43
activateallinzone

activateifused - most common way. place name of the entity in the if used in the editor under the entitys properties. Name all entitys the same name if more then one. you can have them not spawn until the activateifused is used in the script of the trigger

activateifusednear

activatetarget - used with settargetname ( I was going to point you towards Seth's reply, but he removed it for some reason. )


I thought all these had script in the scriptbank already. You can reference them and mix and match them.

All above are actions

Nothing but coffee in my veins 'Insomnia is Coming'
dustofdeath
13
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 14th Mar 2011 18:16
yea, but just thought of mixing it in with a copy of main activate script (so when i press H it activates the bomb model and destroys in 3-4s as it should).
So i use settargetname in the same script (settargetname=bomb1), and can use activatetarged=bomb1 right after that?


Right now i just set it to spawn when i find the main bomb (tho just cheezy to let the bomb spawn there before u get to the spot).

Login to post a reply

Server time is: 2024-11-24 10:54:18
Your offset time is: 2024-11-24 10:54:18