Page 2 of 4

Confused

Posted: Sat Jun 28, 2003 8:22 am
by tltrude
"nuggets" has that effect on a lot of people, ha ha. Maybe this will help:

"++" = adds one to the variable
"--" = subtracts one from the variable

To understand his script, follow the "setthread" that the trigger will run when a player enters it.

Posted: Sat Jun 28, 2003 11:47 am
by nuggets
i may confuse people but the problme gets sorted, well sometimes, no i'm lying it usually gets wrong and tltrude comes to the rescue :P , but i was in a rush to get out last night

well in summary you'd need something like this

trigger->multiple
key: targetname
value: area_trigger
key: setthread
value: im_here

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
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 = 1 //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
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 == 1 )
{ local.player.were_counting = 1
local.player.counter = 0
local.player thread count_me_in_im_an_axis
level.axis_counters++ }}
end

count_me_in_im_an_ally:
if ( level.axis_counters == 0 ) //if any axis are counting, he can't count
{ if ( self istouching $area_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
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
}

count_me_in_im_an_axis:
if ( level.allies_counters == 0 )
{ if ( self istouching $area_trigger )
{ if ( self.counter < 30 )
{ self.counter++
wait 1
self thread count_me_in_im_an_axis
end}
else
{teamwin axis
wait 1
end}
local.player.were_counting = 0
level.axis_counters--}
}

/*::amended::
:: :lol: you really are thorough :D ::*/

s

Posted: Sat Jun 28, 2003 12:32 pm
by tltrude
left out an s:

level.axis_counters = 0

Posted: Sat Jun 28, 2003 3:48 pm
by TheShiznaeSpe
OK, I give up, lol :oops:

I'm too retarded to get this script to work. The script loads, without any hitch, but the obj just doesn't work. :?

Here's what I've been working with (maybe someone can point me in the right direction):

// 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
iprintln "Target building EMPTY."


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

//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 = 1 //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
iprintln "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 == 1 )
{
local.player.were_counting = 1
local.player.counter = 0
local.player thread count_me_in_im_an_axis
iprintln "IRAQ has entered and is holding the target buidling."
$iraq_indicator show
$us_indicator hide
level.axis_counters++
}
}
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
iprintln "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
}

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
iprintln "IRAQ WINS!!!"
//local.player addkills 1
local.player stufftext "I was the KING!"
wait 1
end}
local.player.were_counting = 0
level.axis_counters--
}
}

Yes, I've tried it the way nuggets wrote it, without the line breaks. It didn't work. :(

Possible brainstorming ideas:

Should there be an "end" at the bottom of count_me_in_im_an_axis and count_me_in_im_an_ally?

Do level.allies_counters = 0 and level.axis_counters = 0 need a definition?

hmm :?

Posted: Sat Jun 28, 2003 6:16 pm
by nuggets
oops forgot the ends :oops:

you can either send me the map, and i'll have a closer look or put println's in and find where it's breaking

the level.allies_counters and level.axis_counters are just making sure that there's no-one on the other team counting

e-mail below (unless it's spearhead) then don't e-mail

Posted: Sat Jun 28, 2003 9:36 pm
by TheShiznaeSpe
ok, thanks, i'm emailing it now :D

Posted: Sun Jun 29, 2003 4:56 pm
by nuggets
got it, time to start debugging :D

Posted: Sun Jun 29, 2003 8:15 pm
by nuggets
right then, nearly there, couple of errors in my script :oops:

if you want only 1 person to of waited 30 seconds then it's kinda ok, but i'm guessing from looking at the size of the building as long as one team member is still remaining at the end of 30 seconds and no enemies in there, then they'll win, so...

create outside the 3 doors to the building trigger->multiple
key:setthread
value: ive_gone

// 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
iprintln "Target building EMPTY."

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

//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
iprintln "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
iprintln "IRAQ has entered and is holding the target buidling."
$iraq_indicator show
$us_indicator hide
level.axis_counters++
}
}
end

ive_gone
local.player.were_counting = 0
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
iprintln "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
}

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
iprintln "IRAQ WINS!!!"
//local.player addkills 1
local.player stufftext "I was the KING!"
wait 1
end}
local.player.were_counting = 0
level.axis_counters--
}
}

/*i'm gonna send this post and then give it some thought for just 1 counter, rather than every1 having there own for what i mentioned all the way back at the top :D */

Posted: Mon Jun 30, 2003 4:24 am
by TheShiznaeSpe
thanks a bunch man :D

still no "end"s tho-is that ok?

Posted: Mon Jun 30, 2003 6:51 am
by brendank310
i want to thank all of you for helping out. it is much appreciated from the aoi team. when i start making the credits, expect your name to be there. and i have surprise for ya, if i can get a hold of you on im. thebtk2001@hotmail.com and brendank310 on aim.

Posted: Mon Jun 30, 2003 8:07 am
by mohaa_rox
brendank310 wrote:i want to thank all of you for helping out. it is much appreciated from the aoi team. when i start making the credits, expect your name to be there. and i have surprise for ya, if i can get a hold of you on im. thebtk2001@hotmail.com and brendank310 on aim.
lol will my be in?? :wink:

Posted: Mon Jun 30, 2003 11:11 am
by nuggets
yeah, put the ends in :oops: :P

Posted: Mon Jun 30, 2003 4:44 pm
by TheShiznaeSpe
so:

local.player.were_counting = 0
level.axis_counters--
}
}
end

or

local.player.were_counting = 0
level.axis_counters--
end
}
}

The second one, right?

Posted: Mon Jun 30, 2003 4:45 pm
by TheShiznaeSpe
Yes rox, u better be lol

And u guys will also be credited in trench rats because i'm adapting this script for a new gametype there :D

Posted: Mon Jun 30, 2003 9:04 pm
by nuggets
i think both will work, can't really check now, i have chips :D

use the 1st one as that's a definate, but i'm 99% sure the 2nd will