Gamestudio Links
Zorro Links
Newest Posts
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
0 registered members (), 1,103 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
you #93535
10/07/06 21:01
10/07/06 21:01
Joined: Oct 2003
Posts: 246
A
Alberto Offline OP
Member
Alberto  Offline OP
Member
A

Joined: Oct 2003
Posts: 246
Hello

What is the use of the "You" pointer ?
Can you provide me with some examples ?
Thanks in advance

Re: you [Re: Alberto] #93536
10/07/06 21:48
10/07/06 21:48
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
YOU is modified by various commands such as:
c_scan, c_trace and so on.

If we take c_trace for example you points towards the entity hit by the trace-beam.

You can also use the YOU pointer to ignore certain entities.
Lets say you have a non-passable gun as level entity and are always reseting it to the players position.
It would certainly block the player when he performs any _move instruction (c_move, or ent_move)
So if you have a pointer to the gun "activ_gun" e.g. you
can store it into YOU and ignore it:
you = activ_gun;
c_move(my,move_dist,nullvector,ignore_you);

There are lots of possibilies for the use of YOU.

Re: you [Re: Xarthor] #93537
10/08/06 10:28
10/08/06 10:28
Joined: Oct 2003
Posts: 246
A
Alberto Offline OP
Member
Alberto  Offline OP
Member
A

Joined: Oct 2003
Posts: 246
Thanks
About c_trace
Do you mean that :
If the beam hit the entity than "you " switch from 0 to the entity pointer ?
I tried but "you" alwayes returns "0"
If so I am doing something wrong
I will try harder

Re: you [Re: Alberto] #93538
10/08/06 10:52
10/08/06 10:52
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
yes, lets say you want to trace from the player to a position at a certain distance infront of him to find out if there is an entity in the way:
Code:

function check_direction()
{
vec_set(temp,vector(1000,0,0));
vec_rotate(temp,player.pan);
vec_add(temp,player.x);

my = player; //set the my pointer to ignore the player
c_trace(player.x,temp.x,ignore_me);
if(you) { beep; } //an entity was hit, beep once
}

on_x = check_direction;


I have tested the code and it beeps, so it does work


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