Gadzilla Posted August 16, 2010 Share Posted August 16, 2010 Hey guys, I'm stuck with one problem. I want to write one script, but can't find opcode, which can answer for this function. I need something like this: when player shooting at some place, there creating object (or anything happens on this coordinate). How can I do this? Link to comment Share on other sites More sharing options...
Deji Posted August 16, 2010 Share Posted August 16, 2010 Far from the best way, but until I figure out the memory pool, it'll have to do! 068D: get_camera_position_to [email protected] [email protected] [email protected]: get_camera_target_point_to [email protected] [email protected] [email protected]: [email protected] = [email protected]: [email protected] = [email protected]: [email protected] = [email protected]// Vector/Offset of camera.0063: [email protected] -= [email protected]: [email protected] -= [email protected]: [email protected] -= [email protected]// Slowly increase the distance from camera point to 50.0 in front of player.for [email protected] = 4.0 to 50.0 step 1.0 005B: [email protected] += [email protected] 005B: [email protected] += [email protected] 005B: [email protected] += [email protected] if 86BD: not no_obstacles_between [email protected] [email protected] [email protected] and [email protected] [email protected] [email protected] solid 1 car 1 actor 1 object 1 particle 0 then // we've found the target point. break endend You have to test if the player is aiming before using this code... Otherwise it just gets anything that the camera is looking at. I'm using this for one of my new, smaller mods Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now