What is wrong with this script?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Wilson
Warrant Officer
Posts: 131
Joined: Fri Mar 07, 2003 6:12 pm

What is wrong with this script?

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

Post 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
Parts
Sergeant
Posts: 72
Joined: Thu Apr 10, 2003 12:35 pm
Location: UK
Contact:

Post 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
[VS-UK]Capt.Parts[BnHQ]
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 .
Wilson
Warrant Officer
Posts: 131
Joined: Fri Mar 07, 2003 6:12 pm

Post 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
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

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