Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,631 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
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,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
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 | 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