Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, dpn), 1,328 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
C_SCAN #147567
08/12/07 11:32
08/12/07 11:32
Joined: May 2006
Posts: 148
Latvia
MTD Offline OP
Member
MTD  Offline OP
Member

Joined: May 2006
Posts: 148
Latvia
I have a big problem.
My entity scans neraby objects, the objects have all
my.enable_scan = on;
The problem is that my entity scans only the closest object , but i want that he scans all objects in his range(not the closest).
1. Is it possible to scan only objects whos my.transparent is off or
my.passable is on?
2. Maybe there is a c_trace function that traces only in given area(like in what way it loks)?

Re: C_SCAN [Re: MTD] #147568
08/12/07 11:34
08/12/07 11:34
Joined: May 2006
Posts: 148
Latvia
MTD Offline OP
Member
MTD  Offline OP
Member

Joined: May 2006
Posts: 148
Latvia
Is it possible to scan all objects and ignore objects whos my.skill3 == 2???

Re: C_SCAN [Re: MTD] #147569
08/12/07 11:45
08/12/07 11:45
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline
Serious User
jigalypuff  Offline
Serious User

Joined: Nov 2005
Posts: 1,007
lol my problem is i want to scan only one at a time but i`m scaning everything, look in this thread and the code there will scan all entitys with my.enable_scan = on;
http://www.coniserver.net/ubbthreads/sho...e=0&fpart=1


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: C_SCAN [Re: MTD] #147570
08/12/07 11:50
08/12/07 11:50
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
You may try to add SCAN_LIMIT in your c_scan mode list to find those
entities with ENABLE_SCAN is on.

Code:

function scanEvent()
{
if (event_type == event_scan)
{
my.enable_scan = off; // scanner will ignore me. But then again
// you need to find a way to re-enable it again
}
}

action scanEntity
{
my.enable_scan = on;
my.event = scanEvent;
}



Re: C_SCAN [Re: vlau] #147571
08/12/07 12:36
08/12/07 12:36
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Like the manual says c_scan modifies YOU to the pointer to the closest detected entity, and using event_detect all detected entities can be enumerated.

1) Imagine a function SCAN_ENTITIES;

2) In that function you call numberOfEntities = C_SCAN..., gives you the number of detected entities at all the time;

3) Turn the entity detectable using my.enable_detect = on, and call the event that will trigger the detection process, f.e. my.event = SCAN_ENTITIES_EVENT;

4) And now the event funtion (SCAN_ENTITIES_EVENT()):

Code:

if(scanEntityID >= numberOfEntities)
{
return;
}

if(event_type == event_detect)
{
TEMP_SCANNED_ENTITY = you;
scan_array_list[scanEntityID] = you;
scan_array_list[scanEntityID] = handle(TEMP_SCANNED_ENTITY);
scanEntityID += 1;
}





This way you save all detected entities in the handle array list.

5) Dont forget to turn the entities you want to be detected using my.enable_detect = on;

6) Now, when you need to acess those detected entities, just use the handle:

Code:


while (i < numberOfEntities)
{
if (scan_array_list[i])
{
you = ptr_for_handle(scan_array_list[i]);
}
}





Re: C_SCAN [Re: demiGod] #147572
08/12/07 13:40
08/12/07 13:40
Joined: May 2006
Posts: 148
Latvia
MTD Offline OP
Member
MTD  Offline OP
Member

Joined: May 2006
Posts: 148
Latvia
Thanks vlau and others.
I made something like this and it's working:
I add my.skill47 = 9; to my enemy(the head). The enemys body is scaning the "nodes" and the enemys head is scaning for player.
So when the enemys head is scaning the nodes, they are ignored, because
look at the script:

if (event_type == event_scan)
{
if (you.skill47 == 9)//Scanned by head
{
my.enable_scan = off;
}
else
{
if (you.skill47 == 1234) // Scanned by body
{

And everything is working ... Thanks ...


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