Spawning Paths, and Standing Still

Post your scripting questions / solutions here

Moderator: Moderators

jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

AI will not follow pathnodes like waypoints.. you made a nice targeted list of pathnodes but for the code this is immaterial.. a bot will only walk to the position you tell it and stop there.. if you want it to actually follow the path, you have to explicitly tell it to move to the next node when it has reached the previous node. This is what global/friendly.scr does, too.
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

thats... not right. i've always made paths with pathnodes targeting one another (with the DO_NOT_NAVIGATE thing selected) and the AI have always followed them normally, since they'll move anywhere with a coordinate destination. as long as the target/targetname system wasn't broken somewhere along the chain it always worked.

and no i never ran them through the friendly.scr when i set paths for them. are you sure pathnodes dont behave like that jv?

in AA, i never mapped for SH.

to mop up your question, broad, it seems you need to change the info_pathnode to info_waypoint and it ought to work.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Broadus
Captain
Posts: 235
Joined: Mon Jan 30, 2006 5:35 am

Post by Broadus »

Well, info_waypoint made the AI actually move to the first point properly (so I didn't have to shoot them repeatedly). However, they still won't go to the second part.
Lizardkid, could you give me an example of a path-spawning script that has actually worked out fine for you? If you've ever used it before, I mean.
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

no i've never used the loop script i gave you and rookie corrected, that was just what occured to me as a good way to do it, i always did it in radiant with a chain of nodes, told the AI to walk or run or crouch to the first one and they'd continue along the line heedless to fire until they reached the end. i used it numerous times with crappy little firefight maps; why it worked i now have no idea, except maybe they counted it as a nav path..?

all i know is i used chained pathnodes for patrol routes and little walkto's, it worked fine.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Broadus
Captain
Posts: 235
Joined: Mon Jan 30, 2006 5:35 am

Post by Broadus »

Well, I decided to use a different method to spawn the info_pathnodes. As they should, the AI will move to the first point. However, I can't get the first pathnode to target the next pathnode.
leftalleypathmake1:
local.path = spawn info_pathnode "origin" "3603.88 5676.09 201.46" "targetname" "leftalley1"
$leftalley1.target = $leftalley1a
local.path = spawn info_pathnode "origin" "3557.80 5796.81 168.13" "targetname" "leftalley1a"
$leftalley1a.target = $leftalley1b
local.path = spawn info_pathnode "origin" "2679.21 5786.67 168.91" "targetname" "leftalley1b"
$leftalley1b.target = $leftalley1c
ETCETERA
end
I'm using the same method to spawn vehicle paths. The same go-to-first-pathnode-but-not-the-second occurs.
ufftank1pathspawn:
local.path = spawn info_vehiclepoint "origin" "-1218.77 -1518.17 340.12" "targetname" "ufftank1path"
$ufftank1path.target = $ufftank1patha
local.path = spawn info_vehiclepoint "origin" "-2079.42 -1804.95 288.13" "targetname" "ufftank1patha"
$ufftank1patha.target = $ufftank1pathb
local.path = spawn info_vehiclepoint "origin" "-2515.50 -2194.42 295.54" "targetname" "ufftank1pathb"
$ufftank1pathb.target = $ufftank1pathc
local.path = spawn info_vehiclepoint "origin" "-2079.42 -1804.95 288.13" "targetname" "ufftank1pathc"
$ufftank1pathc.target = $ufftank1pathd
local.path = spawn info_vehiclepoint "origin" "-1218.77 -1518.17 340.12" "targetname" "ufftank1pathd"
$ufftank1pathd.target = $ufftank1pate
local.path = spawn info_vehiclepoint "origin" "-868.73 -1211.27 372.16" "targetname" "ufftank1pathe"
$ufftank1pathe.target = $ufftank1path
end
saying $name1.target = $name2 or $name1 target $name2 doesn't work. Clearly. So, how can I get the first part of the path to target the next? If anyone can answer that, all path-making problems should be solved.
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

actually try making the tank or AI's target key be the first node's name.

so like say you have $path1 and $guy1, make $guy1.target = $path1
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

I like to spawn pathnodes like this

level.botnode[0] = ( 1012.350 -851.668 244.125)
level.botnode[1] = ( 1190.161 -904.136 242.863)
level.botnode[2] = ( 1368.952 -919.456 239.991)
level.botnode[3] = ( 1547.987 -929.026 238.196)
....
....


for(local.nodes = 0;local.nodes < level.botnode.size;local.nodes++)
level.botnode[local.nodes] = spawn info_pathnode origin level.botnode[local.nodes] spawnflags 4

but anyway I am sure I have seen scripts that just spawned info_spinepath nodes or even script_origins to create a path .

I don't think haveing the tank target the first node is going to work . When you do that in radiant , have a tank target a script_object made of clip brushes the script_object is used as the tanks collision entity so it is not used for the path .
Image
Broadus
Captain
Posts: 235
Joined: Mon Jan 30, 2006 5:35 am

Post by Broadus »

Well, getting the vehicle/person to target the first pathnode didn't do anything, I'm afraid.
bdbodger, your idea didn't work out, either. I'm not making bots, so characters have to be told to run to wherever they're supposed to go. I couldn't give the level.botnodes targetnames so that they could be used as a drive or runto.

So, this is what I'm thinking...
If level.botnode was given a targetname, then it would probably work, though I don't know how to give level.botnode a targetname.
or
Maybe threre would be something like "if tank/person gets here, then they go there", so once the tank/person got to the first part of the path, a script would tell them specifically to go to the second. I don't know how to script this, either.
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

you can assign any key/value to anything that has a reference to it.

reference can go by targetname of variable

$tank.targetname = betsy
and
level.mk34tank.targetname = betsy

will do the same thing, as long as the level.mk34tank points to $tank.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Maybe target the AI or tank to the first node?
$AItank.target = $leftalley1

Then connect the rest of the nodes???
Image
Broadus
Captain
Posts: 235
Joined: Mon Jan 30, 2006 5:35 am

Post by Broadus »

. . . Wow, Green Beret. Thanks for trying to help, but it's been thoroughly discussed a few posts ago that that hasn't worked out at all.
I'm going to try to give level.botnode a targetname later to see if it works, but I've been busy making Sherman tanks in Spearhead that can fire the machine gun on the front of the body and the main turret on top at the same time at different enemies. And it works! Hooray! But, for now, I gotta' go watch a mooovie.
Image
Tod001
Major
Posts: 294
Joined: Sat May 06, 2006 1:23 pm
Location: Shack in the woods,VA
Contact:

Post by Tod001 »

Keep at it, dude, mean, Sir!!!! :wink:
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Yea, Im sure its one of them lil things thats just being overlooked :wink:
Image
Broadus
Captain
Posts: 235
Joined: Mon Jan 30, 2006 5:35 am

Post by Broadus »

... Well, now what are you talkin' 'bout?
Image
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Sometimes its a capital letter that should be lower case, or a extra space somewere, Little things like that can stop your script from running.
8-)
Image
Post Reply