Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 831 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Question on ENABLE_IMPACT #295645
10/26/09 17:15
10/26/09 17:15
Joined: Sep 2009
Posts: 22
Boca Raton, Florida
M
MarcsVision Offline OP
Newbie
MarcsVision  Offline OP
Newbie
M

Joined: Sep 2009
Posts: 22
Boca Raton, Florida
i would like to have my users transfer to a new level when it hits object "blip". i have the script as:

action blip ()
{
my.ENABLE_CLICK = ON;//when users hits blip
my.event = load_race;//user goes to race level
}

function load_race ()
{
wait (1);
level_load ("dragrace1.wmb");
}

but for some reason i get a syntax error in MAIN in the line my.ENABLE_IMPACT = ON;
those any one see a problem that im missing?
-----------------------------------------------------
Also, i was told to place "me = null" in the top of my level function. what those me = null do?

Thank you!

Re: Question on ENABLE_IMPACT [Re: MarcsVision] #295650
10/26/09 18:17
10/26/09 18:17
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
E
Enduriel Offline
Member
Enduriel  Offline
Member
E

Joined: Aug 2008
Posts: 133
Sweden, Stockholm
Taken from the manual, this is how you define EVENTS:

Code:
// The following example shows how to use events for an object that flies ahead until it collides with a block or entity.
// The event function then plays a collision sound and lets the object ricochet from the surface. 


function bounce_event() 
{
  switch (event_type)
  {
    case EVENT_BLOCK:
      ent_playsound(my,whamm,50);   
      vec_to_angle(my.pan,bounce); // change direction
      return;
    case EVENT_ENTITY: 
      ent_playsound(my,boingg,50);  // play a different sound
      vec_to_angle(my.pan,bounce); // change direction
      return;
  }
}  

action bounceball() 
{
  my.emask |= (ENABLE_BLOCK | ENABLE_ENTITY); // make entity sensitive for block and entity collision
  my.event = bounce_event;
  while(1)
  {
    c_move(me,vector(5*time_step,0,0),nullvector,0); // move ahead until obstacle is hit
    wait(1);
  }
}



so change your my.ENABLE_CLICK = ON to my.emask |= ENABLE_CLICK

Re: Question on ENABLE_IMPACT [Re: Enduriel] #295663
10/26/09 19:23
10/26/09 19:23
Joined: Sep 2009
Posts: 22
Boca Raton, Florida
M
MarcsVision Offline OP
Newbie
MarcsVision  Offline OP
Newbie
M

Joined: Sep 2009
Posts: 22
Boca Raton, Florida
That work perfect. thanks alot

Re: Question on ENABLE_IMPACT [Re: MarcsVision] #295673
10/26/09 20:10
10/26/09 20:10
Joined: Sep 2009
Posts: 22
Boca Raton, Florida
M
MarcsVision Offline OP
Newbie
MarcsVision  Offline OP
Newbie
M

Joined: Sep 2009
Posts: 22
Boca Raton, Florida
What does "me = null;" script do for the function?

Re: Question on ENABLE_IMPACT [Re: MarcsVision] #295698
10/26/09 23:03
10/26/09 23:03
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

Here's a quote from the manual to that effect wink

Quote:

Functions assigned to or called by entities - that means all functions in which the my pointer is not zero - are automatically terminated at their next wait call. All other functions in which my is zero, such as the main() function, will keep running and won't change, even if a different script was assigned in WED to the new level.





Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C

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