Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Nymphodora, AndrewAMD, TipmyPip, Quad, Imhotep), 824 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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,524
Canada
Stansmedia Offline OP
Serious User
Stansmedia  Offline OP
Serious User

Joined: Mar 2003
Posts: 1,524
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,524
Canada
Stansmedia Offline OP
Serious User
Stansmedia  Offline OP
Serious User

Joined: Mar 2003
Posts: 1,524
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,524
Canada
Stansmedia Offline OP
Serious User
Stansmedia  Offline OP
Serious User

Joined: Mar 2003
Posts: 1,524
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