Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Joey, flink, AndrewAMD), 1,226 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
open/close door #285810
08/20/09 10:33
08/20/09 10:33
Joined: Jan 2009
Posts: 57
Slovakia
wolodo87 Offline OP
Junior Member
wolodo87  Offline OP
Junior Member

Joined: Jan 2009
Posts: 57
Slovakia
Hello, i have little scripting issue. I would like to make script, that will open the door, when the player comes near them and close it, when player goes further away from them.
I am trying to use event EVENT_TRIGGER but I am not successfull.
The second quesion is: can I manipulate with entities, which I place with WED other way than through actions? For example by name or something like that?

Re: open/close door [Re: wolodo87] #285818
08/20/09 11:14
08/20/09 11:14

C
chris_oat
Unregistered
chris_oat
Unregistered
C



are u using lite-C or c-scripts (wdl) ??

Re: open/close door [Re: wolodo87] #285819
08/20/09 11:20
08/20/09 11:20
Joined: Jan 2009
Posts: 57
Slovakia
wolodo87 Offline OP
Junior Member
wolodo87  Offline OP
Junior Member

Joined: Jan 2009
Posts: 57
Slovakia
lite-c

Re: open/close door [Re: wolodo87] #285820
08/20/09 11:30
08/20/09 11:30

C
chris_oat
Unregistered
chris_oat
Unregistered
C



ok. if u want a door that opens wen the player is near. i wound not take trigger. i would try it like this:

Code:
action door_1() // attach this action to an entity at you want as door

{
while (!player) {wait (1);} // wait until the player is loaded
while (vec_dist (player.x, my.x) > 100)  // wait until the player comes close to this entity
       {
       wait (1);        
       }
       dosomethinghere(door); // here ur function that rotates the door, do ur put u change here already ur doors pan.
}



PS: But i highly recommend u read the AUMs, starting at #67. its really helpful.

Last edited by chris_oat; 08/20/09 11:31.
Re: open/close door [Re: wolodo87] #285827
08/20/09 12:52
08/20/09 12:52
Joined: Jan 2009
Posts: 57
Slovakia
wolodo87 Offline OP
Junior Member
wolodo87  Offline OP
Junior Member

Joined: Jan 2009
Posts: 57
Slovakia
yep. It helped a little bit. Than I had an idea and used something like this:

action open_bar_door()
{
while (1)
{
if(vec_dist (hrac.x, my.x) < 200)
{
my.skill1+=7*time_step;
ent_animate(my,"open",my.skill1,NULL);
}
else
{
my.skill1-=7*time_step;
ent_animate(my,"open",my.skill1,NULL);
}

if(my.skill1>=100)
my.skill1=100;
if(my.skill1<=0)
my.skill1=0;

wait (1);
}
}

But the idea was your. I am ashamed that hadnt found out this alone laugh
Thanks for advice.


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