Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how???? #65694
03/07/06 08:15
03/07/06 08:15
Joined: Nov 2005
Posts: 38
games
dewipatch Offline OP
Newbie
dewipatch  Offline OP
Newbie

Joined: Nov 2005
Posts: 38
games
hi
How do you click on an entity and it becomes me?

Re: how???? [Re: dewipatch] #65695
03/07/06 08:25
03/07/06 08:25
Joined: Apr 2005
Posts: 3,815
Finland
Inestical Offline
Rabbit Developer
Inestical  Offline
Rabbit Developer

Joined: Apr 2005
Posts: 3,815
Finland
use events.

function click_event
{
if(my.event == event_click)
{
<entitypointer> = player; // I quess you mean that you can start controlling it..
}
}

function entityfunc
{
my.enable_click = on; //I'm not sure about this. I don't have my manual here..
my.event = click_event;
..rest of the code here
}


"Yesterday was once today's tomorrow."
Re: how???? [Re: Inestical] #65696
03/07/06 13:06
03/07/06 13:06
Joined: Mar 2005
Posts: 527
Netherlands
RJDL Offline
Developer
RJDL  Offline
Developer

Joined: Mar 2005
Posts: 527
Netherlands
Quote:

function entityfunc
{
my.enable_click = on; //I'm not sure about this. I don't have my manual here..
my.event = click_event;
..rest of the code here
}




shouldn't this be an action, when it's to be assigned to an object?

Re: how???? [Re: RJDL] #65697
03/07/06 14:51
03/07/06 14:51
Joined: Apr 2005
Posts: 3,815
Finland
Inestical Offline
Rabbit Developer
Inestical  Offline
Rabbit Developer

Joined: Apr 2005
Posts: 3,815
Finland
lol yeah xD hey, I was at school. I was tired. But I quess ye got the idea


"Yesterday was once today's tomorrow."
Re: how???? [Re: Inestical] #65698
03/07/06 16:45
03/07/06 16:45
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline
Expert
FoxHound  Offline
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
Actully no. Action and funciton mean the same thing. An action will come up on your list in WED when assighning to a model. You can manually type in the name of a funciton though.

As much as I know, you can't call an action any other way except to make a model in WED or to use "ent_create". But I've never tried this.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: how???? [Re: FoxHound] #65699
03/10/06 17:43
03/10/06 17:43
Joined: Nov 2005
Posts: 38
games
dewipatch Offline OP
Newbie
dewipatch  Offline OP
Newbie

Joined: Nov 2005
Posts: 38
games
This is what I tried and it doesn't work.
Anyone know why?
Code:
  entity* cube;

function code_test ()
{

cube = player;
if (cube == player){

if (key_w ==1){

my.z +=5;
}

if (key_a == 1){

my.x +=5;
}
}
}

action cheese
{
while (1)
{

my.enable_click = on;
if (my.event == event_click){
code_test();
}
wait (1);
}
}



Re: how???? [Re: dewipatch] #65700
03/10/06 18:45
03/10/06 18:45
Joined: Aug 2005
Posts: 199
houston
S
seneca Offline
Member
seneca  Offline
Member
S

Joined: Aug 2005
Posts: 199
houston
Try this out this should work for you....




entity* cube; // you only need this line if you do not plan to use
// a model already existing in the level. I.E. A model
// you that you would create at runtime.


function code_test ()
{

if (EVENT_TYPE == EVENT_click)
{
me = player;
}

while(1)
{

if (key_w ==1)
{
my.z +=5;
}end if key w
if (key_a == 1)
{
my.x +=5;
}// end if key a

}// end while 1
}// end function

action cheese // assign this action to the cube of your choose.
{

my.enable_click = on;
my.event == code_test;
}


a8 commercial
Re: how???? [Re: seneca] #65701
03/10/06 19:55
03/10/06 19:55
Joined: Nov 2005
Posts: 38
games
dewipatch Offline OP
Newbie
dewipatch  Offline OP
Newbie

Joined: Nov 2005
Posts: 38
games
it sais there is an empty/unknown pointer when I compile that

Re: how???? [Re: dewipatch] #65702
03/10/06 20:35
03/10/06 20:35
Joined: Sep 2005
Posts: 357
Florida
Hellcrypt Offline
Senior Member
Hellcrypt  Offline
Senior Member

Joined: Sep 2005
Posts: 357
Florida
try it now

entity* cube; // you only need this line if you do not plan to use
// a model already existing in the level. I.E. A model
// you that you would create at runtime.


function code_test ()
{

if (EVENT_TYPE == EVENT_click)
{
me = player;
}

while(1)
{

if (key_w ==1)
{
my.z +=5;
}end if key w
if (key_a == 1)
{
my.x +=5;
}// end if key a

}// end while 1
}// end function

action cheese // assign this action to the cube of your choose.
{

my.enable_click = on;
my.event = code_test;
}


I do not solve problems.... I prevent them.

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