target naming spawn points

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Dragon013
Corporal
Posts: 34
Joined: Fri Sep 17, 2004 9:42 pm
Location: uk
Contact:

target naming spawn points

Post by Dragon013 »

hello

does anyone no the script for adding and target naming spawn points?

if u do can give exzample

niceone
dragon013
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

yes pak5.pk3 - maps/obj/obj_team3.scr look for

$spawn_allied2 disablespawn
$spawn_allied3 disablespawn

or

$spawn_axis1 disablespawn
$spawn_axis2 enablespawn
$spawn_allied1 disablespawn
$spawn_allied3 enablespawn
Image
Dragon013
Corporal
Posts: 34
Joined: Fri Sep 17, 2004 9:42 pm
Location: uk
Contact:

thats good i need that, also

Post by Dragon013 »

thats good i need that also but need to no the correct way of creating the target named spawn this is what i have tried:

example1

Code: Select all

local.allies = spawn info_player_allied "targetname" "al1"
local.allies.angle = 7
local.allies.origin = ( -6480 -3802 476 )

local.axis = spawn info_player_axis "targetname" "al1"
local.axis.angle = -97
local.axis.origin = ( 4438 -181 570 )
example2

Code: Select all

spawn info_player_axis "targetname" "ax1"
$ax1.angle = -106
$ax1.origin = ( -1040 -479 448 )

spawn info_player_allies "targetname" "al1"
$al1.angle = -9
$al1.origin = ( -5136 -3295 459 )
hope this can help u help me

niceone

Dragon013
dragon013
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

The first should work. The second will not work, as using the targetname as handle will probably screw up because as you have multiple entities with the same targetname... so I think $al1 will contain an array of spawns in the second variant ( not sure exactly, by anyways: the first one should work just fine ).
Admin .MAP Forums
Image
Head above heels.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

If you give the both the same targetname you will need to call them as an array $al1[1] $al1[2] etc also how are you going to tell which one is the axis or allies spawnpoint . I assume you want to turn some off and others on like this maybe only do the same for each team with different targetnames so you can tell what ones to turn off for each team.

$allies_front_spawnpoint disablespawn
$allies_back_spawnpoint enablespawn

or for more than one

for(local.i=1;local.i<=$allies_front_spawnpoint.size;local.i++)
{
$allies_front_spawnpoint[local.i] disablespawn
}

for(local.i=1;local.i<=$allies_back_spawnpoint.size;local.i++)
{
$allies_back_spawnpoint[local.i] enablespawn
}
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Actually, writing:

Code: Select all

$allies_front_spawnpoint disablespawn
...will disable all spawns with that targetname. I guess the command was ment to work on arrays from the start.
Admin .MAP Forums
Image
Head above heels.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Is that right? cool thats better
Image
Post Reply