Gamestudio Links
Zorro Links
Newest Posts
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
4 registered members (ozgur, AbrahamR, wdlmaster, 7th_zorro), 839 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
c_scan and you pointer #407360
09/11/12 21:20
09/11/12 21:20
Joined: Jun 2009
Posts: 26
D
dd231 Offline OP
Newbie
dd231  Offline OP
Newbie
D

Joined: Jun 2009
Posts: 26
Hey there I have a function that scans for an entity and I simply need to have it clear the you pointer if a skill doesn`t match. I can`t seem to get it to work... can anyone help me out; here it is:

function alert_infantry()
{
c_ignore(1,3);
c_scan(my.x,my.pan,vector(360,0,10000),SCAN_ENTS|IGNORE_ME|IGNORE_PASSABLE|IGNORE_WORLD);
if(you)
{
if(your.player_assign != my.player_assign)
{set(you,INVISIBLE);}
if(your.player_assign == my.player_assign)
{you = NULL;}
}
}

Re: c_scan and you pointer [Re: dd231] #407363
09/11/12 23:05
09/11/12 23:05
Joined: Jun 2009
Posts: 26
D
dd231 Offline OP
Newbie
dd231  Offline OP
Newbie
D

Joined: Jun 2009
Posts: 26
Wow I can be slow...

All I had to change was if(you != NULL) for anyone else having a brain fart!

Re: c_scan and you pointer [Re: dd231] #407364
09/11/12 23:10
09/11/12 23:10
Joined: Jun 2009
Posts: 26
D
dd231 Offline OP
Newbie
dd231  Offline OP
Newbie
D

Joined: Jun 2009
Posts: 26
nevermind it didn`t work frown

Re: c_scan and you pointer [Re: dd231] #407367
09/12/12 01:45
09/12/12 01:45
Joined: Sep 2012
Posts: 74
Niedersachsen, Germany
P
PriNova Offline
Junior Member
PriNova  Offline
Junior Member
P

Joined: Sep 2012
Posts: 74
Niedersachsen, Germany
Does it work, if you change in the if-clause 'your' to 'you'? Only guessing

Re: c_scan and you pointer [Re: PriNova] #407368
09/12/12 02:36
09/12/12 02:36
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
"your" ist just an alias for "You". Changing this won't change anything.

What exactly is your problem, dd231? What does "not working" mean? Does it crash? Doesn't the you entity get invisible?

Please use code tags when posting code...


Always learn from history, to be sure you make the same mistakes again...
Re: c_scan and you pointer [Re: Uhrwerk] #407369
09/12/12 05:06
09/12/12 05:06
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
What do you want to achieve with this code?

Last edited by Ch40zzC0d3r; 09/12/12 05:06.
Re: c_scan and you pointer [Re: Ch40zzC0d3r] #407412
09/12/12 14:53
09/12/12 14:53
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
btw...if iam right c_ignore must be used with 0 at its end fex
Code:
c_ignore(1,3,0);



But except of that i dont see the problem too.

Last edited by rayp; 09/12/12 14:53.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: c_scan and you pointer [Re: rayp] #407474
09/13/12 14:53
09/13/12 14:53
Joined: Jun 2009
Posts: 26
D
dd231 Offline OP
Newbie
dd231  Offline OP
Newbie
D

Joined: Jun 2009
Posts: 26
Thanks for responding to all who did!

I want the entities whose player assign is different from one another to turn invisible. When the "you" pointer is set and the player assign is the same for both entities I want the you pointer to clear so the scan will find a entity with a different player assign. I noticed that if the you pointer is set when both entities have the same player assign it will not re-assign the you pointer so it can find an entity with a different player assign. That is what I am trying to achieve. However, just yesterday I upgraded my 8A version from 8.30 to 8.40 and now c-scan is giving me even more problems... LOL what a bad day to quit smoking!!! At least I am occupied wink

Re: c_scan and you pointer [Re: dd231] #407476
09/13/12 15:00
09/13/12 15:00
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
If i unterstood you right...
I think c_scan will always set YOU to nearest entity found. But u want to check further entitys right? Maybe this thread helps you.

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Main=48405&Number=405484#Post405484

Edit: Or react in a event to the c_scan fex
Code:
void _i_was_scanned()
{
 if(event_type == EVENT_DETECT || event_type == EVENT_SCAN)
  if(my.player_assign == 1) //or if(you)if(you.anything == my.anything) whatever
   set(my,INVISIBLE);
}
..
action Whatever()
{
 ..
 my.emask |= ENABLE_SCAN|ENABLE_DETECT; //maybe scan is enough dont know right now.
 my.event = _i_was_scanned;
 ..
}


Last edited by rayp; 09/13/12 15:21.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: c_scan and you pointer [Re: rayp] #407480
09/13/12 15:46
09/13/12 15:46
Joined: Jun 2009
Posts: 26
D
dd231 Offline OP
Newbie
dd231  Offline OP
Newbie
D

Joined: Jun 2009
Posts: 26
Thank you rayp! By doing it my way I was making the you pointer set to whatever entity it detected and not the entity I wanted it to detect. By setting it up in an event_detect it won't set the you pointer until it finds an entity with the skill I assigned. Thank you for replying so fast!!!

Page 1 of 2 1 2

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