Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,388 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
checking if the player is insed the correct radius #262034
04/21/09 16:49
04/21/09 16:49
Joined: Apr 2009
Posts: 18
F
FlyingRaven Offline OP
Newbie
FlyingRaven  Offline OP
Newbie
F

Joined: Apr 2009
Posts: 18
I have the code here and it should work. so the only reason why it isn't working is that I'm give the wrong position fore the player.

Just in case I also tryed the code in c++ in a test envirment that I made since I can't debug in lite-c becouse I have no debug window...

so if anyone can point me in the right way I thank you, and to further clarify I am using the plBiped01 that came along with lite-c.

function checkInTalkRange()
{
...var talkEvents = 2;
...var radius2 = 100*100;
...var x0 = 0;
...var y0 = 0;
...x0 = my.x;
...y0 = my.y;
...var i = 0;
...while(i < talkEvents)
...{
......var x1 = 0;
......var y1 = 0;
......x1 = npcX;
......y1 = npcY;
......var dx = 0;
......dx = x1 - x0;
......var dy = 0;
......dx = y1 - y0;
......var distance = 0;
......distance = (dx*dx) + (dy*dy);
......if(distance < radius2)
......{
.........talk();
......}
...i += 1;
...}
}

the problem is that the distance seams to get the wrong numbers and the my.x my.y should be from the plBiped01 altough they are called forth in a difrent file named talk so maybe thats the problem.

I used the ... to show the height in the code since it seams to delete my spaces when I past.

Last edited by FlyingRaven; 04/21/09 16:54.
Re: checking if the player is insed the correct radius [Re: FlyingRaven] #262067
04/21/09 18:59
04/21/09 18:59
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
I can offer you to look at the function c_scan smile
Also, it had very goor description(how c_scan cone works) somewhere in the Aums, but i dont remember, where exactly it was


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: checking if the player is insed the correct radius [Re: VeT] #262069
04/21/09 19:15
04/21/09 19:15
Joined: Apr 2009
Posts: 18
F
FlyingRaven Offline OP
Newbie
FlyingRaven  Offline OP
Newbie
F

Joined: Apr 2009
Posts: 18
I have looked at c scan but I have to admit I have no idea what it does. by the looks of it it just makes 4 difrent scan object and I really have no idea how to work with it.

Re: checking if the player is insed the correct radius [Re: VeT] #262070
04/21/09 19:16
04/21/09 19:16
Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Ralph Offline
Senior Member
Ralph  Offline
Senior Member

Joined: Feb 2006
Posts: 385
Oldenburg,Germany
It is the Aum54.
But vec_dist is a good choice too.
Code:
if(vec_dist(player.x,you.x) < 40)//if the distanc between the player and the you entity is smaller then 40 quants talk
{
   talk();
}


Re: checking if the player is insed the correct radius [Re: Ralph] #262071
04/21/09 19:20
04/21/09 19:20
Joined: Mar 2003
Posts: 3,010
analysis paralysis
NITRO777 Offline
Expert
NITRO777  Offline
Expert

Joined: Mar 2003
Posts: 3,010
analysis paralysis
I agree with Ralph, your code looks very complicated, I must admit that I dont really understand it, all of your code can be consolidated into just the one line which Ralph wrote smile grin

Re: checking if the player is insed the correct radius [Re: NITRO777] #262072
04/21/09 19:42
04/21/09 19:42
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Anyway, vec_dist isnt equal to c_scan :)))
on the other hand, Raven, you can combine vec_dist with pan of the eitity ^^


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: checking if the player is insed the correct radius [Re: VeT] #262074
04/21/09 20:01
04/21/09 20:01
Joined: Apr 2009
Posts: 18
F
FlyingRaven Offline OP
Newbie
FlyingRaven  Offline OP
Newbie
F

Joined: Apr 2009
Posts: 18
thank you fore all the help so far but I still have a question.

what is the true x,y,z value's from the player biped

becouse it has

multiple x declerations and I am not sure wich one gives it's true position

Re: checking if the player is insed the correct radius [Re: FlyingRaven] #262087
04/21/09 21:23
04/21/09 21:23
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
http://aum.conitec.net/aum54.zip
Take this.. Its about c_scan cone wink


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: checking if the player is insed the correct radius [Re: VeT] #262098
04/21/09 22:23
04/21/09 22:23
Joined: Apr 2009
Posts: 18
F
FlyingRaven Offline OP
Newbie
FlyingRaven  Offline OP
Newbie
F

Joined: Apr 2009
Posts: 18
Originally Posted By: VeT
http://aum.conitec.net/aum54.zip
Take this.. Its about c_scan cone wink


thx


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1