Page 1 of 1

Simple but complicated Q

Posted: Wed Jun 19, 2002 1:22 am
by kdja
Hi 1st post
I cant get one part of the scripts and i know when i do it will all make sense.
here it is and i dont even think this post makes sense.

What seperates each area of a script ?
not sure if this sounds right .

For instance taking the OBJ script from Omaha and placing your gun in map everything is fine.
then adding a plane on a bombing run and random explosions.
I am starting to understand the scripts but how are laid out is my problem.
what is the formula thats tells mohaa to load them, read them etc:
difficult to explain without copying my own script(in work cant)
umm hard to explain so i`ll try anyway
Scoreboard ends here
"setcvar "g_scoreboardpic" "none""
then obj follows easy enough makes sense,ends with this
"teamwin allies
end"
what is the layout formula to add another line of script
I think im thinking there must be like a rule that it must be 2 blank lines and special // before each line or somfin similiar,
I hope this makes sense in some way as its got me well stuck
i can only seem to make one of the 3 FX work never all 3 of them together and always the top one ,so i assume i am laying it out wrong.
i am possibly being to logical in my line of thinking.
thx for even reading this far and for any help .
Much Appreciated.
kdja

Posted: Wed Jun 19, 2002 8:42 am
by Gener_AL
hello there.!

saw your post in pmoh forums ..{waited for your .scr ... :cry: }

anyhow ...here`s how i`ve been doing multiple objectives .....not a multiple objective {this is a bit more complex....made my noodle curdle}

/////example script by Gener_AL
//*slaps surgeon*
//*assumes defensive posture*
///////////////////////////////////////

// ALANS MAP
// ARCHITECTURE: Alan Stables
// SCRIPTING: Alan Stables



main:
exec global/ai.scr
exec global/loadout.scr maps/yourmap.scr


level waittill prespawn

setcvar cg_playermodel 0
fadeout 0.1 0 0 0 1
huddraw_alpha 100 0
exec global/ambient.scr yourmap


level waittill spawn
$player item weapons/colt45.tik
$player ammo pistol 50
fadein 2 0 0 0 1
wait 2
level.script = "maps/test_xxx.scr"
thread objectives
$player stufftext "tmstartloop sound/music/mus_17d_mystery.mp3"
level.fogplane = 8000
$world farplane level.fogplane
level.fogred = .2
level.foggreen = .2
level.fogblue = .3
$world farplane_color (level.fogred + " " + level.foggreen + " " + level.fogblue)
end

/////////////////
objectives:
waitthread global/objectives.scr::add_objectives 1 2 "Find your platoon leader..Gener_AL" $obj1.origin
waitthread global/objectives.scr::add_objectives 2 2 "infiltrate the Nazi Radio Base." $obj2.origin
waitthread global/objectives.scr::add_objectives 3 2 "Find radio and send message to Lt Powell at bunker gates" $obj3.origin
waitthread global/objectives.scr::add_objectives 4 2 "Gain entry and find Lt Powell" $obj4.origin
waitthread global/objectives.scr::add_objectives 5 2 "Kill all troops in bunker complex" $obj5.origin
set_objective_pos $obj1
end
/////////////////
music1:
//inside outer perimeter
//called by BSP
$player stufftext "tmstop"
$player stufftext "tmstart sound/music/mus_06a_mystery.mp3"
end

/////////////////
music2:
//inside main building
//called by BSP
$player stufftext "tmstop"
$player stufftext "tmstartloop sound/music/mus_16a_mystery.mp3"
end

//////////////////
objective1:
set_objective_pos $obj2
waitthread global/objectives.scr::add_objectives 1 5
waitthread global/objectives.scr::current_objectives 2
end
//////////////////
objective2:
set_objective_pos $obj3
waitthread global/objectives.scr::add_objectives 2 5
waitthread global/objectives.scr::current_objectives 3
end
/////////////////////////
objective3:
centerprint "The bunker gates are now open private! Lets GO!"
$player playsound dfr_M2L1_204m
wait 2.5
waitthread global/objectives.scr::add_objectives 3 5
waitthread global/objectives.scr::current_objectives 4
set_objective_pos $obj4
thread spawner
end
////////////////
objective4:
waitthread global/objectives.scr::add_objectives 4 5
waitthread global/objectives.scr::current_objectives 5
set_objective_pos $obj5

end
/////////////////
objective5:
if (IsAlive $enemy)
$enemy waittill death
iprintlnbold "Well done you have completed you mission !."
wait 3
iprintlnbold "try it again .. only this time on hard level !."
wait 3
waitthread global/objectives.scr::add_objectives 5 5
waitthread global/objectives.scr::current_objectives 0
goto levelend
end
///////////////////
////////////////////


levelend:
$endlevel waittill trigger
waitthread global/objectives.scr::current_objectives 0
exec global/missioncomplete.scr nextmap.bsp 1
end

/////////////////////////////////////////////



phew .....there`s alot of thing`s in there that really dont need to be in ..hope you find them useful..

Posted: Wed Jun 19, 2002 4:25 pm
by kdja
Ok yours is for SP is a lot mmore complicated than mine...LOL

here is mine (at home now can post it)
main:
level waittill prespawn

exec global/DMprecache.scr

level.script = maps/obj/dieppe.scr
exec global/ambient.scr m4l1

exec global/door_locked.scr::lock

setcvar "g_obj_alliedtext1" "Capture the gun"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "- Prevent Allies from"
setcvar "g_obj_axistext2" "destroying the Flak88's"
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "dieppe"

level waittill spawn

level.bomb_damage = 200
level.bomb_explosion_radius = 640
level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 3 < set to 3 i have 3
level.dmrespawning = 1 // 1 or 0
level.dmroundlimit = 15 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw

level waittill roundstart

$flak88_explosive1 thread global/obj_dm.scr::bomb_thinker


$flak88_explosive1 thread axis_win_timer
thread allies_win_bomb


end

//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

axis_win_timer:

level waittill axiswin

end

//*** --------------------------------------------
//*** "Allied Victory"
//*** --------------------------------------------

allies_win_bomb:

while(level.targets_destroyed < level.targets_to_destroy)
waitframe

teamwin allies
end ALL ABOVE THIS WORKS ,nothing below works

exec global/exploder.scr

level waitTill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr

level.script = maps/obj/dieppe.scr
exec global/ambient.scr dieppe

//$world farplane 5000
//$world farplane_color (.333 .333 .329)

level waittill spawn
thread random_explode1

end

random_explode1:


wait (randomfloat 13 + 23)


$random_explode anim start
radiusdamage $random_explode 256 384
goto random_explode1
end

exec global/exploder.scr
exec global/bomber.scr
exec global/ambient.scr m4l0

level.script = maps/dieppe.scr
level.flyplane = 1

end

kablam:
thread global/exploder.scr::explode 5
end

Nothing below "allies win " if i delete that whole line which ever goes to the top works.
thx
kdja

Posted: Wed Jun 19, 2002 5:37 pm
by Wombat
Try this

main:
exec global/exploder.scr

This should be at the beginning so, it can set everything up for the exploders, b4 prespawn (spectator?), and there were too many
level waittill prespawn, and spawn, you should put all the commands that run in that group in the main group.....


setcvar "g_obj_alliedtext1" "Capture the gun"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "- Prevent Allies from"
setcvar "g_obj_axistext2" "destroying the Flak88's"
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "dieppe"


level waittill prespawn

exec global/DMprecache.scr

level.script = maps/obj/dieppe.scr
exec global/ambient.scr m4l1

exec global/door_locked.scr::lock
exec global/bomber.scr

This may go here or it may go in spawn, i don't know?

level waittill spawn

level.bomb_damage = 200
level.bomb_explosion_radius = 640
level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 3 // set to 3 i have 3

You say you have three but only setup one bomb thinker ?????? or are the others exploders (again only one)

level.dmrespawning = 1 // 1 or 0
level.dmroundlimit = 15 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw
level.flyplane = 1

thread random_explode1

level waittill roundstart

$flak88_explosive1 thread global/obj_dm.scr::bomb_thinker


$flak88_explosive1 thread axis_win_timer
thread allies_win_bomb


end

//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

axis_win_timer:

level waittill axiswin

end

//*** --------------------------------------------
//*** "Allied Victory"
//*** --------------------------------------------

allies_win_bomb:

while(level.targets_destroyed < level.targets_to_destroy)
waitframe

teamwin allies
end



random_explode1:


wait (randomfloat 13 + 23)


$random_explode anim start
radiusdamage $random_explode.origin 256 384
goto random_explode1
end

The radiusdamage command requires the origin

kablam:
thread global/exploder.scr::explode 5
end
**********************

This seemed to contradict a previous setting
level.script = maps/dieppe.scr
so i removed it

Cheers

Posted: Wed Jun 19, 2002 6:53 pm
by kdja
thx
that makes sense
i was thinkin of them as a load and the game read each one then moved to the next.
but by your editing it loads them at ceratin points.
thx makes sense now
kdja

Posted: Thu Jun 20, 2002 11:22 pm
by kdja
The above didnt work but this did on OBJ ,still cant get plane and random going to redo them but all 3 OBJ worked with this.
main:

setcvar "g_obj_alliedtext1" "Capture the gun"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""

setcvar "g_obj_axistext1" "- Prevent Allies from"
setcvar "g_obj_axistext2" "destroying the Flak88's"
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "dieppe"

level.debug = 1

level waittill prespawn

thread debugtext "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
thread debugtext " PRESPAWN ! "
thread debugtext "***********************************************************"

exec global/DMprecache.scr

level.script = maps/obj/dieppe.scr
exec global/ambient.scr m4l1

exec global/door_locked.scr::lock

level waittill spawn

thread debugtext "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
thread debugtext " SPAWN ! "
thread debugtext "***********************************************************"

level.bomb_damage = 200
level.bomb_explosion_radius = 640
level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 3
level.dmrespawning = 1 // 1 or 0
level.dmroundlimit = 15 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw

$flak88_explosive1 thread global/obj_dm.scr::bomb_thinker
$flak88_explosive2 thread global/obj_dm.scr::bomb_thinker
$flak88_explosive3 thread global/obj_dm.scr::bomb_thinker

$flak88_explosive1 thread axis_win_timer


// $v2_explode thread global/obj_dm.scr::bomb_thinker
// $ctrlroom_explode thread global/obj_dm.scr::bomb_thinker

// thread allies_win_bomb $v2_explode $ctrlroom_explode
// $v2_explode thread axis_win_timer

level waittill roundstart

thread debugtext "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
thread debugtext " ROUNDSTART ! "
thread debugtext "***********************************************************"

thread allies_win_bomb
thread axis_win_timer

end

//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

axis_win_timer:
thread debugtext "THREAD axis_win_timer"

level waittill axiswin

thread debugtext "ENDTHREAD axis_win_timer"
end

//*** --------------------------------------------
//*** "Allied Victory"
//*** --------------------------------------------

allies_win_bomb:
thread debugtext "THREAD allies_win_bomb"

while(level.targets_destroyed < level.targets_to_destroy)
waitframe

teamwin allies

thread debugtext "ENDTHREAD allies_win_bomb"
end

exec global/exploder.scr

level waitTill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr

level.script = maps/obj/dieppe.scr
exec global/ambient.scr dieppe

//$world farplane 5000
//$world farplane_color (.333 .333 .329)

level waittill spawn
thread random_explode1

end

random_explode1:

wait (randomfloat 13 + 23)

$random_explode anim start
radiusdamage $random_explode 256 384
goto random_explode1
end

exec global/exploder.scr
exec global/bomber.scr
exec global/ambient.scr m4l0

level.script = maps/dieppe.scr
level.flyplane = 1

end

kablam:
thread global/exploder.scr::explode 5
end


debugtext local.text:

if (level.debug == 1)
println ("DEBUG Main: " + local.text)
end


That all worked but stil no plane and random.
thx for the help.
when i figure it out will mail you a tutorial for dumb ppl like me :)
Kdja