ghost23d Posted January 24, 2019 Share Posted January 24, 2019 (edited) Hi, i am hoping someone can help me out with some collision detection i am trying to solve. I have a point in space that i need to check for collisions with the player if the player were to move to that point from somewhere nearby. I have tried using trigger primitives but the dont respond when you change the collision layer. Or OnTriggerEnter only responds when the player enters the volume, In other engines there are functions like Raycast that let you fire a ray that can report what object it hit and coordinates that the object hit happened at.. anything like this in CK with papyrus? Edited January 24, 2019 by ghost23d Link to comment Share on other sites More sharing options...
SKKmods Posted January 25, 2019 Share Posted January 25, 2019 I have used synthetic methods like PlaceAtMe() an object using reciprocal distance/bearing from the player on other side of a point of interest and then checking HasLOS() but that is slow. If your testing dynamic points in space then terrain Z elevations and inconsistent MoveToNearestNavmeshLocation() makes the whole thing frustrating trying to place a target test object. Link to comment Share on other sites More sharing options...
ghost23d Posted January 25, 2019 Author Share Posted January 25, 2019 So do you have any other ideas you'd b willing to share] Link to comment Share on other sites More sharing options...
Evangela Posted January 26, 2019 Share Posted January 26, 2019 (edited) Triggers can be set to fire objects, but in this case OnTrigger would be the event to use, but not good at all since it doesn't stop triggering. Edited January 26, 2019 by Rasikko Link to comment Share on other sites More sharing options...
ghost23d Posted January 26, 2019 Author Share Posted January 26, 2019 (edited) OK, got a new plan for this detection, using a spell to shoot a projectile at the target location, if it hits something before it reaches target location, use explosion to spawn a xmarker. that gets me a reference to use as the closest reference to my target that would not clip through a static or smthin, main problem so far being that the function Cast(akSource,akTarget) point blank refuses to use the akTarget field even though i am giving it a valid objectreference, i think i am missing a step in my spell creation tho. i am not sure what would allow my spell to target only the objects i tell it to in a script... Do i setup Casting type: Fire&Forget, and Delivery: Aimed or what.. not really sure whats causing it to bug.... In game the spell fires cause i have a tracer projectile attached temporarily that lights up bright red, but it only goes where i am aiming.. i want it to only target the marker i give it. Marker works just fine as i can move it and translatetoref stuff using it. Edited January 26, 2019 by ghost23d Link to comment Share on other sites More sharing options...
ghost23d Posted January 27, 2019 Author Share Posted January 27, 2019 (edited) Heres a snippet of code, i bolded the cast spell function... dunno wtf is going on with it tho SPELL Property G23DRaycast Auto Const{TestCase Raycast}PROJECTILE Property G23DRaycastProj Auto Const......float targetPosX = fromX + (JumpVector * sin(angleZ)) ; X is left float targetPosY = fromY + (JumpVector * cos(angleZ)) ; y is forward float JumpHVector = Player.GetPositionZ() + JumpHeight ; Jump Height G23DXMarker.MoveTo(Player) G23DXMarker.SetPosition(targetPosX,targetPosY,JumpHVector) G23DRaycast.Cast(Player,G23DXMarker) <<< this kek dont work 4 some reason, casts at cross hair no matter what i tell it to do Trace("SpellCast at: " + G23DXMarker) Trace("Trigger: "+G23DXMarker.GetPositionX() + "=>" + G23DXMarker.GetPositionY() + "=V " + G23DXMarker.GetPositionZ()) Edited January 27, 2019 by ghost23d Link to comment Share on other sites More sharing options...
ghost23d Posted January 27, 2019 Author Share Posted January 27, 2019 (edited) derp double post Edited January 27, 2019 by ghost23d Link to comment Share on other sites More sharing options...
Reneer Posted January 27, 2019 Share Posted January 27, 2019 You want to use RemoteCast instead of Cast. Link to comment Share on other sites More sharing options...
ghost23d Posted January 27, 2019 Author Share Posted January 27, 2019 (edited) Didnt work with RemoteCast either, same result, spell fires but in a straight line from the source at the crosshair, Update:So apparently Cast doesnt like xmarkers or plain static object references, if you want it to cast at a target you need to used movable statics for it to work... would have been nice to know earlier but oh well Edited January 27, 2019 by ghost23d Link to comment Share on other sites More sharing options...
SKKmods Posted January 27, 2019 Share Posted January 27, 2019 You may be hitting this "Actor races can be set to cast magic only in the direction that the actor is facing; if the source is an actor with this racial setting, the target will be ignored." Link to comment Share on other sites More sharing options...
Recommended Posts