AA Canon

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

script

Post by tltrude »

post your script thread.
Tom Trude,

Image
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

fire_flak88:
// Set it to what you
// would like to destroy.
local.target = ($blast_1.orign)
// Start the main gun fire animation.
$flak88 anim fire_scripted
// Wait to give time to the shell to get to the target.
wait 1
// Set the animation back to idle ( else the fire
// animation will not work the next fire )
$flak88 anim idle
// Spawn the explosion animations.

waitthread blow_a_place_up
end

blow_a_place_up:
// Just a test target. Set it to what you
// would like to destroy.
local.target = ($blast_1.origin)
// Spawn the explosion animations.

local.Exp1 = spawn "fx/scriptbazookaexplosion.tik"
local.Exp2 = spawn "animate/fx_mortar_dirt.tik"
local.Exp3 = spawn "animate/fx_mortar_higgins.tik"
// Shake the ground hard.
exec global/earthquake.scr .23 4 0 0
// Get the animations going.

local.Exp1.origin = local.target
local.Exp1 anim start
local.Exp2.origin = local.target
local.Exp2 anim start
local.Exp3.origin = local.target
local.Exp3 anim start
wait 1
// Remove the animations.
local.Exp1 remove
local.Exp2 remove
local.Exp3 remove
end

thanks
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

i had an idea, wjat if i put all that in an if statement. like if i put

local.reload = 1
if (local.reload = 1) {
*script here*
}
local.reload = 2
wait 2
local.reload = 1

would that work?
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

also, could you do somehting like this to make part of your wall dissapear after being hit,

*scripted explosions removed*
remove $wall_1
end

woudl seomthing like that work, when i tried it didnt.
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

ok, the reload question can be discarded. to fix it, i moved the idle stage of the flak_88 to the very end so it couldnt be fired more than once at a time. i still dont know the answer about the remove one though. please help.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

wall

Post by tltrude »

You have it backwards:

$wall_1 remove

But, there is a really cool way to blow up walls. It is called an exploder and uses the exploder script in the global folder (pak0). With it, you can add chunks that fly out, make the wall vanish and a smashed version of the wall appear, and add extra explosions/fires.

Once it is set up you can set it off with a single line in the script.

exec global/exploder.scr::explode 1

========================================
Here is the little tutorial found at the top of the exploder script:

// Exploding chunk system created by Mackey McCandlish.
//
// Before level waittill prespawn "exec global/exploder.scr".
//
// Used in levels where stuff blows up.
//
// Create a script_object that is a "undestroyed" version of the thing that is supposed to blow up and targetname it "exploder"
//
// Create a script_object that is a "destroyed" version of the thing that is supposed to blow up and targetname it
// "explodersmashed". They occupy the same physical space.
//
// Create script_object chunks of geometry that are going to fly out of the destroyable object/building and place them in the
// places they're supposed to fly from. Make them near but not touching the geometry of the explodersmashed. Targetname them
// "exploderchunk".
//
// Create one script_origin for each exploderchunk and make the chunk target the origin the same way a jump pad would target
// the jump pad destination in Quake3.
//
// Create script_models with targetname "exploderfire" and the "model" value of the tiki you want to use. These will be tiki
// explosions that will go off.
//
// Give all the chunks, smasheds, fires, and exploders the same #set value. Note you can have any number of smasheds, chunks,
// fires, or exploders, but typically you only have one smashed and one exploder. The reason you would want multiple of any
// of these is that you can give any of them a #pause value, and that will make it delay that long before occuring, so you
// could create a multistage explosion.
//
// You can create an explodertrigger (with the same #set), or just do "thread global/exploder.scr::explode #" (# being the
// #set value of the exploder in question).
Tom Trude,

Image
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

um, how do u name a wall, when i try i end up naming the world spawn. is there some property i have to give it. thanks for the tut thing, thats cool.
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

ok, im goin crazy. i though moving the idle thing would work but i guess not. how can i make this thing wait between firing? im sure this is easy, im just dumb
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Targetname

Post by tltrude »

You have to turn the wall into an entity. Highlight it and hit key N to bring up the entity window. Then find "script_object" on the list (if you click on the list and hit key S, it will take you right to the Ss) and double click it. Now you can give your script_object wall a targetname with

Key: targetname
Value: wall_1

(or Value: exploder; Key: #set; Value: 1).
Tom Trude,

Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Wait

Post by tltrude »

In the entity properties (key N again) of the gun's trigger put:

Key: wait
Value: 5 // or the number of seconds you want.
Tom Trude,

Image
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

will it wait at the first fire? like if you walk up to hit, never been fired before, will it wait to fire?
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

local.reload = 1
if (local.reload + 1 = 2) {
fire_flak88_1:
local.target = ($blast_1.orign)
local.reload = 2
$flak88_1 anim fire_scripted
wait 1
wait 2
$flak88_1 anim idle
waitthread damdage
end

damage:
local.target = ($blast_1.origin)
local.Exp1 = spawn "fx/scriptbazookaexplosion.tik"
exec global/earthquake.scr .23 4 0 0
local.Exp1.origin = local.target
local.Exp1 anim start
wait 1
local.Exp1 remove
end

the problem with the solution above is that even right when u walk up to it, it will wait a couple of seconds, by doing this would it make it wait ONLY after it had been fired? thats what im shottin for.
Post Reply