betto212 Posted March 19, 2012 Share Posted March 19, 2012 (edited) im trying to do a script that "sound" createDetectionEvent im the point between the player and a dead npc ,but i cant figure out how make this work , if someone have some info or can land a hand this is the protocode ; if player kill actor2 set Px to Player.GetPos X set Py to Player.GetPos Y set Pz to Player.GetPos Z set ax to actor2.GetPos X set ay to actor2.GetPos y set az to actor2.GetPos z set mmx to (px+ax)/2 set mmy to (py+ay)/2 set mmz to (pz+az)/2 mymarker.setpos x mmx mymarker.setpos y mmy mymarker.setpos z mmz actor2.createDetectionEvent mymarker 100 Edited March 19, 2012 by betto212 Link to comment Share on other sites More sharing options...
drkaii Posted March 19, 2012 Share Posted March 19, 2012 ;if player kill actor2 set fAngle to Player.GetHeadingAngle Actor2 if fAngle < 0 set fAngle to fAngle + 360 endif set Distance to player.getdistance actor2 set fActor2PosZ to Actor2.GetPos Z set fDeltaZ to Player.GetPos Z - fActor2PosZ set Distance to ( Distance * Distance ) - ( fDeltaZ * fDeltaZ ) set Distance to sqrt Distance set Distance to Distance / 2 set MMX to Player.GetPos X + ( Distance * cos fAngle ) set MMY to Player.GetPos Y + ( Distance * sin fAngle ) MyMarker.setpos X MMX MyMarker.SetPos Y MMY MyMarker.SetPos Z fActor2PosZ + ( fDeltaZ / 2 ) ;create the event at the marker Try that. I wrote it pretty quickly and it may need a minus sign somewhere or a bit of tweaking. If it doesn't work, and you can't figure out why, send me a PM explaining what went wrong. GL! Link to comment Share on other sites More sharing options...
Recommended Posts