Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by rayp. 07/11/26 18:10
Z9 getting Error 058
by madpower2000. 07/09/26 18:09
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 07/09/26 13:16
New Zorro version 3.11
by jcl. 07/06/26 06:56
Synthetic test data in Zorro
by jcl. 07/06/26 06:54
Parameter filename BUG
by walt_Schwarz. 07/02/26 15:36
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 6,353 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
impact with entity in order to change levels not working... #232755
10/23/08 17:52
10/23/08 17:52
Joined: Feb 2004
Posts: 71
Milky Way Galaxy...
JoeMama Offline OP
Junior Member
JoeMama  Offline OP
Junior Member

Joined: Feb 2004
Posts: 71
Milky Way Galaxy...
I have a code that is supposed to change the level to when I touch an entity. But when I go to touch the model I assigned the action to, nothing happens and it is as if the model is solid. Here is the code I am using. It is from the FPS tutorial by Grimber.

function level_change()
{
wait(1);
if (EVENT_TYPE == event_impact)
{
changeto_level = my.skill1;
my = NULL;
vec_set(temp_loc,player.x);
vec_set(temp_ang,player.pan);
camera.visible = off;
freeze_mode = 1;
if (changeto_level == 1)
{
changeto_level = 0;
level_load("Out.wmb");
}
if (changeto_level == 2)
{
changeto_level = 0;
level_load("B.wmb");
}
freeze_mode = 0;
wait(2);
vec_set(player.x,temp_loc);
vec_set(player.pan,temp_ang);
camera.visible = on;
}
}

ACTION levelchange //*assign this to a map entity blocking the way out of the level*/!!!!
{

MY.INVISIBLE = ON; //makes entitie invisible
MY.ENABLE_IMPACT = ON; //enables player impact
MY.EVENT = level_change; //function name

}


If death is only the beginning, then life must be the end... -me
Re: impact with entity in order to change levels not working... [Re: JoeMama] #233784
10/30/08 17:06
10/30/08 17:06
Joined: Jul 2008
Posts: 2,113
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,113
Germany
Try this! I think events need actions not functions

Code:
ACTION level_change //i think this must be an action
{
wait(1);
if (EVENT_TYPE == event_impact)
{
changeto_level = my.skill1;
my = NULL;
vec_set(temp_loc,player.x);
vec_set(temp_ang,player.pan);
camera.visible = off;
freeze_mode = 1;
if (changeto_level == 1)
{ 
changeto_level = 0;
level_load("Out.wmb");
}
if (changeto_level == 2)
{
changeto_level = 0;
level_load("B.wmb");
}
freeze_mode = 0;
wait(2);
vec_set(player.x,temp_loc);
vec_set(player.pan,temp_ang);
camera.visible = on;
}
}

ACTION levelchange 
{
MY.INVISIBLE = ON; //makes entitie invisible
MY.ENABLE_IMPACT = ON; //enables player impact
MY.EVENT = level_change; //action name
}


Also i would change
Code:
IF (EVENT_TYPE==EVENT_IMPACT) {

to
Code:
IF (EVENT_TYPE==EVENT_IMPACT)&&(YOU!=NULL)&&(YOU==PLAYER) {

I use YOU!=NULL to avoid empty MY errors...but u dont need to.
Checks if the player "impacted" with entity, not a monster
or something. If u dont use player_walk (templates), add this to ure player code:
Code:
entity* player;
ACTION Player_Walk { //or whatever
...
..
PLAYER = ME;
}



Tip: Use BEEP to check if events are called.

Last edited by rayp; 10/30/08 17:23.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;

Moderated by  HeelX, rvL_eXile 

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