Page 2 of 3

Posted: Sat Jul 12, 2003 4:43 pm
by Alcoholic
i know im gonna do something "special" with my mp map hehehehehehe. :twisted:


and jv_map:

is that one .tik for all axis players? or do i have to rewrite all the axis .tiks????

Posted: Sat Jul 12, 2003 4:55 pm
by jv_map
You have to rewrite all :(

Posted: Sat Jul 12, 2003 4:58 pm
by Alcoholic
so how exactly do i do this? what do i change? i looked in ur .tik, cant tell :(

Posted: Sat Jul 12, 2003 5:09 pm
by Alcoholic
hmmm i looked in include.txt cant i just do this at the start of each round?

level waittill roundstart

Code: Select all

for (local.i = 1; local.i <= $player.size; local.i++)
{
    if ($player[local.i].dmteam == "allies")
    {
        $player[local.i] american
    }
    else if ($player[local.i].dmteam == "axis")
    {
        $player[local.i] german
    }
wouldnt that work?

Posted: Sat Jul 12, 2003 6:02 pm
by jv_map
No this won't work for players who join later :(

Posted: Sat Jul 12, 2003 6:32 pm
by Alcoholic
so how do i go about changing their race in a dm respawning map?

Posted: Sat Jul 12, 2003 9:19 pm
by Alcoholic
what about a dynamic one?

would this lag the server any?


Code: Select all

level waittill roundstart

level.players = $player.size
while (1)
{
    while (level.players == $player.size)
    {
        wait 0.1
    }
    thread teams
    level.players = $player.size
    end
}
end

teams:

for (local.i = 1; local.i <= level.players; local.i++)
{
    if ($player[local.i].dmteam == "allies")
    {
        $player[local.i] american
    }
    else if ($player[local.i].dmteam == "axis")
    {
        $player[local.i] german
    }
}
end

that should work shouldnt it? but would it make lots of lag?

Posted: Sat Jul 12, 2003 9:32 pm
by Alcoholic
oh yeah the first while loop should have a wait 0.1

Posted: Sun Jul 13, 2003 12:26 am
by nuggets
why use 2 while loops? the both dependant on each other to act

level waittill roundstart

level.players = $player.size
while (1)
{
thread teams $player.size
wait 0.1
}
end

teams level.players:
for (local.i = 1; local.i <= level.players; local.i++)
{
if ($player[local.i].dmteam == "allies")
{
$player[local.i] american
}
if ($player[local.i].dmteam == "axis")
{
$player[local.i] german
}
}
end

/*i'm not sure if this would work or not, but seems like the answer you may be looking for :D */

Posted: Sun Jul 13, 2003 2:38 am
by Alcoholic
the outer loop is just so that it never stops. the inner loop is just there to hold off executing the rest until its ready.

if you have this:

Code: Select all

while (1)
{
    wait 1
}

println "HAHAHAHA"
the message "HAHAHAHAHA" will never be printed on your console. while loops halt the progress of the script, and the inner while loop is a sort of "waittill" function i made.

Posted: Sun Jul 13, 2003 6:33 am
by jv_map
Either way, though it's starting to look ok ;), there's still a major issue left. I'm afraid a player won't remember his 'american' or 'german' setting when he (re)spawns :?.

Posted: Sun Jul 13, 2003 6:39 am
by Alcoholic
what about this...

use the code from my 2:19 p.m. post:

then add this after $player[local.i] german

Code: Select all

$player[local.i].race = german
and after $player[local.i]american

Code: Select all

$player[local.i].race = american
then add these independant lines:

Code: Select all

$player thread myrace

myrace:

while (1)
{
    wait 0.1
    if (self.race == german)
    {
        self german
    }
    else if (self.race == american)
    {
        self american
    }
}
end
    

Posted: Sun Jul 13, 2003 6:51 am
by jv_map
That actually might work :) but you have a problem when a player switches teams.

Why not do this?

Code: Select all

while(1)
{
  for(local.i = 1; local.i <= $player.size; local.i++)
  {
    local.player = $player[local.i]
    if(local.player.dmteam == allies)
      local.player american
    else 
      local.player german
  }
  waitframe
}
This does bring up the next issue though :(. AI will attack spectators. :?

Posted: Sun Jul 13, 2003 7:00 am
by Alcoholic
why dont you put else if local.player.dmteam == "axis" ?? eh? eh?

Posted: Sun Jul 13, 2003 7:10 am
by jv_map
I guessed they were not Russian :roll: so that saves one if :)