Hmmm, map doesn't follow my script.........
Posted: Sat Mar 22, 2003 12:02 pm
Whoah! After the mapping prob, now the script errors. They won't follow my commands like hide, or show, or runto, or lookat! Here's the script:
It's not fully scripted yet.
Code: Select all
//Subattack
//mapping by Butch
//Scripting by mohaa_rox
main:
level waittill prespawn
exec global/friendly.scr
exec global/ambient.scr m5l1b
exec global/exploder.scr
level waittill spawn
$player item weapons/bar.tik
$player item weapons/springfield.tik
$player item weapons/colt45.tik
$player item weapons/m2frag_grenade.tik
$player ammo mg 1000
$player ammo rifle 1000
$player ammo pistol 1000
$player ammo grenade 1000
$player useweaponclass mg
end
$tank hide
$tank_trigger hide
$bomb hide
$medic_trigger hide
$save1 hide
end
thread friendly_setup
thread ai_guys_atwork
thread objectives
thread mg
end
objectives:
waitthread global/objectives.scr::add_objectives 1 2 "Locate the rest of your squad." $one.origin
end
mg:
$mg42 thread global/mg42_active.scr::mg42
end
friendly_setup:
level.friendly1.targetname = 1
level.friendly2.targetname = 2
level.friendly3.targetname = 3
$1 thread deathmessage1
$2 thread deathmessage2
$3 thread deathmessage3
$3 thread starting
end
starting:
$3 runto $start
$3 turnto $player
$3 lookat $player
$3 waittill movedone
wait 0.2
$3 exec global/stand.scr
$3 say dfr_m5l1_add01 //come with me sir, the rest of the tank crew is holed up back here
$3 waittill saydone
$3 turnto NULL
$3 lookat NULL
$3 runto $runhere
thread objective1
end
objective1:
$obj1 waittill trigger
waitthread global/objectives.scr::add_objectives 1 3 "Locate the rest of your squad." $one.origin
wait 2
iprintlnbold_noloc "Your medic needs some health supplies before your squad can follow you."
iprintlnbold_noloc "Find him some health supplies."
waitthread global/objectives.scr::add_objectives 2 2 "Find some supplies for your medic." $obj1.origin
end
deathmessage1:
self waittill death
iprintlnbold "Sergeant Hammon has been killed in action."
end
deathmessage2:
self waittill death
iprintlnbold "T/2 Engineer Campbell has been killed in action."
end
deathmessage3:
self waittill death
iprintlnbold "T/4 Medic Glenn has been killed in action."
end
objective2:
$health remove
waitthread global/objectives.scr::add_objectives 2 3 "Find some supplies for your medic." $obj1.origin
wait 2
iprintlnbold_noloc "Now bring back the supplies to your medic."
$medic_trigger show
waitthread global/objectives.scr::add_objectives 3 2 "Bring back the supplies to your medic." $obj2.origin
thread obj3
end
obj3:
$medic_trigger waittill trigger
waitthread global/objectives.scr::add_objectives 3 3 "Bring back the supplies to your medic." $obj2.origin
thread friendlies
end
friendlies:
//making friendlies friendly
if (isAlive $3)
{
$3 thread global/friendly.scr::friendlythink
$3.friendtype = 5
$3.distance = 128
$3.destination = $player
}
if (isalive $1)
{
$1 thread global/friendly.scr::friendlythink
$1.friendtype = 1
$1.distance = 128
$1.destination = $player
}
if (isalive $2)
{
$2 thread global/friendly.scr::friendlythink
$2.friendtype = 1
$2.distance = 128
$2.destination = $player
}
thread obj4
end
obj4:
$save1 show
$tank_trigger show
$tank show
waitthread global/objectives.scr::add_objectives 4 2 "Find the explosives." $obj4.origin
thread tank_start
end
tank_start:
$tank_trigger waittill trigger
$tank.collisionent = $tank.target
$tank waitthread global/vehicles_thinkers.scr::enemy_tank_think 0 panzer
level.playertanktarget = $player
local.Path = $t1
local.TankSpeed = 4
local.Acceleration = 30
$tank drive local.Path local.TankSpeed local.Acceleration
$tank waittill drive
$tank stop
end
objective4:
$explosives remove
waitthread global/items.scr::add_item "explosives"
waitthread global/objectives.scr::add_objectives 4 3 "Find the explosives." $obj4.origin
wait 2
waitthread global/objectives.scr::add_objectives 5 2 "Use the explosives to destroy the fence." $obj5.origin
$bomb show
end
objective5:
$bomb model "animate/explosive.tik"
$bomb playsound explosive
$player loopsound bombtick
$player stopwatch 10
wait 10
$player stoploopsound bombtick
$bomb playsound explode_tank
$bomb remove
exec global/exploder.scr::explode 1
radiusdamage $hurtobject 256 384
waitthread global/objectives.scr::add_objectives 5 3 "Use the explosives to destroy the fence." $obj5.origin
end
ai_guys_atwork:
$crateguy1 waitthread global/movecrate.scr::movecrate crate1_start crate1_end
$crateguy1 waitthread global/movecrate.scr::movecrate crate2_start crate2_end
$crateguy1 waitthread global/movecrate.scr::movecrate crate3_start crate3_end
$crateguy1 waitthread global/movecrate.scr::movecrate crate4_start crate4_end
$crateguy2 waitthread global/movecrate.scr::movecrate crate5_start crate5_end
$crateguy2 waitthread global/movecrate.scr::movecrate crate6_start crate6_end
$crateguy2 waitthread global/movecrate.scr::movecrate crate7_start crate7_end
$crateguy2 waitthread global/movecrate.scr::movecrate crate8_start crate8_end
$crateguy3 waitthread global/movecrate.scr::movecrate crate9_start crate9_end
$crateguy3 waitthread global/movecrate.scr::movecrate crate10_start crate10_end
$crateguy3 waitthread global/movecrate.scr::movecrate crate11_start crate11_end
end