halftrack

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

halftrack

Post 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?
Mapping 4 life
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

possible

Post by tltrude »

Anything is possible, if you know how.
Tom Trude,

Image
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post 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.
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Post by martijn_NL »

i will try that
Mapping 4 life
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Post 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:
Mapping 4 life
matt_moh
Sergeant
Posts: 65
Joined: Sat Feb 08, 2003 12:04 am

Post 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.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post 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.
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Post 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?
Mapping 4 life
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post 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.
Post Reply