Jump to content

Exploding Motorcycles for fun and profit.


superdave

Recommended Posts

Hi all, Im working on a mod where the lone wanderer has been nabbed by a a group of vengeful raiders who are pissed off at being hunted by the player. To make a long story short, It's somewhat allot like Moxi from another another great game.

Anyway as the player runs around killing enemies etc. motorcycles drop from the ceiling causing even more havoc.

Thats the problem. I want them to explode on contact with the ground. I've tried using playexplode in a scripted trigger, making the motorcycle a creature, and dropping grenades at the same time.

Grenades work okay, except they take to long to explode.

I've spent hours messing with different configurations, if anyone has any ideas...

Link to comment
Share on other sites

superdave - Hello!

 

"Thats the problem. I want them to explode on contact with the ground. I've tried using playexplode in a scripted trigger, making the motorcycle a creature, and dropping grenades at the same time."

 

Well if I were going to do it I'd take advantage of the already built in Destruction settings on motor bikes.

 

Give the motor bike a unique reference & set it to persistent.

 

Call it for example:

 

BigBoom01

 

I'd then use this line to detonate it:

 

BigBoom01.DamageObject 83

 

I chose 83 as the amount to damage the bike because that's where the Bikes Destruction data is set to trigger it's explosion.

 

I tried this with the script attached to a trigger that was set off by the player entering.

 

Obviously you'd just use a version incorporated into your dropping the bike script.

 

You could give each bike it's own Reference name so that you can trigger them at different times.

 

" I want them to explode on contact with the ground."

 

I'd just use a float timer so the bike does not detonate in the air.

 

You can play with the timer length to see how long it takes to hit the floor.

 

It won't be exploding because it's hitting the floor but if you time it right it will appear to be.

 

Sample script (with no drop) to demonstrate what I'm talking about, the script is on a trigger zone with a vanilla bike set up as mentioned above:

 

 

 

SCN BigBoomBikeScript

 

float timer

short HasFallen

 

; My example is just started by the player entering a trigger

; you can use what you like to initiate this

; Sets the short to 1 to say the bike is falling

 

Begin ontriggerenter

 

set HasFallen to 1

 

end

 

begin gamemode

 

; If the bike is falling, that's set to 1, check timer to see if it's allowed to explode

; just change the 5 in there to what ever time you need for the drop to the floor to be over

 

if HasFallen == 1

if timer < 5

set timer to timer + getSecondsPassed

else

BigBoom01.DamageObject 83

set HasFallen to 2

 

endif

endif

 

end

 

As is normal anything with ; is just explanation & can be left out.

 

This is just a quick throw together to illustrate what I'm talking about rather than your finished script.

 

This script works as long as you've set up the trigger & the bike accordingly though.

 

Hope this helps!

 

Prensa

 

EDIT: "Grenades work okay, except they take to long to explode. "

 

If you want a grenade that explodes on impact you need to erase the time in the timer setting & tick "Trigger on impact" instead of Alt Trigger, you change those settings on the Grenade Projectile as that is the actual object that explodes rather than the version you hold.

Edited by prensa
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...