How to use an entire dm team?

Post your scripting questions / solutions here

Moderator: Moderators

TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

hmm, i don't think that is the only problem :?

I found a few typos, and i think i corrected an error in ive_gone. However, the obj still doesn't work. The script semi-works because the scroboard messages load, but the rest of the scripting does nothing.

Here's what I'm working with:

// Title: Kuwaiti City-King of the Hill Version
// Architecture: TheShiznaeSpe
// Scripting: TheShiznaeSpe, tltrude, and KOTH by nuggets!!!!

main:

level.allies_counters = 0 //sets the count of number of allies trying to activate the counter
level.axis_counters = 0 //sets the count of the number of axis trying to activate the counter

$iraq_indicator show
$us_indicator show

setcvar "g_obj_alliedtext1" "-Hold the"
setcvar "g_obj_alliedtext2" "target"
setcvar "g_obj_alliedtext3" "building"
setcvar "g_obj_axistext1" "-Hold the"
setcvar "g_obj_axistext2" "target"
setcvar "g_obj_axistext3" "building"
setcvar "g_scoreboardpic" "none"

level waittill prespawn
//exec global/DMprecache.scr
level.script = maps/obj/OBJ_Kuwaiti_City_koth.scr

level waittill spawn

level.dmrespawning = 1
level.dmroundlimit = 20
level.clockside = draw

iprintln "Target building EMPTY."

//level waittill roundstart

end

im_here:
local.player = parm.other
if (local.player.dmteam == "allies") //if triggerer = allies and
{
if ( local.player.were_counting == 1 ) //he hasn't already started coutning
{
local.player.were_counting = 0 //tells him he's now counting
local.player.counter = 0 //gives him a starting count
local.player thread count_me_in_im_an_ally //goes to the counting thread
locprint 30 100 "US has entered and is holding the target buidling."
$iraq_indicator hide
$us_indicator show
level.allied_counters++
}
} //let's the game know there's an ally counting

if (local.player.dmteam == "axis") //all the same but for axis
{
if ( local.player.were_counting == 0 )
{
local.player.were_counting = 1
local.player.counter = 0
local.player thread count_me_in_im_an_axis
locprint 30 100 "IRAQ has entered and is holding the target buidling."
$iraq_indicator show
$us_indicator hide
level.axis_counters++
}
}
end

ive_gone:
if(local.player.were_counting == 1) //this stuff added to correct script error-it seems to work
{

local.player.were_counting = 0
end
}
else
{
}
end


count_me_in_im_an_ally:
if ( level.axis_counters == 0 ) //if any axis are counting, he can't count
{
if ( self istouching $target_building_trigger ) //if he's touching the trigger keep counting
{
if ( self.counter < 30 ) //if he hasn't reached the time limit keep counting
{
self.counter++ //add 1 to the counter
wait 1 //wait's a second
self thread count_me_in_im_an_ally //restarts the thread
end
}
else //if time limit has been reached
{
teamwin allies //allies win
locprint 30 100 "U.S. WINS!!!"
//local.player addkills 1
local.player stufftext "I was the KING!"
wait 1
end
}
local.player.were_counting = 0 //if not touching anymore, tell him he's not counting
level.allies_counters--
} //minus 1 from the total number of allies counting
}
end

count_me_in_im_an_axis:
if ( level.allies_counters == 0 )
{
if ( self istouching $target_building_trigger )
{
if ( self.counter < 30 )
{
self.counter++
wait 1
self thread count_me_in_im_an_axis
end
}
else
{
teamwin axis
locprint 30 100 "IRAQ WINS!!!"
//local.player addkills 1
local.player stufftext "I was the KING!"
wait 1
end
}
local.player.were_counting = 0
level.axis_counters--
}
}
end
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

nah, once they've touched the new triggers, it'll reset their counter
hope this helps, prob not cos it's all foreign 2 me :-/
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

ok, it don't matter tho

script doesn't work anywho :(
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

WAHOOO glad it's working :D

can't believe i forgot the most basic of lines :P

as for the next question:

//*******************\\
// onscreen messages \\
//*******************\\

hudprint local.string local.r local.g local.b local.w:
println local.string
level.hudprint = local

local.distance = local.string.size / -2
huddraw_rect 187 (local.distance * 10) 200 0 0
huddraw_color 187 local.r local.g local.b

huddraw_font 187 "facfont-20"
huddraw_string 187 local.string
huddraw_align 187 center top
// huddraw_align 187 center left //works
local.fader = 1
huddraw_alpha 187 local.fader

wait local.w
while (local.fader > 0)
{
local.fader = (local.fader - 0.02)
huddraw_alpha 187 local.fader
wait 0.02
}
end

/*nuggets_examples:
// thread hudprint "text" red green blue wait
thread hudprint "1 ready" 1 0 0 2 //red
thread hudprint "2 ready" 0 1 0 2 //green
thread hudprint "3 ready" 0 0 1 2 //blue
thread hudprint "4 ready" 0 1 1 2 //cyan
thread hudprint "5 ready" 1 0 1 2 //purple
thread hudprint "6 ready" 1 1 0 2 //yellow
thread hudprint "7 ready" 0 0 0 2 //black
thread hudprint "8 ready" 1 1 1 2 //white
end*/

//needs work!
hope this helps, prob not cos it's all foreign 2 me :-/
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

hey, any luck with stopping the script from screwing up when a player switches teams?

here's what i wrote, not sure it works, tho:

allies_stop_switch:

while (local.player.dmteam == "allies")
{
if(local.player.dmteam == "axis")
{
local.player.were_counting = 0
level.allies_counters--
}
break
}
end

axis_stop_switch:

while (local.player.dmteam == "axis")
{
if(local.player.dmteam == "allies")
{
local.player.were_counting = 0
level.allies_counters--
}
break
}
end
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

ok add to the beginning of
count_me_in_im_an_ally
if ( local.player.dmteam == "axis" )
{kill local.player
level.allies_counters--
end}

then that'd stop them from changing teams by killing them for trying to cheat :lol:

and same for axis thread
hope this helps, prob not cos it's all foreign 2 me :-/
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

i'm gonna use a combo of both, thanks man
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

right then, been hard at work for 1hour solid and got you a MP KOTH global script

i admit i did need one aswell, but it's coming to you before i'm using mine, that's cos of the kind of guy i am :D, though it hasn't been play-tested yet, i think i've spelt everything right, and taken every possible outcome into consideration

right 1stly if you just want to put it into your .scr then u'll need to change a couple of things

but if your using it as a global.scr then you won't but u'll need to add a few lines to ur .scr

here's the script, i've changed it so it'll go straight into your .scr instead

//*********************\\
// king of the hill MP \\
// version 1.0 NUGGETS \\
//*********************\\

main:

level.hold_time = 30
leve.prevent_time = 3

level.allies_clock = 0
level.axis_clock = 0
level.allied_counters = 0
level.axis_counters = 0

setcvar "g_obj_alliedtext1" "-Hold the"
setcvar "g_obj_alliedtext2" "target"
setcvar "g_obj_alliedtext3" "building"
setcvar "g_obj_axistext1" "-Hold the"
setcvar "g_obj_axistext2" "target"
setcvar "g_obj_axistext3" "building"
setcvar "g_scoreboardpic" "none"

level waittill prespawn
// exec global/DMprecache.scr

level waittill spawn
level.dmrespawning = 1
level.dmroundlimit = 6
level.clockside = draw
thread the_clocks

//level waittill roundstart
end

im_here:
local.player = parm.other
if (local.player.dmteam == "allies")
{if (local.player.were_counting == 0 )
{level.allied_counters++
local.player.were_counting = 1
local.player thread ally_here_to_help}}

if (local.player.dmteam == "axis")
{if ( local.player.were_counting == 0 )
{levle.axis_counters++
local.player.were_counting = 1
local.player thread axis_here_to_help}}
end

ive_gone:
local.player = parm.other
if (local.player.counter == 1)
{if (local.player.dmteam == "allies")
{level.allied_counters--}
if (local.player.dmteam == "axis")
{level.axis_counters--}}
local.player.were_counting = 0
end

ally_here_to_help:
self waittill death
local.player stufftext "Get your ass back in there"
level.allied_counters--
end

axis_here_to_help:
self waittill death
local.player stufftext "Get your ass back in there"
level.axis_counters--
end

the_clocks:
while (1)
{if ((level.allied_counters == 0) && (level.axis_counters == 0))
{level.allied_clock = 0
level.axis_clock = 0
level.team_in = "no-one"}
if ((level.allied_counters > 0) && (level.axis_counters == 0))
{level.axis_clock = 0
wait 1
level.allied_clock++
thread is_it_over
level.team_in = "allies"}
if ((level.allied_counters == 0) && (level.axis_counters > 0))
{level.allied_clock = 0
wait 1
level.axis_clock++
thread is_it_over
level.team_in = "axis"}
if ((level.allied_counters > 0) && (level.axis_counters > 0))
{if (level.team_in == "no-one")
{level.double_entry = (randomint (2) + 1)
if (level.double_entry == 1)
{level.team_in = "allies"}
if (level.double_entry == 2)
{level.team_in == "axis"}
level.allied_clock++
level.axis_clock++
thread is_it_over)}}
end

is_it_over:
if ((level.allied_clock >= level.hold_time) && (level.axis_clock < level.prevent_time))
{wait 1
teamwin allies}
if ((level.axis_clock >= level.hold_time) && (level.allied_clock < level.prevent_time))
{wait 1
teamwin axis)
if (((level.allied_clock >= level.prevent_time) && (level.team_in == "axis")) || ((level.axis_clock >= level.prevent_time) && (level.team_in == "allies")))
{level.allied_clock == 0
level.axis_clock == 0}
end


/*give me a shout if any problem
anything at all*/
hope this helps, prob not cos it's all foreign 2 me :-/
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

thanks a bunch man, i'm debugging now :D
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

still no luck, here's what i'm working with:

// Title: Kuwaiti City-King of the Hill Version
// Architecture: TheShiznaeSpe
// Basic Scripting: TheShiznaeSpe
// KOTH V 1.0 by NUGGETS and DEBUGGED by TheShiznaeSpe

main:

level.hold_time = 30
level.prevent_time = 3

level.allied_clock = 0
level.axis_clock = 0
level.allied_counters = 0
level.axis_counters = 0

setcvar "g_obj_alliedtext1" "-Hold the"
setcvar "g_obj_alliedtext2" "target"
setcvar "g_obj_alliedtext3" "building"
setcvar "g_obj_axistext1" "-Hold the"
setcvar "g_obj_axistext2" "target"
setcvar "g_obj_axistext3" "building"
setcvar "g_scoreboardpic" "none"

level waittill prespawn
// exec global/DMprecache.scr

level waittill spawn
level.dmrespawning = 1
level.dmroundlimit = 6
level.clockside = draw
thread the_clocks

//level waittill roundstart

locprint 30 100 "Target building EMPTY."
end

im_here:
local.player = parm.other
if (local.player.dmteam == "allies")
{if (local.player.were_counting == 0 )
{level.allied_counters++
local.player.were_counting = 1
locprint 30 100 "US has entered and is holding the target buildng."
$iraq_indicator hide
$us_indicator show
$iraq_indicator notsolid
$us_indicator solid
local.player thread ally_here_to_help}}

if (local.player.dmteam == "axis")
{if ( local.player.were_counting == 0 )
{level.axis_counters++
local.player.were_counting = 1
locprint 30 100 "IRAQ has entered and is holding the target building."
$iraq_indicator show
$us_indicator hide
$iraq_indicator solid
$us_indicator notsolid
local.player thread axis_here_to_help}}
end

ive_gone:
local.player = parm.other
if (local.player.were_counting == 1)
{if (local.player.dmteam == "allies")
{level.allied_counters--
locprint 30 100 "Target building EMPTY."
$iraq_indicator show
$us_indicator show
$iraq_indicator solid
$us_indicator solid}
if (local.player.dmteam == "axis")
{level.axis_counters--
locprint 30 100 "Target building EMPTY."
$iraq_indicator show
$us_indicator show
$iraq_indicator solid
$us_indicator solid}}
local.player.were_counting = 0
end

ally_here_to_help:
{
while (1)
if !(isAlive local.player)
{
//local.player stufftext "Get your ass back in there!"
level.allied_counters--
break
wait 0.1
}
}
end

axis_here_to_help:
while (1)
{
if !(isAlive local.player)
{
//local.player stufftext "Get your ass back in there!"
level.axis_counters--
break
wait 0.1
}
}
end

the_clocks:
while (1)
{if ((level.allied_counters == 0) && (level.axis_counters == 0))
{level.allied_clock = 0
level.axis_clock = 0
level.team_in = "no-one"}
if ((level.allied_counters > 0) && (level.axis_counters == 0))
{level.axis_clock = 0
wait 1
level.allied_clock++
thread is_it_over
level.team_in = "allies"}
if ((level.allied_counters == 0) && (level.axis_counters > 0))
{level.allied_clock = 0
wait 1
level.axis_clock++
thread is_it_over
level.team_in = "axis"}
if ((level.allied_counters > 0) && (level.axis_counters > 0))
{if (level.team_in == "no-one")
{level.double_entry = (randomint (2) + 1)
if (level.double_entry == 1)
{level.team_in = "allies"}
if (level.double_entry == 2)
{level.team_in = "axis"}
level.allied_clock++
level.axis_clock++
thread is_it_over}}wait 1}
end

is_it_over:
if ((level.allied_clock >= level.hold_time) && (level.axis_clock < level.prevent_time))
{wait 1
locprint 30 100 "US WINS!!!"
//local.player addkills 1 // SPEARHEAD ONLY
local.player stufftext "I was the KING!"
wait 1
teamwin allies}
if ((level.axis_clock >= level.hold_time) && (level.allied_clock < level.prevent_time))
{wait 1
locprint 30 100 "IRAQ WINS!!!"
//local.player addkills 1 // SPEARHEAD ONLY
local.player stufftext "I was the KING!"
wait 1
teamwin axis}
if (((level.allied_clock >= level.prevent_time) && (level.team_in == "axis")) || ((level.axis_clock >= level.prevent_time) && (level.team_in == "allies")))
{level.allied_clock = 0
level.axis_clock = 0}
end
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

anything?

anyone?

:(
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

i've got it working!!!
i've got it working!!!

with full, (as far as i know) debugged, mucho greato, every possible event taken into consideration, job done, how's ur father, i'm brill, scripting :P

right then, i'm posting the global one i've made so it's up to you to change the few things

level.hold_time = **
level.prevent_time = **

so here it is, give me credit for this one :D

//*********************\\
// king of the hill MP \\
// version 1.0 NUGGETS \\
//*********************\\

main level.hold_time level.prevent_time:
level.allied_clock = 0
level.axis_clock = 0
level.allied_counters = 0
level.axis_counters = 0

level waittill spawn
thread the_clocks

//level waittill roundstart

//while (1)
// {iprintlnbold_noloc "allies " level.allied_counters " axis " level.axis_counters
// wait 1}
end

im_here:
local.player = parm.other
if (local.player.dmteam == "allies")
{if (local.player.were_counting == 0 )
{iprintlnbold_noloc "ally started to count"
level.allied_counters++
local.player.were_counting = 1
local.player thread ally_here_to_help
local.player.prev_team = "allies"
local.player thread team_swap_check}}

if (local.player.dmteam == "axis")
{if ( local.player.were_counting == 0 )
{level.axis_counters++
local.player.were_counting = 1
local.player.prev_team = "axis"
local.player thread team_swap_check}}
end

ive_gone:
local.player = parm.other
if (local.player.were_counting == 1)
{if (local.player.dmteam == "allies")
{level.allied_counters--}
if (local.player.dmteam == "axis")
{level.axis_counters--}}
local.player.were_counting = 0
local.player.i_died = 0
end

ally_here_to_help:
while (self.were_counting == 1)
{if !(isAlive self)
{if (self.i_died == 0)
{level.allied_counters--
self.i_died = 1
self.were_counting = 0
self stufftext "Get your ass back in there!"}}
wait 1}
end

axis_here_to_help:
while (self.were_counting == 1)
{if !(isAlive self)
{if (self.i_died == 0)
{level.axis_counters--
self.i_died = 1
self.were_counting = 0
self stufftext "Get your ass back in there!"}}
wait 1}
end

the_clocks:
while (1)
{if ((level.allied_counters == 0) && (level.axis_counters == 0))
{level.allied_clock = 0
level.axis_clock = 0
level.team_in = "no-one"
wait 1}
if ((level.allied_counters > 0) && (level.axis_counters == 0))
{level.team_in = "allies"
thread is_it_over
level.axis_clock = 0
thread nwtr_nuggets/nwtr_hudprints.scr::hudprint "Allies will take control in" 1 0 0 1 "flash" 1
wait .7
thread nwtr_nuggets/nwtr_hudprints.scr::hudprint (level.hold_time - level.allied_clock) 1 0 0 2 "flash" 1
level.allied_clock++
wait .3}
if ((level.allied_counters == 0) && (level.axis_counters > 0))
{level.team_in = "axis"
thread is_it_over
level.allied_clock = 0
thread nwtr_nuggets/nwtr_hudprints.scr::hudprint "Axis will take control in" 1 0 0 1 "flash" 0
wait .7
thread nwtr_nuggets/nwtr_hudprints.scr::hudprint_left level.axis_clock 1 0 0 2 "flash" 0
level.axis_clock++
wait .3}
if ((level.allied_counters > 0) && (level.axis_counters > 0))
{if (level.team_in == "no-one")
{level.double_entry = (randomint (2) + 1)
if (level.double_entry == 1)
{level.team_in = "allies"}
if (level.double_entry == 2)
{level.team_in = "axis"}}
thread is_it_over
level.allied_clock++
level.axis_clock++
thread nwtr_nuggets/nwtr_hudprints.scr::hudprint level.axis_clock 1 0 0 .75 "flash" 1
wait 1}}
end

is_it_over:
if ((level.allied_clock >= level.hold_time) && (level.axis_clock < level.prevent_time))
{teamwin allies}
if ((level.axis_clock >= level.hold_time) && (level.allied_clock < level.prevent_time))
{teamwin axis}
if (((level.allied_clock >= level.prevent_time) && (level.team_in == "axis")) || ((level.axis_clock >= level.prevent_time) && (level.team_in == "allies")))
{level.allied_clock = 0
level.axis_clock = 0}
end

team_swap_check:
while (self.were_counting == 1)
{if ((self.dmteam == "allies") && (self.prev_team == "axis"))
{level.axis_counters--
self.were_counting = 0
self.prev_team = "allies"}
if ((self.dmteam == "axis") && (self.prev_team == "allies"))
{level.allied_counters--
self.were_counting = 0
self.prev_team = "axis"}
if ((self.dmteam == "spectator") && (self.prev_team == "allies"))
{level.allied_counters--
self.were_counting = 0
self.prev_team = "spectator"}
if ((self.dmteam == "spectator") && (self.prev_team == "axis))
{level.axis_counters--
self.were_counting = 0
self.prev_team = "spectator"}
wait 1}
end


/*oh yeah and you'll need to change hudprint as i've got that set up as another global.scr

:D wahooo*/
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

ur the king of scripting!!!!! :lol:

but i thought BoB had this gametype already? :?
Live to map, not map to live.
-mohaa_rox, .map
moderator
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

genius man, pure genius

this is great :D
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

SHIZ!!!

what ya doin to me... u want a script that already exists :P

oh well, learn something new everyday
hope this helps, prob not cos it's all foreign 2 me :-/
Post Reply