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
1 registered members (AndrewAMD), 645 guests, and 4 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
Page 1 of 2 1 2
Empty Pointer #249259
02/01/09 14:27
02/01/09 14:27
Joined: Nov 2007
Posts: 13
Germany / Munich
V
V_Sola Offline OP
Newbie
V_Sola  Offline OP
Newbie
V

Joined: Nov 2007
Posts: 13
Germany / Munich
Hi, i wrote a code in which i used a Pointer that should tell my player-model to move on w

ENTITY* robot;


function move_ahead()
{
robot.x += 5;
}

function main()
{
video_switch (8,32,1);
level_load ("Drohne_Level.wmb");
on_w = move_ahead;
}


action Drohne()
{
robot = me;
}


, but after i had started the programm
evertime i pressed the engine only told me theres an empty Pointer.

Does anyone know what's my mistake?

Thanks in advance, v_sola.

Re: Empty Pointer [Re: V_Sola] #249262
02/01/09 14:31
02/01/09 14:31
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Try this instead! smile

Code:
function move_ahead()
{
	robot.x += 5;
}

function main()
{
	video_switch (8,32,1);
	level_load ("Drohne_Level.wmb");
	on_w = move_ahead;
}

action Drohne()
{
	robot = my;
}


Re: Empty Pointer [Re: Cowabanga] #249264
02/01/09 14:44
02/01/09 14:44
Joined: Nov 2007
Posts: 13
Germany / Munich
V
V_Sola Offline OP
Newbie
V_Sola  Offline OP
Newbie
V

Joined: Nov 2007
Posts: 13
Germany / Munich
I tried this but there's still the problem. Did i make anything wrong?

Re: Empty Pointer [Re: V_Sola] #249267
02/01/09 14:53
02/01/09 14:53
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Nothing is wrong in your code. What's your version?

Re: Empty Pointer [Re: Cowabanga] #249270
02/01/09 14:59
02/01/09 14:59
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Do you have an entity that has the action "Drohne" attached to it?

Re: Empty Pointer [Re: Cowabanga] #249271
02/01/09 14:59
02/01/09 14:59
Joined: Nov 2007
Posts: 13
Germany / Munich
V
V_Sola Offline OP
Newbie
V_Sola  Offline OP
Newbie
V

Joined: Nov 2007
Posts: 13
Germany / Munich
Gamestudio Commercial 7.07 ; SED version 7.06.1 . Did you mean that?

Last edited by V_Sola; 02/01/09 15:00.
Re: Empty Pointer [Re: V_Sola] #249273
02/01/09 15:02
02/01/09 15:02
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Update to A7.66, Then try this:

Code:
#include <acknex.h>

function move_ahead()
{
	robot.x += 5;
}

function main()
{
	video_switch (8,32,1);
	level_load ("Drohne_Level.wmb");
	on_w = move_ahead;
}

action Drohne()
{
	robot = my;
}


Re: Empty Pointer [Re: Cowabanga] #249275
02/01/09 15:17
02/01/09 15:17
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
error is "on_w = move_ahead;" part of the code. try with this instead "on_w" part:

while(1)
{
if(key_w) move_ahead;
wait(1);
}



Ubi bene, ibi Patria.
Re: Empty Pointer [Re: croman] #249278
02/01/09 15:30
02/01/09 15:30
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
I think Xarthor nailed it, when you get empty pointer, your action "Drohne" does not run so the pointer is not set, have you entered the Drohne action in WED for your robot model?

Re: Empty Pointer [Re: Spirit] #250039
02/05/09 17:04
02/05/09 17:04
Joined: Nov 2007
Posts: 13
Germany / Munich
V
V_Sola Offline OP
Newbie
V_Sola  Offline OP
Newbie
V

Joined: Nov 2007
Posts: 13
Germany / Munich
Sry but the problem still exists.

Does someone have a code which can move any model ?

thanks in advance, v_sola.

Page 1 of 2 1 2

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