MoveTo Not Working Properly

Post » Sat Oct 15, 2011 6:55 pm

Hey guys, I started messing around with my Hitman mod once again. I ran into trouble whilst trying to implement "aspects", which are basically attributes such as a bodyguard, or a hostile hitman being sent after you. The problem is the moveto function, which has never failed me before, is failing me now. It won't move the refs from one place to another. I did some testing, and when I run another script the moveto function works properly.

http://pastebin.com/LWUqUZ2R - Generates a target, places it, etc. Each ref is within a cell, so there is no issue with the refs. Any tips on improving my script would also be appreciated, as I've written it during various periods of my programming, for lack of a better word, career. Perhaps hobby would be a better description. :P

Part you should anolyze.
if ( mHitmanAspectLocal == 1 )                mAspectBodyguard.MoveTo mTarget                mAspectBodyguard.AddScriptPackage mHitmanSandboxAI                mAspectBodyguard.EvaluatePackageelseif ( mHitmanAspectLocal == 2 )                mAspectRobot.MoveTo mTarget                mAspectRobot.AddScriptPackage mHitmanSandboxAI                mAspectRobot.EvaluatePackageelseif ( mHitmanAspectLocal == 3 )                mAspectDog.MoveTo mTarget                mAspectDog.AddScriptPackage mHitmanSandboxAI                mAspectDog.EvaluatePackage


Here is the test script used to see if it was a problem with the refs or something. It worked as expected.
;moveto test for bodyguardsref bodyguardref dogref robotset bodyguard to mHitmanBodyguardRefset dog to mHitmanRobotRefeset robot to mHitmanDogRefebodyguard.moveto playerdog.moveto playerrobot.moveto player


I'll feel very embarrassed if this all has a rather simple solution, but I both hope for - pride and all that - and am in fear of it not having one. So, any help guys?
User avatar
Chenae Butler
 
Posts: 3485
Joined: Sat Feb 17, 2007 3:54 pm

Post » Sat Oct 15, 2011 2:52 pm

Tried "mAspectBodyguard.MoveTo Player"?
then you'll know if the problem is with mTarget.
not sure how anyone can check it without seeing how mTarget is set, possibly as well as mAspectBodyguard to be sure.
User avatar
Adam
 
Posts: 3446
Joined: Sat Jun 02, 2007 2:56 pm

Post » Sat Oct 15, 2011 12:03 pm

Tried "mAspectBodyguard.MoveTo Player"?
then you'll know if the problem is with mTarget.
Great idea. I'll try that soon and post the results.
not sure how anyone can check it without seeing how mTarget is set, possibly as well as mAspectBodyguard to be sure.
That's within the complete script I linked http://pastebin.com/LWUqUZ2R.
User avatar
Jeff Tingler
 
Posts: 3609
Joined: Sat Oct 13, 2007 7:55 pm

Post » Sat Oct 15, 2011 12:22 pm

oh yeh sorry, i glossed over that part :D

first thing

	set mAspectRobot to mHitmanRobotRefe	set mAspectDog to mHitmanDogRefe


probably not supposed to have "e" at the end of them?

second

is set mHitmanAspectLocal to 1 + GetRandomPercent * (4-1) / 99 definately going to generate a number between 1 and 3? seems odd that you have (4-1) instead of 3 and devide by 99 not 100.


you could try GetPos and SetPos instead of moveto but it's 2 extra variables and 3 extra lines of code per aspect :S
User avatar
Chris Cross Cabaret Man
 
Posts: 3301
Joined: Tue Jun 19, 2007 11:33 pm


Return to Fallout: New Vegas