AITurrets are too weak

There are no stupid questions, just stupid answers.
  • 1
  • 2
13 posts Page 2 of 2
fLUnKnhaXYU
Posts: 53
Joined: Wed Nov 15, 2017 8:19 am
by fLUnKnhaXYU » Sat Sep 22, 2018 5:14 am
Strange thing , you can set up you turret with a wide scan field and walk straight up to it , as long as you're not exactly in the center . If you stand off to the side , it doesnt detect you . While in world editor , use the rotate tool and just nudge the object around very slightly and suddenly its scanning within the defined field and will detect you very nicely , up to 180 heading not 360 , so far .
These DAE's files show that all of the nodes "scanPoint ,aimPoint , heading , pitch" are in the model , however i cant find them when I import it to Blender 2.76 . I haven't determined what exactly is necessary for the scanning and aiming animations . Theres no "base" object in mine just a column-like object with all other nodes parented to it . its ugly and simple for testing /learning .
fLUnKnhaXYU
Posts: 53
Joined: Wed Nov 15, 2017 8:19 am
by fLUnKnhaXYU » Sun Sep 23, 2018 4:19 am
My "custom" version , mentioned in the last post , seems to be scanning in 360 deg. . There's a bit in the turret source that says
scanPoint = -1
aimPoint = -1
In the datablock I added strings in place of the -1 , I don't really know what is expected to be in this field or if it actually is the reason for the change in behavior .
scanPoint = -"scanPoint"
aimPoint = "aimPoint"
there seems to be some sort of pitch problem , but its definitely scanning 360 degrees .
The weapon isnt following the target . or moving at all . just firing .
fLUnKnhaXYU
Posts: 53
Joined: Wed Nov 15, 2017 8:19 am
by fLUnKnhaXYU » Sat Oct 20, 2018 6:40 am
well, I tried t0 figure things out about the 360 deg scanning and was thouroughly frustrated . My efforts lead me to rotating the entire model around the z axis 70 or so degrees at a time . That provide a 360 degree scan . And thats all I could do to make to deployable turret scan 360 degrees , I tried adding nodes , switching nodes , reorienting nodes etc, even mounting the turret to a rotating model would still only scan ahead along the y axis . This , I guess I might start and stop using schedules at onAdd/onRemove time , keep the turret weapon hidden until a target is detected , maybe swap out a static model for while there is no target because i had to rotate the entire origin . In the deployable turret datablock I put a field -
rotateZ = "0 0 1 0" ;

to be used by the function . So , just call the function , pass in the client and object id and in this case it rotates 70 degrees , I guess . If you find my coding funny and/or weird and/or ridiculous , feel free to share the humor . It needs a little tidying up though . such as maybe using this instead of obj.GetDataBLock but you get the picture .
//function serverCmdRotateScanner(%client, %obj, %Rot, %timeMS)
function rotatescanner(%this, %obj)
{
%vec = %obj.getdatablock().rotationZ;
//echo("\c1VECTOR pt1 = " @ %vec);
%word3 = getword(%vec,3);
%word3 +=70;

if (%word3 >= 360){
%word3 -=360;
}

//echo("\c4GETWORD3 pt1 = " @ %word3);
%vec = setword(%vec, 3, %word3);

%obj.setfieldvalue(rotation,%vec);
//echo("\c3VECTOR NOW = " @ %vec);
%obj.getdatablock().setfieldvalue(rotationZ, %vec);
//echo("\c1DATABLOCK.ROTATION = " @ %obj.getdatablock().rotationZ);

}
  • 1
  • 2
13 posts Page 2 of 2

Who is online

Users browsing this forum: Google [Bot] and 4 guests