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 / Cascading exploding entities, how do I do it?

Author
Message
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 24th Aug 2010 00:16 Edited at: 24th Aug 2010 00:21
I have 12 entities in a room, and a control panel.

I would like to be able to destroy the control panel and this triggers a cascading explosion down the rows of entities.

At the same time, as each entity explodes, a zombie appears and ragdolls. Nbt showed me how to do the 'appearing zombie' trick, so now, I would like to be able to combine the two!

In other words, I destroy the control panel, this then sets off the cascading explosion. As each entity explodes, a zombie appears and ragdolls to the floor, then the next entity down the line does the same thing, each one setting off the next one, all the way down the row of entities.

Is this possible, and if so, how do I do it? (I've tried searching, but can't find an answer to this).

I game therefore I am.
Nbt
15
Years of Service
User Offline
Joined: 11th Oct 2009
Location: Behind you!!
Posted: 24th Aug 2010 02:38
Simple bruce, just set each zombies death to trigger the next explosion in the same way I showed you. i.e. add ragdoll to the destroyandactivate.fpi script and save as a new version and use that as the zombies destroy script. Then do as before placing the next spawning bomb entity etc in the zombies "IfUsed" property.

I have attached an edited destroyandactivate.fpi (with ragdoll) that should work lol

Attachments

Login to view attachments
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 24th Aug 2010 03:22
Sorry Nbt, I'm going to have to sort this out another time, I've got some arsewipe from another forum calling me a liar, when all I have done is state an opinion, and it's got me seriously ******* off. Thanks anyway

I game therefore I am.
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 24th Aug 2010 17:58
I've calmed down now, last night's problems have been dealt with, no more being called a liar for no reason! Anyway, where were we? Ah yes.

I'm not sure I follow you exactly. What I need is to be able to destroy a control panel, which sets off the first stasis tube being destroyed in an explosion, followed by its spawning ragdoll zombie, which in turn sets off the next exploding stasis tube, which in turn spawns its own ragdoll zombie, and so an and so on, all the way down the rows of stasis tubes.

Will that script you made for me achieve this? Or is it more complicated than that? Will I have to create invisible bomb entities to make each stasis tube explode? Or is there some way of making the stasis tubes explode just by being activated?

I game therefore I am.
Nbt
15
Years of Service
User Offline
Joined: 11th Oct 2009
Location: Behind you!!
Posted: 24th Aug 2010 18:11
bruce mate you already got the tube explosion, spawn zombie, spawn invisible bomb entity to give zombie a little shove forward, zombie flops down dead via ragdoll that we did before right?

It's just a matter of chaining more of the same, but this time the death of the zombie triggers the next tube and so on. The script I attached is just the same destroy and activate one we used before, but with ragdoll enabled, as this time we want the zombie to be the trigger for the next in the chain.

So the zombies (up until the last one of course, as then there are no more tubes to blow up) are the trigger for the next tube in your chain of explosions.

Yes you can just have the tube explode, but as you found out yourself, there is always a little lag time when the zombie is spawned and tube has already blown up, so we rely on the zombies lifespan to kill it. Well this is all well and good, except the zombie (even with ragdoll) tends to just fall down dead in a heap, so we give it a little push with our invisible bomb, so it flops forward on death.

bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 24th Aug 2010 18:27
Ok, I understand that, just one problem, we didn't make an invisible bomb! Or did I miss an email or download? I've had that much going on and distracting me, it wouldn't surprise me if I did miss something!

I game therefore I am.
Nbt
15
Years of Service
User Offline
Joined: 11th Oct 2009
Location: Behind you!!
Posted: 24th Aug 2010 21:50
Check back to your original topic and you will see this reply (scroll down) - the invisible bomb is the crate -

http://forum.thegamecreators.com/?m=forum_view&t=174527&b=23

Quote: "Brucie baby, do as I did and make the tube also spawn an exploding entity (i.e. give the entity and zombie the same name) just behind it to kill the zombie give it a little push in the direction you want. (make the exploding entity "isimmobile Yes" so it does not bounce around on spawn)

Give the zombie 1 health and set AI script to default.fpi etc. Only need about 5 exploding damage for the entity to kill the zombie. Also set the zombies weight and friction both to around 1000 so it flops slow and slides a bit over anything. I also removed the sound set so the zombie never went "aghhhh!" on death

p.s. even though FPI Pad may moan about ragdoll it will still save that script out for you.
"


bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 24th Aug 2010 22:28 Edited at: 24th Aug 2010 22:30
Doh! So I did miss something out then! Back to the drawing board *sigh*

Sorry Nbt, I'm struggling to get my head round this.

I understand the bit about the destroyed tube spawning an exploding 'invisible' crate, as well as the zombie.

I still have 2 questions for you though;

1, What causes the 'invisible' crate to explode when it is spawned?

2, What causes the stasis tubes to explode when they're activated, before spawning the 'invisible' crate and zombie?

If it helps, I've attached a little txt document, describing the exact chain of events that need to happen. But it still doesn't answer my two questions.

Sorry if I'm trying your patience by being so dense :S

I game therefore I am.

Attachments

Login to view attachments
Nbt
15
Years of Service
User Offline
Joined: 11th Oct 2009
Location: Behind you!!
Posted: 24th Aug 2010 23:13
1. Lifespan of 1
2. The trigger for the 1st tube and then the death of the zombies after that.

Use this as the tubes AI script:

and set the tubes strength to 5000 (so it does not get destroyed by accident from player shooting it and of course set the tube as explodable in it's properties.

Just remember that unless you have a special made tube, it will blow up and no blown up tube carcass will be left where it once was.

bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 24th Aug 2010 23:39 Edited at: 24th Aug 2010 23:54
Ok, thanks, I think I get it now.

Now to trawl the media threads for an invisible crate, or at least, how to create one myself!

(Edit) Scratch that last comment, I've just made my own by customising Anayar's heltor crate with an invisible texture! It was easier than I though it would be, I just made a simple, transparent alpha layer texture

I game therefore I am.
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 25th Aug 2010 16:04 Edited at: 25th Aug 2010 16:05
Sorry for the double post. I've set it all up, with the right entities, the right scripts, the right numbers etc etc Exactly as Nbt has shown me. But this cascade still doesn't want to work.

Here are the problems I'm having with this;

1, The control panel doesn't activate the first tube, even though its set to destroyandeactivate.

2, None of the tubes or invisible crates are being activated, inspite of being set up with the right scripts.

3, Instead of being destroyed when they are activated (they're not getting activated for some reason), they are being destroyed by the previous entity's explosion (which is achieved by me manually shooting them).

4, I have tried turning down the explosion damage of each entity to prevent them destroying the next entity, but this doesn't work either.

I am now on the point of giving up on this cascading expplosion idea, as nothing I try, inspite of Nbt's most valuable help, seems to work.

The main thing I need help with is to get the entities to explode when they are activated, instead of being destroyed by the previous enitity's explosion.

Does anyone have any other ideas?

I game therefore I am.
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 26th Aug 2010 17:54
Please, does anyone have any thoughts or suggestions about this? My game is currently on hold until I can this sorted, as it's a crucial sequence in the game.

I game therefore I am.
ctm
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 28th Aug 2010 17:05 Edited at: 28th Aug 2010 17:26
This has cost some time..
I run into problems when i tried to activate the entities one by one by the previous activated entity.
The engine totally ignored the timers.

Here is a working and tested way to do that:

The control panel activates a control center (controlC) when it gets destroyed.
The control center (controlC) activates the exploding tubes (child1 - child4).
The exploding tubes are triggering the spawning characters (child11 - child 44).

A picture to show what i mean:
(i placed the characters in front of the tubes to be able to see them in this screenshot)


Lets do it step by step:
Note:
All entities have to be set to dynamic and if you don't want to change the names of the tubes and characters in the script you have to name them the way i did (child1, child11, etc.)

Control panel set up:

Name: your choice, you can leave it as is

Start script: appear1.fpi
Main script: default.fpi
Destroy script: destroy\destroyandactivate.fpi

If Used: controlC

Strength: 10
IsImmobile: Yes
Physics On: No
Explodable?: Yes
Explode Damage: your choice (i used 1).
_________________________________________

Control center setup:

It doesnt matter what entity you are using here as long as it is dynamic and in the same room.

Name: controlC

Start script: appear1.fpi
Main script: activator.fpi :

Destroy script: disappear1.fpi

If Used: --- (keep this field empty. The targets get set in the script)

Strength: 0
IsImmobile: Yes
Physics On: No
Explodable?: No
________________________________________

Tube set up:

Note:
It's best to setup one tube at first and when that's done use a copy of it for the other 3 tubes.
The only thing you have to do then is to change the names of the tubes and the names in the If Used fields. (same procedure for the characters)

Name: child1

Start script: appear1.fpi
Main script: dieDelayed.fpi :

Note: the script subs the 500 health to make the tube explode.
So the Strength of the tube has to be set to 500 or below.

Destroy script: destroy\flamable.fpi

If Used: child11

Strength: 400
IsImmobile: Yes
Physics On: No
Explodable?: Yes
Explode Damage: your choice (i used 1).
_________________________________________

Tube nr.2 :
Name: child2
If Used: child22

Tube nr.3 :
Name: child3
If Used: child33

Tube nr.4 :
Name: child4
If Used: child44
__________________________________

Character set up:

Name: child11

Start script: appear1.fpi
Main script: instantDeath.fpi :

Destroy script: destroy\leavecorpse.fpi (with added ragdoll action)

If Used: --

Spawn at Start?: No
Max at any time: 1
Maximum Spawn: 1

Lives: 1
Health: 400

IsImmobile: No
Physics On: Yes
_________________________________________

Character nr.2
Name: child22

Character nr.3
Name: child33

Character nr.4
Name: child44

Hope this helps

Attachments

Login to view attachments
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 28th Aug 2010 18:07
Wow ctm, what can I say, except a huge thank you for taking the time to help me with this.

I will be trying this out later tonight, as I have other (household) things to do right now. I'll let you know if it works.

Obviously, if it does work, you will get credited in-game, along with Nbt, for helping me with this.

I game therefore I am.
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 29th Aug 2010 05:48
Well, it's 3:45 in the morning and I'm buzzing!! It worked!!

Thanks ctm!! Credits to you will be added in-game!!

Just one question, is there a limit to the number of tubes I can destroy in a single cascade? Or can I adapt the scripts to destroy all 12 tubes in the room?

I game therefore I am.
ctm
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 29th Aug 2010 11:27
You're welcome

Quote: "is there a limit to the number of tubes I can destroy in a single cascade? Or can I adapt the scripts to destroy all 12 tubes in the room?
"


Should'nt be a problem. All you have to do is adding 2 lines per tube to the activator script.
This would be the code for the fifth tube:

:state=5:settargetname=child5
:state=5,etimergreater=2000:activatetarget=1,state=6
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 29th Aug 2010 17:34
After I asked the question, I had a go at adapting the scripts myself; like you said, it was as simple as just adding those two lines for each tube, but changing the names for each of them.

I've tried it all out in my test level, it all works, now it's just a matter of putting it all into my game level, once again, thanks a lot ctm

I game therefore I am.

Login to post a reply

Server time is: 2024-11-24 19:45:32
Your offset time is: 2024-11-24 19:45:32