Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Grant, AndrewAMD), 911 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Crash in... can´t fix it.. #218495
07/29/08 00:11
07/29/08 00:11
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
ok..
this is the action:
Code:
action titelheld()
{
	Titel_ent = my;
	my.x = 0;
	my.y = 11280;
	my.z = 0;
	my.pan = 90;
}


It just sais, "Crash in Titelheld()"

Any idea what´s wrong??


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Crash in... can´t fix it.. [Re: Espér] #218560
07/29/08 08:55
07/29/08 08:55
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
Code:
action titelheld()
{
        wait(3); // in some cases i needed to put that
	Titel_ent = my;
	my.x = 0;
	my.y = 11280;
	my.z = 0;
	my.pan = 90;
}




Ubi bene, ibi Patria.
Re: Crash in... can´t fix it.. [Re: croman] #218579
07/29/08 11:19
07/29/08 11:19
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
No.. don´t work...

Here´s the complete code..
perhaps it causes somewhere else..:
Click to reveal..

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include "shader.c"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var speed = 1;
var numbers = 0;
var prozentgeber = 1.0;
var intro_part_1_ende = 0;
var remover = 0;

ENTITY* Titel_ent;
ENTITY* schrift;
ENTITY* schrift2;
ENTITY* schrift3;
ENTITY* starry;

BMAP* titeltextstring = "leer.tga";

PANEL* titeltextpan =
{
	pos_x = 0;
	pos_y = 680;
	layer = 100;
	bmap = titeltextstring;
	flags = VISIBLE;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

action titelheld()
{
	wait(3);
	Titel_ent = my;
	my.x = 0;
	my.y = 11280;
	my.z = 0;
	my.pan = 90;
	my.material = Normal_mapping;
}

action nouncers()
{
	my.pan = -90;
	my.tilt = 360;
	my.roll = 0;
	my.x = Titel_ent.x;
	my.z = Titel_ent.z;
	while(Titel_ent.y >= 2500)
	{
		if((Titel_ent.y + 1000) <= my.y)
		{
			my.scale_y -= 0.5*time_step;
			my.scale_x -= 0.5*time_step;
			my.scale_z -= 0.5*time_step;
		}
		wait(1);
	}
	ent_remove(my);
}

action titelschrift()
{
	schrift = my;
}
action titelschrift2()
{
	schrift2 = my;
}
action titelschrift3()
{
	schrift3 = my;
}
action star_x()
{
	while(1)
	{
		if(intro_part_1_ende == 1){my.y -= (2*prozentgeber)*time_step;}
		wait(1);
	}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function texter()
{
	while(Titel_ent.y >= (-8300))
	{
		if(Titel_ent.y <= (-3900))
		{
			if(Titel_ent.y >= (-4000)){titeltextstring = "TXT_1.tga";}
			if(Titel_ent.y >= (-5000)){titeltextstring = "TXT_2.tga";}
			if(Titel_ent.y >= (-6000)){titeltextstring = "TXT_3.tga";}
			if(Titel_ent.y >= (-7000)){titeltextstring = "TXT_4.tga";}
			if(Titel_ent.y >= (-8000)){titeltextstring = "TXT_5.tga";}
			if(Titel_ent.y <= (-8200)){titeltextstring = "leer.tga";}
		}
		wait(1);
	}
}

function camcontroll()
{
	while(1)
	{
		if (key_cul == 1){Titel_ent.pan += 10*time_step;}
		if (key_cur == 1){Titel_ent.pan -= 10*time_step;}
		if (key_r == 1){Titel_ent.pan = 90;}
		if (key_shiftl == 1){speed = 3;}
		if (key_shiftl == 0){speed = 1;}
		wait(5);
	}
}

action galaxy()
{
	my.pan = Titel_ent.pan;
	my.tilt = random(360);
	my.roll = random(360);
	my.flags |= (BRIGHT | PASSABLE);
	while(1)
	{
		if(intro_part_1_ende == 1){my.y -= (2*prozentgeber)*time_step;}
		wait(1);
	}
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//            KAMERA SETUP
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function camera_setting()
{
	camera.x    = Titel_ent.x;   // X
	camera.y    = Titel_ent.y;       // Y
	camera.z    = Titel_ent.z;               // Höhe
	camera.pan  = Titel_ent.pan;     // Zum Spieler drehen
	wait(1);
}

function starter()
{
	texter();
	while(Titel_ent.y >= -11000)
	{
		Titel_ent.y -= 20*time_step;
		wait(1);
	}
	while(Titel_ent.y >= -12000)
	{
		Titel_ent.y -= 20*time_step;
		if(Titel_ent.x != -176){Titel_ent.x -= 2*time_step;}
		if(Titel_ent.z != 64){Titel_ent.z += 1*time_step;}
		schrift2.y = schrift.y + 50;
		schrift3.y = -11860;
		wait(1);
	}
	while(Titel_ent.y >= -13000)
	{
		Titel_ent.y -= 20*time_step;
		schrift2.y = schrift.y + 50;
		schrift3.y = -11860;
		wait(1);
	}
	while(Titel_ent.y >= -13650)
	{
		Titel_ent.y -= (20*prozentgeber)*time_step;
		if(prozentgeber >= 0.1){prozentgeber *= 0.98;}
		schrift2.y = schrift.y + 50;
		schrift3.y = -11860;
		wait(1);
	}
	prozentgeber = 0.5;
	wait(1);
	while(schrift.y <= 13000)
	{
		intro_part_1_ende = 1;
		schrift.y += (2*prozentgeber)*time_step;
		schrift.alpha -= 0.2*prozentgeber;
		schrift.scale_y -= 0.5*prozentgeber;
		schrift.scale_x -= 0.5*prozentgeber;
		
		schrift2.y += (2*prozentgeber)*time_step;
		schrift2.alpha -= 0.2*prozentgeber;
		schrift2.scale_y /= 1.1*prozentgeber;
		
		schrift3.y += (2*prozentgeber)*time_step;
		schrift3.alpha -= 0.2*prozentgeber;
		
		prozentgeber *= 1.02;
		wait(1);
	}
	schrift.y = 14000;
	schrift2.y = 14050;
	wait(-5);
	sys_exit("Titeltest ende!");
}

function randomstars()
{
	while(numbers <= 700)
	{
		var zufall = random(400);
		if (zufall <= 50)
		{
			ent_create("Star_01.tga",vector((-5600+(random(11200))),(-5600+(random(11200))),(-4000+(random(8000)))),star_x);
			numbers += 1;
		}
		if (zufall >= 50 && zufall <= 100)
		{
			ent_create("Star_02.tga",vector((-5600+(random(11200))),(-5600+(random(11200))),(-4000+(random(8000)))),star_x);
			numbers += 1;
		}
		if (zufall >= 100 && zufall <= 380)
		{
			ent_create("Star_03.tga",vector((-5600+(random(11200))),(-5600+(random(11200))),(-4000+(random(8000)))),star_x);
			numbers += 1;
		}
		if (zufall >= 398)
		{
			ent_create("Star_04.tga",vector((-5600+(random(11200))),(-5600+(random(11200))),(-4000+(random(8000)))),galaxy);
			numbers += 1;
		}
		wait(1);
	}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function main()
{
	fps_max = 60;
	video_mode = 7;
	level_load("Titel_Hauptmenü.WMB");
	wait(2);
	while(key_l ==0)
	{
		wait(1);
	}
	starter();
	randomstars();
	camcontroll();
	camera.tilt = 0;
	camera.roll = 0;
	while(1)
	{
		camera_setting();
		wait(1);
	}
}




EDIT:
Problem is greater.. if i delete the Titelheld() action, the next action gives the same crash..


.

Last edited by xXReapeRXx; 07/29/08 11:24.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Crash in... can´t fix it.. [Re: Espér] #218591
07/29/08 12:43
07/29/08 12:43
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Are you sure the shader.c is totaly correct?


Click and join the 3dgs irc community!
Room: #3dgs
Re: Crash in... can´t fix it.. [Re: Joozey] #218593
07/29/08 12:51
07/29/08 12:51
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
the problem came up before i added the shader.c ...
but here is it:
Code:
MATERIAL* heldenshader_1 =
{
	flags = ENABLE_RENDER;
	effect = "s_P_cartoon.fx";
}

MATERIAL* Hitzewelle =
{
	flags = TANGENT;
	effect = "s_P_heatHaze.fx";
}

MATERIAL* Normal_mapping =
{
	effect = "normalmap.fx";
}



Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Crash in... can´t fix it.. [Re: Espér] #218597
07/29/08 13:12
07/29/08 13:12
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Wait, you first wait 3 ticks and then assign the me to Titel_ent. But the nouncers() action gets already loaded and makes use of Titel_ent before you assigned it. Since you only declared an empty pointer (without the = NULL at definition) it will result in a crash.

I always declare my variables with a default value, e.g. ENTITY* Titel_ent = NULL; to prevent crashes. And you should build in a while (Titel_ent == NULL) {wait(1);} check too in nouncers().



Click and join the 3dgs irc community!
Room: #3dgs
Re: Crash in... can´t fix it.. [Re: Joozey] #218598
07/29/08 13:16
07/29/08 13:16
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
wait.. plz in a normal language and a bit slower again ^^
I´m german.. so i don´t understand every gramatical sentence you write ^^.. sry

I edited my Script to:

ENTITY* Titel_ent = NULL;
ENTITY* schrift = NULL;
ENTITY* schrift2 = NULL;
ENTITY* schrift3 = NULL;
ENTITY* starry = NULL;


to that while thing..
The Titelheld() and the beginning of Nouncer() are only played once..
not more... just one time..

Last edited by xXReapeRXx; 07/29/08 13:21.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Crash in... can´t fix it.. [Re: Espér] #218615
07/29/08 14:18
07/29/08 14:18
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
But no crash?

Quote:
The Titelheld() and the beginning of Nouncer() are only played once..
not more... just one time..

Well yeah it's logic that it's only run once. The Titelheld() is not in a loop, so it only is performed one time.

The nouncers() while or if branch probably do not match the conditions (Titel_ent.y + 1000) <= my.y) But I don't know what the values are for that 'my' entity. If it is only ran once and then removed, then obviously it did not stay in the while/if loop.


Last edited by Joozey; 07/29/08 14:25.

Click and join the 3dgs irc community!
Room: #3dgs
Re: Crash in... can´t fix it.. [Re: Joozey] #218636
07/29/08 16:28
07/29/08 16:28
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
ok.. got it..
just a wait in nouncer()´s beginning fixed.. thank s ^^


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<

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