Page 1 of 1

halftrack

Posted: Fri Jul 04, 2003 12:51 pm
by martijn_NL
Is it possible in a mp map that a halftrack spawns drive to a point and then fire to any allied players?

possible

Posted: Fri Jul 04, 2003 3:14 pm
by tltrude
Anything is possible, if you know how.

Posted: Fri Jul 04, 2003 9:12 pm
by Alcoholic
yeah. i dont have much experience with mp scripting, but i think this little bunch might work.

Code: Select all

level waittill roundstart

$halftrack drive $halftrackpath 128 128 128 128
$halftrack thread halftrack_think
end

halftrack_think:

self.gun1 = self queryturretslotentity 0
while (isalive self)
{
    for (local.i = 1; local.i <= $player.size; local.i++)
    //Local.i equals 1. as long as local.i is less than or equal to the number of players in game, do the loop. at the end of the loop, do it again, but add 1 to local.i
    {
        if ($halftrack cansee $player[local.i] && $player[local.i].dmteam == "allies")
        {
            self setaimtarget $player[local.i]
            self waittill ontarget
            self startfiring
        }
    }
}
end
thats just an example of a basic way to do it. not meant for you to actually use that code.

Posted: Sat Jul 05, 2003 11:48 am
by martijn_NL
i will try that

Posted: Sat Jul 05, 2003 12:41 pm
by martijn_NL
if i add a halftrack in a mp level i need to makes sounds, how do i do that.

This is the error:

ERROR: Entity::LoopSound: sdkfz_snd_run needs an alias in ubersound.scr or uberdialog.scr - Please fix.
ERROR: Entity::LoopSound: sdkfz_tread_snd_stone needs an alias in ubersound.scr or uberdialog.scr - Please fix.
ERROR: Entity::LoopSound: sdkfz_tread_snd_stone needs an alias in ubersound.scr or uberdialog.scr - Please fix.
ERROR: Entity::LoopSound: sdkfz_tread_snd_stone needs an alias in ubersound.scr or uberdialog.scr - Please fix.
ERROR: Entity::LoopSound: sdkfz_tread_snd_stone needs an alias in ubersound.scr or uberdialog.scr - Please fix.
ERROR: Entity::LoopSound: sdkfz_snd_run needs an alias in ubersound.scr or uberdialog.scr - Please fix.
ERROR: Entity::LoopSound: sdkfz_tread_snd_stone needs an alias in ubersound.scr or uberdialog.scr - Please fix

but it 100 times more :shock:

Posted: Sat Jul 05, 2003 11:16 pm
by matt_moh
hmm, not sure how to make it fire at all allied players since i don't have that much experience mapping mp levels. I can show you where you can go to find out how to make a working sp halftrack. If you have spearhead and the SDK, look at the script for t2l1 which has a halftrack script in it. The SDK should have also came with the bsp for that level so you can take a look at the actual halftrack and use it's keys/values in your halftrack. As for the sounds, take a look at some of the tutorials on this site, there should be one about making custom sounds and editing the ubersound file. You'll probably have to wait for someone more experienced then me to come answer your question about making the halftrack fire at any allied player. I hope what I know so far helps.

Posted: Sun Jul 06, 2003 1:17 am
by Alcoholic
oops forgot a waitframe in my while thread..

anyways, in my example, every frame the game would cycle through each player, and check his team. when it finds an allied player, it stops cycling and starts firing.

Posted: Sun Jul 06, 2003 7:03 am
by martijn_NL
where do i need to add waitframe?

My question was the halftrack did not make sounds in multiplayer maps, how do i add that sound?

Posted: Sun Jul 06, 2003 7:04 am
by Alcoholic
when you think about it, if you dont have ANY form of wait in your script, it all executes in the blink of an eye. while threads need waits in them, or mohaa will get a command overflow.