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
2 registered members (AndrewAMD, TipmyPip), 12,420 guests, and 5 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
Empty Pointer ?? #224371
08/29/08 19:37
08/29/08 19:37
Joined: Dec 2004
Posts: 35
Germany
F
Fanatiker Offline OP
Newbie
Fanatiker  Offline OP
Newbie
F

Joined: Dec 2004
Posts: 35
Germany
Hallo, ich wollte ein Bewegungsskript schreiben aber musste mich bereits nach ein paar Zeilen geschlagen geben, weil ich keine Logik dahinter sehe und mich das Online tutorial nicht retten konnte.

Es gibt 2 C-Dateien, in der main ist fast nichts los, die spieler.c ist , wo sich alles abspielt.

Mein Problem, immer wenn ich das Spiel starte und entweder a oder d drücke kommt folgende Fehlermedlung: Empty Pointer

Aber wo um Gottes Willen verwende ich da einen Pointer außer denm Me-Pointer ??

und noch was. was ist diese "mtlFX.c" Datei, Wenn ich ein neues C-Lite Projekt starte, steht das immer drin, aber ich kann sie bei mir nirgends finden.

Ich bitte um Hilfe,

Code:
///////////////////////////////
#define PRAGMA_PATH "%EXE_DIR%\templates\images";
#define PRAGMA_PATH "%EXE_DIR%\templates\models";
#define PRAGMA_PATH "%EXE_DIR%\templates\sounds";

#include <acknex.h>
#include <default.c>
//#include "mtlFX.c"
#include	"player.c"
///////////////////////////////



function main()
{
	level_load("main.WMB");
	wait(2);
	//printf("Press [0] to move the camera!");
}


Code:

var walk_percentage;

function move()
{
	c_move(me,vector((key_a - key_d) * 5 * time_step,0,0),NULL,GLIDE);	
	ent_animate(me, "walk", walk_percentage, ANM_CYCLE); 									
   walk_percentage += (key_a - key_d) * 10 * time_step; 															
}



action spieler()
{	
	
	camera.x = 1000; // halte d. Kamera 300 Quants hinter d. Ball
	camera.y = 400; // verwende dasselbe y wie mit d. Ball
	camera.z = 200; // und plaziere sie bei z = 1000 Quants
   camera.pan = 180;
	
	while(1)
	{
		if(key_d == 1)move();
		if(key_a == 1)move();
		wait(1);
	}	
}



Mit freundlichen Grüßen

fanatiker

Last edited by Fanatiker; 08/29/08 19:42.
Re: Empty Pointer ?? [Re: Fanatiker] #224377
08/29/08 20:02
08/29/08 20:02
Joined: Aug 2003
Posts: 7,440
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,440
Red Dwarf
Quote:
var walk_percentage;

function move()
{
c_move(player,vector((key_a - key_d) * 5 * time_step,0,0),NULL,GLIDE);
ent_animate(player, "walk", walk_percentage, ANM_CYCLE);
walk_percentage += (key_a - key_d) * 10 * time_step;
}



action spieler()
{
player = me;

camera.x = 1000; // halte d. Kamera 300 Quants hinter d. Ball
camera.y = 400; // verwende dasselbe y wie mit d. Ball
camera.z = 200; // und plaziere sie bei z = 1000 Quants
camera.pan = 180;

while(1)
{
if(key_d == 1)move();
if(key_a == 1)move();
wait(1);
}
}



"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Empty Pointer ?? [Re: Michael_Schwarz] #224380
08/29/08 20:18
08/29/08 20:18
Joined: Dec 2004
Posts: 35
Germany
F
Fanatiker Offline OP
Newbie
Fanatiker  Offline OP
Newbie
F

Joined: Dec 2004
Posts: 35
Germany
hi, thanks for your answer but that would not solve the problem.

It is this line

Code:
c_move(me,vector((key_a - key_d) * 5 * time_step,0,0),NULL,GLIDE);


i changed NULL to nullvector and now my movement works well.

i hate mistakes like that because the acknex engine accept this although it is not correct lite c.

fanatiker


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