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
Dang it. #250815
02/10/09 00:21
02/10/09 00:21
Joined: Sep 2008
Posts: 68
T
Tai Offline OP
Junior Member
Tai  Offline OP
Junior Member
T

Joined: Sep 2008
Posts: 68
Quote:
action player_action()
{
c_setminmax(my);
my.min_z += 4;
ent_gravity = 1.6;
player = my; // I'm the player
set (my, INVISIBLE); // no need to see player's model in 1st person mode
while (1)
{
handle_player_movement();
vec_set (camera.x, player.x); // use player's x and y for the camera as well
camera.z += 30; // place the camera 30 quants above the player on the z axis (approximate eye level)
camera.pan -= 5 * mouse_force.x; // rotate the camera around by moving the mouse
camera.tilt += 5 * mouse_force.y; // on its x and y axis
player.pan = camera.pan; // the camera and the player have the same pan angle
wait(1);
}
}


Gives a Error E1513: Crash in player_action.
Ugh.

Re: Dang it. [Re: Tai] #250828
02/10/09 03:06
02/10/09 03:06
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
try...

Code:
action player_action() 
{
player = me; // I'm the player
wait(1);
c_setminmax(me);
me.min_z += 4;
ent_gravity = 1.6;
set (me, INVISIBLE); // no need to see player's model in 1st person mode
while (1) 
{
handle_player_movement();
vec_set (camera.x, player.x); // use player's x and y for the camera as well
camera.z += 30; // place the camera 30 quants above the player on the z axis (approximate eye level)
camera.pan -= 5 * mouse_force.x; // rotate the camera around by moving the mouse
camera.tilt += 5 * mouse_force.y; // on its x and y axis
player.pan = camera.pan; // the camera and the player have the same pan angle
wait(1);
}
}


1) I would set the pointer at the beginning of the action.
2 c_setminmax should be changed at least 1 frame after the object creation.
3) me and my are the same, i just prefer me LOL.

Re: Dang it. [Re: DJBMASTER] #250836
02/10/09 05:26
02/10/09 05:26
Joined: Sep 2008
Posts: 68
T
Tai Offline OP
Junior Member
Tai  Offline OP
Junior Member
T

Joined: Sep 2008
Posts: 68
It appears the problem is within the pointer function. I'll take a look at it.

Re: Dang it. [Re: Tai] #250838
02/10/09 06:24
02/10/09 06:24
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Yeah, the templates use the "player" pointer rather than just "me"


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

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