Coding

 Reply to this postStart new topic

Get coords of a particular area

Adler
post Dec 30 2010, 05:19 AM
Post #1


Devil's Advocate

Group Icon

Posts: 413
From: CA US
Joined: 26-July 09



I've seen some of Ryosuke's mods be able to do this but I when checking out his scripts I can't find the darn thing that makes this possible. Like I say I want to get the coordinates of the place (not ped/car/object) that CJ is targeting with a weapon or something, how would I go about accomplishing this?

Urgh this stuff has me confuzzled. dry.gif

This post has been edited by Adler: Dec 30 2010, 05:20 AM


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Dec 30 2010, 10:16 AM
Post #2


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



There's a function which processes the line of sight (0x56BA00) - unfortunately I don't know how to use this.

I've always gone for a manual approach...

SANNY
068D: get_camera_position_to 0@ 1@ 2@
068E: get_camera_target_point_to 3@ 4@ 5@
0063: 3@ -= 0@
0063: 4@ -= 1@
0063: 5@ -= 2@
for 6@ = 1.0 to 50.0 step 1.0   // from MinDistance to MaxDistance
    005B: 0@ += 3@
    005B: 1@ += 4@
    005B: 2@ += 5@
    0087: 6@ = 0@
    0087: 7@ = 1@
    0087: 8@ = 2@
    0087: 9@ = 0@
    0087: 10@ = 1@
    0087: 11@ = 2@
    000B: 6@ += 0.5
    000B: 7@ += 0.5
    000B: 8@ += 0.5
    000F: 9@ -= 0.5
    000F: 10@ -= 0.5
    000F: 11@ -= 0.5
    if
        0339:   anything_in_cube_cornerA 8@ 9@ 10@ cornerB 6@ 7@ 8@ solid 0 car 0 actor 1 object 0 particle 0
    then
        // this is probably the furthest point in the cameras direction
        break
    end
end


--------------------
Go to the top of the page
 
+Quote Post
DK22
post Dec 30 2010, 01:24 PM
Post #3


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



for 6@ = 1.0 to 50.0 step 1.0
Then, it will inexact, right?
Also, Seeman found some function in .exe that returns coords of targeting area.
SANNY
Wanted this code? GTFO

SANNY
Wanted this code? GTFO


This post has been edited by DK22: Dec 23 2011, 12:59 AM
Go to the top of the page
 
+Quote Post
Deji
post Dec 30 2010, 02:00 PM
Post #4


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Ah, very nice! This could also help me, thanks.


--------------------
Go to the top of the page
 
+Quote Post
Adler
post Dec 30 2010, 07:43 PM
Post #5


Devil's Advocate

Group Icon

Posts: 413
From: CA US
Joined: 26-July 09



Ooooh thanks a lot DK! This will help me a lot in future mods. smile.gif

EDIT

Hmm the last parameter for that function... is that a fixed range from the coords you pass to the function? I tried it out by putting a corona to mark where the coords the function gives out is and it seems like the corona's always a set distance from where the player is (when passing the player's position to the function). Maybe I should incorporate the function into a for loop and check for obstacles like Deji's method did.

This post has been edited by Adler: Dec 30 2010, 10:09 PM


--------------------
Go to the top of the page
 
+Quote Post
DK22
post Apr 10 2011, 08:47 AM
Post #6


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



^^ Method by Den_spb

This post has been edited by DK22: Dec 23 2011, 01:00 AM
Go to the top of the page
 
+Quote Post
ThirteenAG
post Apr 10 2011, 03:26 PM
Post #7


Ameteur Member

Posts: 54
Joined: 8-January 11



QUOTE (DK22 @ Apr 10 2011, 09:47 AM) *
^^ Method by Den_spb

EPIC!
Go to the top of the page
 
+Quote Post
DK22
post Apr 10 2011, 06:55 PM
Post #8


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



Do not steal my ideas tongue.gif

This post has been edited by DK22: Dec 23 2011, 01:00 AM
Go to the top of the page
 
+Quote Post
ThirteenAG
post Apr 10 2011, 08:07 PM
Post #9


Ameteur Member

Posts: 54
Joined: 8-January 11



QUOTE (DK22 @ Apr 10 2011, 07:55 PM) *
Do not steal my ideas tongue.gif

What can i say, i'm a mind reader laugh.gif
BTW, my game freezes after actor death with this code...
Go to the top of the page
 
+Quote Post
DK22
post Apr 10 2011, 08:40 PM
Post #10


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



QUOTE
What can i say, i'm a mind reader

happy.gif
QUOTE
BTW, my game freezes after actor death with this code...

A problem is here:
SANNY
Wanted this code? GTFO


This post has been edited by DK22: Dec 23 2011, 01:00 AM
Go to the top of the page
 
+Quote Post
methodunderg
post Apr 11 2011, 09:17 AM
Post #11


Ameteur Member

Posts: 38
Joined: 16-January 11



I've been waiting for a mod like this for ages. I remember seeing on the Vol-GTA forums, that Skript had made one, but someone told me that it was buggy, and wasn't going to release it. Hopefully this will be released soon smile.gif

Does it also work on cars ? And custom cars ? Also, for when peds shoot as well ?
Go to the top of the page
 
+Quote Post
ThirteenAG
post Apr 22 2011, 05:33 PM
Post #12


Ameteur Member

Posts: 54
Joined: 8-January 11



DK22, are you gonna release it as a mod?

This post has been edited by ThirteenAG: Apr 22 2011, 05:41 PM
Go to the top of the page
 
+Quote Post
DK22
post Apr 26 2011, 05:52 AM
Post #13


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



I have updated a code.
And wrote a specific code for calculating X and Z angle for object on another object)
Go to the top of the page
 
+Quote Post
methodunderg
post Apr 29 2011, 02:56 AM
Post #14


Ameteur Member

Posts: 38
Joined: 16-January 11



QUOTE (DK22 @ Apr 26 2011, 05:52 PM) *
I have updated a code.
And wrote a specific code for calculating X and Z angle for object on another object)


Are you going to release this DK22? I've wanted it ever since I found a thread on the forums @ VolGTA by Skript; who was trying to make something very similar.
Go to the top of the page
 
+Quote Post
ThirteenAG
post Apr 30 2011, 04:39 PM
Post #15


Ameteur Member

Posts: 54
Joined: 8-January 11



I have another idea cool.gif


UPD. I made a small video - http://www.youtube.com/watch?v=greTjyedYWU

This post has been edited by ThirteenAG: Apr 30 2011, 05:45 PM
Go to the top of the page
 
+Quote Post
DK22
post Apr 30 2011, 06:36 PM
Post #16


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



^^ Cool idea)
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: