Scripts / Moving AI only works sporadically

Author
Message
hiredgunz48
8
Years of Service
User Offline
Joined: 9th Sep 2015
Location: Seattle, Washington
Posted: 19th Oct 2015 12:44
Hi everyone...

I'm trying to get an AI soldier to a static object (a small bush/flower)


The issue is with a function call (AIEntityGoToPosition) which works for 1 or 2 test runs, then stops working and the ai soldier just rotates to the player or stares at the player instead. Trying to make him run has never worked and trying to "teleport" him to the location just causes the soldier to bounce up and down quickly. I've added the forcesimple line to the soldier's fpe file, removed all custom scripts from the level, used just a simple 'if' conditional that evaluates to true, moved any waypoints far away from his postiion, but nothing I've tried or found helps the AIEntityGoToPosition function call work to get the little guy moving consistently. I know the object's co-ordinances that the soldier should move to are correct as he's moved there nicely a few times.

here is what I'm testing with now...



Thanks for any help.

Jan
Windows 10 64bit, Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 Mhz, 4 Core(s), NVIDIA GeForce GTX 960 2 gig GDDR5, 16 gigs ram
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 19th Oct 2015 13:31
are you doing anything to the flower at all with other scripts?
i tried multiple attempts to "fool" him with buildings and objects in the way etc but he always gets there (sometimes he likes to run into something for a while first but that's expected)
and not once did he look at me.

i would set both him and the flower to always active.

and for running change
SetCharacterToWalk(e)
to
SetCharacterToRun(e)
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
hiredgunz48
8
Years of Service
User Offline
Joined: 9th Sep 2015
Location: Seattle, Washington
Posted: 19th Oct 2015 23:11
Thank you smallg...

No, doing nothing with the flower except for this one event. The only custom script is attached to the soldier. I removed all custom scripts from the level to test if something else may be interfering. And before posting above, I've changed the entire script and the testing block above to SetCharacterToRun(e) several times, and tried a conditional depending on distance to the flower whether to run or walk, and modulating the walk speed. Like I said, the soldier walks right to the static object sometimes, but always stops moving after a few test runs, and with his line to the object completely clear.

I don't know.. it's just a simple function call to the game engine, so maybe it's windows 10 (or I'm missing some info to make it work).. I haven't tried setting both to always active since the flower is just a static object location for reference for the soldier, but I will try and see if that helps.

Thanks again,

Jan
Windows 10 64bit, Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 Mhz, 4 Core(s), NVIDIA GeForce GTX 960 2 gig GDDR5, 16 gigs ram
hiredgunz48
8
Years of Service
User Offline
Joined: 9th Sep 2015
Location: Seattle, Washington
Posted: 20th Oct 2015 00:17 Edited at: 20th Oct 2015 00:27
well.. changing to active for both entities worked on the first test run, nada on the 2nd and 3rd... added a distance check in the test block and still nothing. Removed the distance check, still no movement. Added my entire script and got a new intermittent lua error of nil value on line 73 . I'll post my entire script below, but I'm starting to think the lua gods hate me

line 73 error line:


entire code for character chad:

Windows 10 64bit, Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 Mhz, 4 Core(s), NVIDIA GeForce GTX 960 2 gig GDDR5, 16 gigs ram
hiredgunz48
8
Years of Service
User Offline
Joined: 9th Sep 2015
Location: Seattle, Washington
Posted: 20th Oct 2015 00:52
Okay, the GetDistance function was the cause of the nil value error, and removing the always active from the soldier solved the error. Guess I'll have lua write all the values out to a text file and see if my prompt debug missed something...
Windows 10 64bit, Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 Mhz, 4 Core(s), NVIDIA GeForce GTX 960 2 gig GDDR5, 16 gigs ram
hiredgunz48
8
Years of Service
User Offline
Joined: 9th Sep 2015
Location: Seattle, Washington
Posted: 20th Oct 2015 06:40
debug log write of the limited info I could get... And I had to change the SetCharacterToRun(e) to SetCharacterToWalk(e) before the IO file functions would even work or give any error message (even using assert, so the IO functions never ran until the change from run to walk) lol

Player Distance From Soldier At Move= 134.23742675781
Soldier/Flower Distance At Move Command= 2697.5627441406
X-Z postion of flower: X= 20959.798828125 Z= 21379.001953125
text_finished Variable= 1
Weapon Name= chad
Last E pressed setting= 0


Apparently the code I posted originally that doesn't work right on my computer, works fine on your computer smallg, so that would eliminate my coding as the issue... That leaves my computer or gameguru. There is no direction to go from this point though, so guess it's time to give up on this.
Windows 10 64bit, Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 Mhz, 4 Core(s), NVIDIA GeForce GTX 960 2 gig GDDR5, 16 gigs ram
hiredgunz48
8
Years of Service
User Offline
Joined: 9th Sep 2015
Location: Seattle, Washington
Posted: 20th Oct 2015 11:47 Edited at: 20th Oct 2015 12:12
so, gave it another go... gutted the level and all the scripts are stock gamguru scripts, insects gone. below is a video of a rare time the soldier moved to it's objective, and what happens immediately after running a second and third test. The exact script I'm using for the soldier is below also and I didn't change the code or anything else from the one time he moved as he should, to the immediate tests where he didn't...Also note there is no rotate to player in the script, and the soldier should rotate to the objective instead.



Here's how well the script works once, then not at all.

Windows 10 64bit, Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 Mhz, 4 Core(s), NVIDIA GeForce GTX 960 2 gig GDDR5, 16 gigs ram
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th Oct 2015 18:40
what about if you write it like this?
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
hiredgunz48
8
Years of Service
User Offline
Joined: 9th Sep 2015
Location: Seattle, Washington
Posted: 20th Oct 2015 21:00
Thank you smallg.. that's actually how I have it written in the original script, although the conditional variable "trigger" is called text_finished in mine. Still, I'd be happy to try your suggestion. BRB

Windows 10 64bit, Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 Mhz, 4 Core(s), NVIDIA GeForce GTX 960 2 gig GDDR5, 16 gigs ram
hiredgunz48
8
Years of Service
User Offline
Joined: 9th Sep 2015
Location: Seattle, Washington
Posted: 20th Oct 2015 21:35
I completely changed to the code in your suggestion. Same results no matter what positions the code bits are in. All the characters are still using stock gameguru passive lua, and all other custom scripts and characters are still removed. Unfortunately, the same results



Maybe I should try and get a Dev to look at this thread as their own ai_soldier.lua using AIEntityGoToPosition() seems to work consistantly....

Windows 10 64bit, Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 Mhz, 4 Core(s), NVIDIA GeForce GTX 960 2 gig GDDR5, 16 gigs ram
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 21st Oct 2015 20:01 Edited at: 21st Oct 2015 20:19
have you tried verifying GG files? my tests works every time with any combination of code placement (except some animation issues but that's just typical GG )

i'll upload the video in a bit
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
hiredgunz48
8
Years of Service
User Offline
Joined: 9th Sep 2015
Location: Seattle, Washington
Posted: 21st Oct 2015 20:37 Edited at: 21st Oct 2015 20:46
Thanks for your help smallg,

Yes, I've validated the steam files many, many times. I completely uninstalled Gameguru last night. As soon as I drink some coffee and my brain kicks in, I'll test the new install and see if that helps this, and a couple other problems.

Thanks,

Jan
Windows 10 64bit, Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 Mhz, 4 Core(s), NVIDIA GeForce GTX 960 2 gig GDDR5, 16 gigs ram
Brny
8
Years of Service
User Offline
Joined: 11th Oct 2015
Playing:
Posted: 21st Oct 2015 21:31 Edited at: 21st Oct 2015 21:34
Nothing, i did not understand you well....
PM
hiredgunz48
8
Years of Service
User Offline
Joined: 9th Sep 2015
Location: Seattle, Washington
Posted: 21st Oct 2015 21:51 Edited at: 21st Oct 2015 21:57
@Brny ???????????

@smallg... No difference. Using your script, works once, then not at all. Using my script, works once, then not at all. Doesn't seem to matter which code is used.

Guess I'll just have to use a more involved workaround.. Maybe record chad with the dialog, edit the video and use a story zone, destroy chad one and spawn a chad 2 at the gun range. Obviously the current plan isn't going to work.
Windows 10 64bit, Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 Mhz, 4 Core(s), NVIDIA GeForce GTX 960 2 gig GDDR5, 16 gigs ram
hiredgunz48
8
Years of Service
User Offline
Joined: 9th Sep 2015
Location: Seattle, Washington
Posted: 1st Nov 2015 11:58
Okay, just to let anyone that reads this thread know, I solved the problem by not using the gameguru character creator characters. The stock gameguru characters work fine with any of the move commands, while the character creator humans only work sporadically. Don't know why, nor do i know if that's the specific issue, but that's what solved the problem for me

Windows 10 64bit, Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 Mhz, 4 Core(s), NVIDIA GeForce GTX 960 2 gig GDDR5, 16 gigs ram

Login to post a reply

Server time is: 2024-05-05 01:13:18
Your offset time is: 2024-05-05 01:13:18