Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 02/25/26 23:21
Zorro version 3.0 prerelease!
by TipmyPip. 02/25/26 16:38
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 6,196 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: IGNORE_FLAG2 [Re: Lukas] #319994
04/19/10 11:43
04/19/10 11:43
Joined: Jul 2000
Posts: 28,075
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,075
Frankfurt
Yes, all flags are already used from 0 to 31. I could still squeeze out one or two flags with some tricks, but I don't think that IGNORE flags are a good solution anyway. Most software that I know uses collision groups.

Re: IGNORE_FLAG2 [Re: jcl] #319996
04/19/10 11:52
04/19/10 11:52
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Ah ok. I just saw that you implemented collision groups already some time ago. That may indeed be a better solution.
Or, you could change the flags variable to a 64bit integer grin

Re: IGNORE_FLAG2 [Re: Lukas] #320115
04/19/10 19:05
04/19/10 19:05
Joined: Dec 2003
Posts: 1,225
germany
gri Offline
Serious User
gri  Offline
Serious User

Joined: Dec 2003
Posts: 1,225
germany
hi,

I have the following scenario.

My troops and an enemy group of cruel soldiers staying at the same place.

With an "c_scan" command each of my men trys to find its closest enemy.
So I could set the FLAG2 of the enemies and c_scan them with the SCAN_FLAG2 parameter to detect the enemys only.

The enemies tries to c_scan my men too.
Because my troops havent set the FLAG2, the enemies calling c_scan with IGNORE_FLAG2 to find only my units.

Fine, this works with 2 parties.
But what if there is a third or fourth group with diffrent relations to the other?

Here it would be helpfull if we could use all the flags and not only flag2.
Or what would you suggest to solve this ?

Hint:
I use a "timer" like functionality to spreed the massive c_scan calls over several engine frames to keep the framerate.
Its not needed that all warriors scanning their enviroment at the same frame and on each frame.


regards,
gri


"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
Re: IGNORE_FLAG2 [Re: gri] #320125
04/19/10 19:43
04/19/10 19:43
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
@gri
I think it is possible with "my.group"....

Re: IGNORE_FLAG2 [Re: gri] #320142
04/19/10 21:03
04/19/10 21:03
Joined: Apr 2010
Posts: 172
W
wdlmaster Offline
Member
wdlmaster  Offline
Member
W

Joined: Apr 2010
Posts: 172
There is no need for IGNORE_xxxxx. You can simply use a "identification skill". Every group get its own ID. If the scanned ID is different, the enemy was scanned. If its the same (my.ID == you.ID) the own team members are detectet.

Re: IGNORE_FLAG2 [Re: wdlmaster] #320180
04/20/10 08:37
04/20/10 08:37
Joined: Dec 2003
Posts: 1,225
germany
gri Offline
Serious User
gri  Offline
Serious User

Joined: Dec 2003
Posts: 1,225
germany
hi,
Originally Posted By: Widi
@gri
I think it is possible with "my.group"....


And I know its not. I checked that already.
my_troops.group = 1 and the enemy.group = 2

c_scan returns both types of units. I use it with and without IGNORE_PUSH.
So the group value seems to get ignored on c_scan.

Originally Posted By: wdlmaster
There is no need for IGNORE_xxxxx. You can simply use a "identification skill". Every group get its own ID. If the scanned ID is different, the enemy was scanned. If its the same (my.ID == you.ID) the own team members are detectet.


That doesnt work. c_scan delievers the closest entity.
What if an friendly unit is next? I had to set the you pointer to this entity and call c_scan with ignore_you again ?
No.
The c_scan function should filter out certain groups of units like IGNORE_FLAG2 | IGNORE_FLAG5.


regards,
gri


"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
Re: IGNORE_FLAG2 [Re: gri] #320181
04/20/10 08:48
04/20/10 08:48
Joined: Jul 2000
Posts: 28,075
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,075
Frankfurt
Generally, we don't want to clutter engine functions with lots of different modes. This makes scripting not easier, but more complicated. That's why we're very reluctant to implement a new mode that you can realize as well with 1 or 2 lines of script.

To check if c_scan hit an enemy or not, just compare some entity skill in the scan event, as wdlmaster suggested.

For c_move, ignore modes make indeed sense, but normally collision groups should solve most situations here.

Re: IGNORE_FLAG2 [Re: gri] #320189
04/20/10 10:09
04/20/10 10:09
Joined: Apr 2010
Posts: 172
W
wdlmaster Offline
Member
wdlmaster  Offline
Member
W

Joined: Apr 2010
Posts: 172
Yes it works!!! The scanning entity must use ENABLE_DETECT. It detects every entity in its scan range. This way, you can "select" any enemy, not just the closest one. For example, the weakest, the nearest, the fartest ...

Re: IGNORE_FLAG2 [Re: wdlmaster] #320194
04/20/10 11:00
04/20/10 11:00
Joined: Dec 2003
Posts: 1,225
germany
gri Offline
Serious User
gri  Offline
Serious User

Joined: Dec 2003
Posts: 1,225
germany
Originally Posted By: wdlmaster
Yes it works!!! The scanning entity must use ENABLE_DETECT. It detects every entity in its scan range. This way, you can "select" any enemy, not just the closest one. For example, the weakest, the nearest, the fartest ...


Ahh yes, you're right. This will work.

Primary I searched a solution which avoids calling the event-functions of all entitys in scanrange and deceide if its friend or enemy.
I thought to give the c_scan function a preselected group (like scan_flag2) would be the more cleaner and at runtime faster way.

But when JCL refuses to enhance the c_scan function, I only have the option to go with the event functions.

Thank you wdlmaster.


regards,
gri


"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
Re: IGNORE_FLAG2 [Re: gri] #320195
04/20/10 11:24
04/20/10 11:24
Joined: Apr 2010
Posts: 172
W
wdlmaster Offline
Member
wdlmaster  Offline
Member
W

Joined: Apr 2010
Posts: 172
c_scan is relatively fast already. You don't need to call it every frame. Once per second is enought i think. And i don't see any solution that would work without using events. This WOULD be possible, if c_scan returns a pointer-array, not only ONE pointer.

Page 2 of 2 1 2

Moderated by  aztec, Spirit 

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