Page 1 of 1

What is wrong with this script?

Posted: Mon Jul 28, 2003 5:50 pm
by Wilson
level.friendly1 targetname ramsey
level.friendly2 targetname durden
level.friendly3 targetname wilson


$ramsey.destination = $player
$durden.destination = $player
$wilson.destination = $player

$ramsey.friendtype = 1
$durden.friendtype = 1
$wilson.friendtype = 1

$ramsey.distance = 175
$durden.distance = 225
$wilson.distance = 250

$ramsey thread global/friendly.scr::friendlythink
$durden thread global/friendly.scr::friendlythink
$wilson thread global/friendly.scr::friendlythink

end

after waittillspawn at the top og my script i hav thread global/friendly.scr::friendlygen which is to activate the squad but they still wont follow me

btw i am new to all this

Posted: Mon Jul 28, 2003 8:33 pm
by Alcoholic
i dont know if you can give them targetnames yourself, i think they have to be part of the array still...

did you give them all an #fnum? if you did, well, if you really want to give them a different name, you can use a level variable like this:

level.ramsey = level.friendly1
level.durden = level.friendly2
etc etc

Posted: Tue Jul 29, 2003 10:43 am
by Parts
Wilson I presume you have give the targetnames in the map itself?

level.friendly1 targetname ramsey is not a valid line of script

level.friendly1 is a level scoped variable. If you want this to be equal to an AI in the script then you need:

level.friendly1 = $ramsey

However at the moment in your script you don't use those variables at all.

Grab me on TS and we can go through it if you like.

Also is this a single player map? If so ok, otherwise you need to refer to the array of players (i.e $player[1]) rather than just $Player

Posted: Tue Jul 29, 2003 12:34 pm
by bdbodger
level.friendly1 = $ramsey
shouldn't it be

level.friendly1.targetname = ramsey

you don't need " thread global/friendly.scr::friendlygen " all you need to do is Before level waittill spawn "exec global/friendly.scr".
the first couple of lines of the global/friendly.scr are
main:
$player.entref = -1
level.friendly_auto_arrange = 1
waitthread friendlygen
end
friendlythink activates them by friendtype . when I used it I used friendlythink first and then used friendtype after but I don't know if that is needed .

Posted: Tue Jul 29, 2003 1:02 pm
by Wilson
Well the spearhead AI SDK said to use those variables so im stuck really i hav pathnodes covering the whole of my map the enemy AI use them but of course im not scripting those but the AI jus dnt do anything unless i push em

Posted: Tue Jul 29, 2003 1:54 pm
by bdbodger
you mean this part of the SDK tutorial
//----------------------------------------------------------------------------
InitFriends:
//
// Setup our friendlies to wait until the player shows up...
//----------------------------------------------------------------------------

// rename our friendlies to something more "friendly"
level.friendly1.targetname = cappy
level.friendly2.targetname = friend2
level.friendly3.targetname = friend3

thread FriendWait

end