Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by 3run. 02/28/20 09:28
Editting
by peterhw. 02/27/20 15:20
PS1 texturing bubbling ?
by 3run. 02/27/20 13:36
enum case / if else
by danatrader. 02/27/20 00:07
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
11 registered members (3run, Jerome8911, AndrewAMD, alibaba, txesmi, Sinuhet, Quad, FLD, Dalla, jenGs), 968 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Emrah06, zac, DebraSteed, Ricard, Apollo1
18379 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Continuing c_scan #441595
05/28/14 07:43
05/28/14 07:43
Joined: Mar 2003
Posts: 1,522
Canada
Stansmedia Offline OP
Serious User
Stansmedia  Offline OP
Serious User

Joined: Mar 2003
Posts: 1,522
Canada
Im trying to perform a scan of entities with scan limit and a test if the entities FLAG1 is set. Problem is the scan is executed randomly and if the object being scanned for is within a certain distance (and they are all in pretty short distance most of the time) - I need to ignore that entity and scan for one further. I tried running another scan after the distance returned less then the certain value with ignore you in the second scan but it's just coming up with empty pointer errors.

So basically, I need to run a c_scan that only returns entities that are further then a specified distance. I could have each of the entities being scanned for run their own vec_dist and toggle their enable_scan based on their own distance checked... But that's a lot of functions to be running so that's kind of a poor way out. Any ideas?


Decessus - 80% done. 100% abandoned.
GET MY ANDROID GAME! https://play.google.com/store/apps/details?id=com.lasertrain.zspinballfree&hl=en
Re: Continuing c_scan [Re: Stansmedia] #441596
05/28/14 08:07
05/28/14 08:07
Joined: Jun 2013
Posts: 108
Alberta, Canada
C
CanadianDavid Offline
Member
CanadianDavid  Offline
Member
C

Joined: Jun 2013
Posts: 108
Alberta, Canada
In the entity performing the scanning, perhaps you can simply do one check for distance (using vec_dist) based on the modified 'you' pointer given that c_scan result is greater than zero:

Code:
result = c_scan(...);
if(result>0 && you != NULL){
  var distance = vec_dist(my.x, you.x);
  if(distance > 100) { ... } // do something if further than a distance of 100
}


Re: Continuing c_scan [Re: CanadianDavid] #441628
05/29/14 01:46
05/29/14 01:46
Joined: Mar 2003
Posts: 1,522
Canada
Stansmedia Offline OP
Serious User
Stansmedia  Offline OP
Serious User

Joined: Mar 2003
Posts: 1,522
Canada
I think performing the scan ahead of the play with vec_rotate will be the best way. I went to bed last night and it popped into my head. Which is the worst time because I had to get up early and I really wanted to stay up and keep coding haha.

Something like this:

vec_set(temp.x,vector(64,0,0));
vec_rotate(temp.x,vector(camera.pan,0,0));
vec_add(temp.x,camera.x);
c_scan(temp.x,...);


Decessus - 80% done. 100% abandoned.
GET MY ANDROID GAME! https://play.google.com/store/apps/details?id=com.lasertrain.zspinballfree&hl=en
Re: Continuing c_scan [Re: Stansmedia] #441629
05/29/14 02:31
05/29/14 02:31
Joined: Jun 2013
Posts: 108
Alberta, Canada
C
CanadianDavid Offline
Member
CanadianDavid  Offline
Member
C

Joined: Jun 2013
Posts: 108
Alberta, Canada
If you're absolutely sure you won't need a c_scan surrounding the player then that sounds like it could work too!

Re: Continuing c_scan [Re: CanadianDavid] #441631
05/29/14 03:13
05/29/14 03:13
Joined: Mar 2003
Posts: 1,522
Canada
Stansmedia Offline OP
Serious User
Stansmedia  Offline OP
Serious User

Joined: Mar 2003
Posts: 1,522
Canada
I'll give a random y position to scan with, should turn out alright. laugh


Decessus - 80% done. 100% abandoned.
GET MY ANDROID GAME! https://play.google.com/store/apps/details?id=com.lasertrain.zspinballfree&hl=en

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

Gamestudio download | chip programmers | 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