Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 10/25/26 03:42
Chat Room for Zorro Programmers
by Haitao_Ren. 10/25/26 03:14
Trading Journey
by Haitao_Ren. 10/25/26 03:14
Algorithmic trading course with Zorro
by Haitao_Ren. 10/25/26 03:12
Zorro tutorial ideas?
by Haitao_Ren. 10/25/26 02:47
Zorro plugin for Hyperliquid.xyz
by mayarik. 10/24/26 09:14
Tradestation missing in table of contents
by AndrewAMD. 10/23/26 14:35
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, JeyKey II), 8,843 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Haitao_Ren, JimSimons, julienp, julienper, KelleyAbbey
19247 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
"Too many Functions" - Error #290982
09/22/09 18:29
09/22/09 18:29
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
Hi,

I have a problem: When I compile my script it says "Too many functions"..How could that be? I saw much more complex games and they don't hat that problem. I have about 10-14 functions, mostly actions for entites that are moving....Can yiu help me?

Thanks

Liam


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: "Too many Functions" - Error [Re: Liamissimo] #290998
09/22/09 20:08
09/22/09 20:08
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Check your code, maybee you call a function from a loop every frame and this function have also loops with a wait(x).

You can see the count of running functions in the Debug Panel (F11).

Re: "Too many Functions" - Error [Re: Liamissimo] #291002
09/22/09 20:22
09/22/09 20:22
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
Code:
///////////////////////////////////////////////////////////////

#include <acknex.h>
#include <default.c>
#include <mtlFX.c>;

///////////////////////////////////////////////////////////////
VECTOR ball_speed; // Ein Vektor für die Geschwindigkeit des Balles.
var tuer_oben = 0;
var boost_ball = 0;
var springen = 0;
var transporter_weg = 0;
ENTITY* drehende_kugel;
ENTITY* transporter;
ENTITY* ball; // Unser Ball als Objekt bestimmt
ENTITY* laser_strahler;
ENTITY* tuer;
ENTITY* rotoren;
STRING* r_blick_str = "R - VOGELPERSPEKTIVE(HALTEN)";
STRING* springen = "SPACE - Springen";
STRING* esc_str = "ESC - SCHLIESSEN"; //Der Platzhaltertext für Deppen damit die wissen wie sie es schliessen.
TEXT* quit_txt = //Ein neuer Text wird gemacht, mit dem oberen String
{ 
    pos_x = 15; 
    pos_y = 15;
    layer = 1; //Unterster Layer
    font =  Arial#20b; //Schriftkonfiguration
    string (esc_str, r_blick_str, springen); //Der Text ist der Text vom String Esc...
    flags = SHOW; //Und man soll es ja auch sehen können!
}
action transporter_1()
{
	transporter = me;
	while(1)
	{
		if (transporter_weg != 800)
		{
			wait(-4);
			while(transporter_weg != 800)
			{
				me.x += 1;
				transporter_weg += 2;
				wait(1);
			}
		}
		if (transporter_weg == 800)
		wait(-4);
		{
			while(transporter_weg != 0)
			{
				me.x -= 1;
				transporter_weg -= 2;
				wait(1);
			}
		}
		wait(1);
	}
	
}
action rotoren()
{
	while(1)
	{
		rotoren = my;
		my.pan += 1;
		wait(1);
	}
}
PANEL* Normal_pan =
{
	pos_x = 0;
	pos_y = 0;
	layer = 1;
	digits(30,30,4,*,1,transporter_weg);
	button(800,0, "clicked.bmp", "notclicked.bmp", "over.bmp", easy(), NULL, NULL);
	flags = OVERLAY | SHOW;
}
action rotating_lasers()
{
	laser_strahler = my;
	while(1)
	{
		my.pan += 1;
		wait(1);
	}
}
function tuer_open()
{
	if (tuer_oben != 400)
	{
		while(tuer_oben <= 400)
		{
			c_move(me, vector(0,0, 5 * time_step), nullvector, 0);
			tuer_oben += 5;
			wait(1);
		}
	}
	if (tuer_oben == 405)
	{
		wait(-5);
		while(tuer_oben != 5)
		{
			c_move(me, vector(0,0,-5 * time_step), nullvector, 0);
			tuer_oben -= 5;
			wait(1);
		}
	}

}
action rotating_sphere()
{
	drehende_kugel = my;
	while(1)
	{
		my.tilt += 2;
		my.pan += 6;
		my.roll += 3;
		wait(1);
	}
}
function schneller()
{
	while(mouse_left == 1)
	{
		ball_speed.x = 50 * (key_d - key_a); //Wir multipizieren 25 mit der Diferernz aus Taste d und a
		ball_speed.y = 50 * (key_w - key_s); //Dasselbe mit w und d
		phent_addtorqueglobal (ball, ball_speed);
		wait(1);
	}
	
}
action tuer_act()
{
	tuer = my;
	my.emask |= (ENABLE_IMPACT | ENABLE_PUSH);
	my.event = tuer_open;
}


function easy()
{

}
action jump()//Die Aktion heisst jump
{
	if (springen != 1)
	{
		ph_setgravity(vector(0,0,450));//Und damit man nach oben kommt, zieht einen die "Schwerkraft(jetzt erher Leichtkraft) schnell nach oben
		wait(-0.5);//Doch damit es nicht zu hoch geht hört es nach 50 FPS wieer auf, also fast die hälfte da FPS Max bei 60 liegt. Halbe Sekunde also;)
		ph_setgravity(vector(0,0,-500));//Und schneller als normal gehts wieder runter..
		springen = 1;
		wait(-1.5);
		springen = 0;
	}
}

function blick()//Die Funktion um von oben zu blicken wird gestartet
{
	while(key_r) //Solange also "r" gedrückt ist...
	{
		camera.z = ball.z + 1400;//Geht die Kamera nach oben
		camera.tilt = -90;//Neigt sich mehr zur Erde...
		camera.x = ball.x;//Und bleibt mit dem Ball auf einer x Achse, also hat ihn immer im Bild.
		wait(1);//Und damit alles nur in einem Bild abläuft ein wait(1), sonst würde versucht werden ALLES in nur ein Bild zu packen was halt nicht geht.
	}
}
function quit()//Die Fuktion zum schliessen
{
	sys_exit("");//sys(tem)_exit...Erklärt sich ja von selbst, diesmal wird WINDOWS angesprichen um das Fenster zu schliessen.
}
function main()//Hauptfunktion, darin ist das wichtigste zum Starten
{
	video_mode = 8;
	nexus = 20000;
	level_load("Basis_lvl.wmb");//Lade mein tolles Level
	wait (-5);//Warte 5 Sekunden bis es fertig ist, nur zur Sicherheit.
	mouse_mode = 4;
 	ball = ent_create ("ball.mdl", vector(-1080, -130, 271), NULL); //Kreire unseren Ball und gebe ihm den Pointer ball, siehe auch oben ENTITY* ball
	ph_setgravity (vector(0, 0, -386)); // // Normale Erdanziehungskraft
	phent_settype (ball, PH_RIGID, PH_SPHERE); //Tut den Ball ins Physiksystem
	phent_setmass (ball, 3, PH_SPHERE);//Setzt die Masse und das es ein Ball ist
	phent_setfriction (ball, 60); //Und die Reibung unseres Freundes
	phent_setdamping (ball, 40, 40); //Sowie die Dämpfung
	phent_setelasticity (ball, 50, 20);//und die Elastizität, hier die mitte zwischen Flummi und Lehmkugel
	on_space = jump;
	on_mouse_left = schneller;
	on_r = blick;// Auf Taste R liegt nun also die Funktion Blick
	on_esc = quit;//Und auf ESC ligt die Aktion.....na was wohl;) quit
	while (1)//Solange 1 = 1 ist, also unendlich
	{
		ball_speed.x = 25 * (key_d - key_a); //Wir multipizieren 25 mit der Diferernz aus Taste d und a
		ball_speed.y = 25 * (key_w - key_s); //Dasselbe mit w und d
		phent_addtorqueglobal (ball, ball_speed);//Und nun sagen wir der Ball soll sich drehen um sich überhaupt fortzubewegen, und zwar mit unserer ball_speed Variable
		camera.x = ball.x - 200;//Kamera hnter dem Ball
		camera.y = ball.y;
		camera.z = ball.z + 600;
		camera.tilt = -60;
		wait (1);//Und bitte nicht alles in einem Bild machen wollen sondern immer das Bild erneueren
	}	

	
}



This is my code, yeah I have some infinite loops, I also augmented my nexus from 30 to 80 and 90 and 150 etc. But nothing changes...Thnaks for the reply


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: "Too many Functions" - Error [Re: Liamissimo] #291007
09/22/09 21:03
09/22/09 21:03
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
das sieht mir nach nem syntaxfehler aus, versuch das zu korrigieren:
Code:
if (transporter_weg == 800)
		wait(-4);
		{



naja, ist nicht alles gute programmierung, aber das sollte dann trotzdem laufen.

Re: "Too many Functions" - Error [Re: Scorpion] #291037
09/23/09 05:48
09/23/09 05:48
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Weird that you don't get an error regarding your function named "easy"
I thought empty functions throw an error. So if you still encounter one after fixing the bug Scorpion pointed out, you might want to add a simple wait(1); to the function easy.

Furthermore instead of using != for "not equal" you could (in this case) rather use < and > because you are increasing and decreasing a value.
It might not yet be "better" because you use a fixed value of 2 which is added and subtracted from your var, but note that this is not framerate independent programming.
On a more (or less) powerful computer the counting up and counting down might be faster (or slower).
As I don't know about your project, this might be trouble for the gameplay experience, hence I recommend using a value multiplied by time_step.
But if you do so, you have to use < and > (can also be <= and >=) for comparison. Because you may not reach the exact value of 0 or 800 (or whatever) if you multiply by time_step, thus create an endless running loop and crushing your game wink

Re: "Too many Functions" - Error [Re: Xarthor] #291048
09/23/09 07:08
09/23/09 07:08
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
empty functions are 100% valid, so that's okay =)

Re: "Too many Functions" - Error [Re: Scorpion] #291049
09/23/09 07:11
09/23/09 07:11
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
@Scorpion: Oh ok, good to know. Thanks!

Re: "Too many Functions" - Error [Re: Xarthor] #291100
09/23/09 12:44
09/23/09 12:44
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
Okay, thnaks, I know thr programming isn't that fine:D Still don't works, in the Help fron conitec the say I hsould increase the Nexus, defalut ist 30 but even If i set it up to 600 nothing changes....


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: "Too many Functions" - Error [Re: Liamissimo] #291106
09/23/09 13:06
09/23/09 13:06
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Another thing you could or rather should do:
Comment everything, and then uncomment step by step everything back in, and after each step run the program and check if the error occurs.
As soon as you get the error you know what might produce it, as its the last thing (or the last things) you uncommented back in.
So don't uncomment too much in one step.

Re: "Too many Functions" - Error [Re: Xarthor] #291114
09/23/09 13:38
09/23/09 13:38
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
the action rotoren killed it, i try if it works if is use another action isntead of "rotoren".


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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