Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
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
2 registered members (AndrewAMD, Ayumi), 838 guests, and 2 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
problem , action #366154
04/01/11 18:11
04/01/11 18:11
Joined: Aug 2010
Posts: 131
Iran
Mafia_IR Offline OP
Member
Mafia_IR  Offline OP
Member

Joined: Aug 2010
Posts: 131
Iran
hi guys ,
i wrote a very simple code for a coin , but there is no action ...
look at my code :

Quote:

action coin ()
{
while(1)
{
my.pan += 5 ;
my.tilt += 5 ;
if (my.event == ENABLE_IMPACT)
{
counter_var += 1 ;
beep() ;
ent_remove(me);
}
wait(1);
}
}


i used this code but i saw no action too ...
if (my.event == ENABLE_IMPACT && you == player)

what is problem ?

smile

Re: problem , action [Re: Mafia_IR] #366155
04/01/11 18:12
04/01/11 18:12
Joined: Aug 2010
Posts: 131
Iran
Mafia_IR Offline OP
Member
Mafia_IR  Offline OP
Member

Joined: Aug 2010
Posts: 131
Iran
and nothing for this also :

if (event_type == EVENT_IMPACT)

Re: problem , action [Re: Mafia_IR] #366179
04/01/11 20:09
04/01/11 20:09
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
You can call that (event_type == EVENT_IMPACT) only after collusion, look at the manual.
For making pickable coins, you better do something like this:
Code:
action coin()
{
   set(my,PASSABLE); // no collusions with player
   while(vec_dist(my.x,player.x) > 40) // while player is far than 40 quants
   {
      my.pan += 5 * time_step; // rotate coin
      wait(1); // increase this if you'll have problems with FPS
   }
   // if player is closer than 40 quants (while loop isn't true)
   coins += 1;
   wait(1);
   ent_remove(my);
}




Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: problem , action [Re: 3run] #366258
04/02/11 12:46
04/02/11 12:46
Joined: Aug 2010
Posts: 131
Iran
Mafia_IR Offline OP
Member
Mafia_IR  Offline OP
Member

Joined: Aug 2010
Posts: 131
Iran
so there is a question (because i in beginning of programing)... when the action is execution , compiler read the code line by line and this code

coins += 1;
wait(1);
ent_remove(my);


isn't read when loop is running ,right ?

Re: problem , action [Re: Mafia_IR] #366304
04/02/11 18:43
04/02/11 18:43
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Yeah, script will till while loop will end. Same for example if you do like this:
Code:
while(!player){wait(1);}

I guess you've seen this many times, this makes everything what below this line wait till player isn't created.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung

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