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
problems with function call #11100
11/28/02 02:43
11/28/02 02:43

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



my question is, how can i open the door?

i tried to call a function, but i got a compiler error.

--thanks dan

entity* door_entry;
entity* player;

function open_entry_door() {

door_entry = ptr_for_name("door_enter_hall");
player = ptr_for_name("player1");

if (player.flag1 == 1) {
//open door
door_entry.slidedoor_event_z; //this function causes the compiler error
}

else {...}

}

Re: problems with function call #11101
11/28/02 03:01
11/28/02 03:01
Joined: Oct 2002
Posts: 471
USA - Tennessee
JayG Offline
Senior Member
JayG  Offline
Senior Member

Joined: Oct 2002
Posts: 471
USA - Tennessee
Check out the tutorial for the Monday Session called Doors and Keys

Re: problems with function call #11102
11/28/02 17:50
11/28/02 17:50

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



thanks,

but i dont want to open the door by a scan...
i have a keycard lock at the door. this is where this function belongs to.
i want to open the, when i have the right keycard. therefore i need a function call..

can someone help me with that?

Re: problems with function call #11103
11/28/02 22:58
11/28/02 22:58
Joined: Oct 2002
Posts: 471
USA - Tennessee
JayG Offline
Senior Member
JayG  Offline
Senior Member

Joined: Oct 2002
Posts: 471
USA - Tennessee
Yes, the second part of that tutorial, Keys explains how to check on a scan.

If you have to call it directly then set my to the proper entity and call the function, or pass the entity to the function. The function or action that an entiy runs in not attached to or part of the entity it is a global function.

For instance in your example something like this might work.

code:
  
entity* door_entry;
entity* player;

function open_entry_door()
{
door_entry = ptr_for_name("door_enter_hall");
player = ptr_for_name("player1");

if (player.flag1 == 1)
{
slidedoor_event_z(door_entry); //open door

}
}


}




Moderated by  HeelX, Spirit 

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