Jump to content

Papyrus Help, Detecting statics in a path


ghost23d

Recommended Posts

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 by ghost23d
Link to comment
Share on other sites

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

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 by ghost23d
Link to comment
Share on other sites

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())

 

 

 

 

 

 

 

JRSyt5P.jpg

 

 

 

hhCoFXR.jpg

 

 

Edited by ghost23d
Link to comment
Share on other sites

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 by ghost23d
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...