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
3 registered members (NewbieZorro, TipmyPip, 1 invisible), 19,045 guests, and 8 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
Page 3 of 3 1 2 3
Re: Script Crash [Re: Uhrwerk] #411558
11/17/12 17:22
11/17/12 17:22
Joined: Nov 2011
Posts: 139
India
Yashas Offline OP
Member
Yashas  Offline OP
Member

Joined: Nov 2011
Posts: 139
India
I am getting some error telling "illegal indirection".
Now what??


Keep smiling laugh
http://translation.babylon.com/ - Translate many languages
Re: Script Crash [Re: Yashas] #411560
11/17/12 17:26
11/17/12 17:26
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
can you post a small example of your code, please?

@Uhrwerk, then I did something wrong when I tried it...


POTATO-MAN saves the day! - Random
Re: Script Crash [Re: Yashas] #411563
11/17/12 17:27
11/17/12 17:27
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Now we have to look into our crystal balls to give you advide unless you post the code fragment that causes this error.

As a general rule, Yashas, if you've got a problem please post the error message if any and the code that is causing the problem. In the best case it is a SSCCEE. The more information you provide, the more likely someone can help you.

http://sscce.org/


Always learn from history, to be sure you make the same mistakes again...
Re: Script Crash [Re: Uhrwerk] #411605
11/18/12 05:28
11/18/12 05:28
Joined: Nov 2011
Posts: 139
India
Yashas Offline OP
Member
Yashas  Offline OP
Member

Joined: Nov 2011
Posts: 139
India
Code:
void SpeedRun_GoGoGo ()
{
	BMAP * SpeedRun_TEMP;
	int SpeedRun_i = integer(random(6));
	int SpeedRun_Row = 1;
	int SpeedRun_Trys = 0;
	int SpeedRun_Wrong = 0;
	SpeedRun_TEMP = SpeedRun_Shapes[SpeedRun_i];
	SpeedRun_Previous = SpeedRun_i;
	
	pan_setwindow(SpeedRun_ControlsPlaying,1,200,150,200,200,SpeedRun_TEMP,200,200);
	pan_setstring(SpeedRun_ControlsPlaying,4,-100,-100,"",str_create(""));
	pan_setbutton(SpeedRun_ControlsPlaying,1,0,-100,-100,bmap_create("button1.tga"),bmap_create("button1.tga"),bmap_create("button1.tga"),NULL,NULL,NULL,NULL);
	*SpeedRun_Time = 60;
	SetTimer (SpeedRun_Time,1,NULL);
	while(SpeedRun_Time != 0)
	{
		if(key_cur)//Same
		{
			if(SpeedRun_Previous == SpeedRun_i)
			{
				//Correct
				//AddUserXP(2);
				SpeedRun_Score += 5 * SpeedRun_Row;	
				SpeedRun_Row++;
			}
			else
			{
				//Wrong	
			}
		}
		else if (key_cul) //Not Same
		{
			if(SpeedRun_Previous == SpeedRun_i)
			{
				//Wrong	
			}
			else
			{
				//Correct	
			}
		}
		wait(1);
	}
}



When I compile:

Error in 'line 1899:
illegal indirection
< *SpeedRun_Time = 60; >
.. 0.214 sec
Error compiling LINTEX.DATA.BANK.GAMES.SPEEDRUN.C
Error E355: Startup Failure - any key to abort


Keep smiling laugh
http://translation.babylon.com/ - Translate many languages
Re: Script Crash [Re: Yashas] #411627
11/18/12 12:27
11/18/12 12:27
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
It does not do that on my end, when I add the required global variables. Please post your declaration of SpeedRun_Time.

Btw. once again there is a memory leak in your code. Every time you call this function three bitmaps vanish into the void.


Always learn from history, to be sure you make the same mistakes again...
Re: Script Crash [Re: Uhrwerk] #411639
11/18/12 14:42
11/18/12 14:42
Joined: Nov 2011
Posts: 139
India
Yashas Offline OP
Member
Yashas  Offline OP
Member

Joined: Nov 2011
Posts: 139
India
I got it fixed!!!
I was playing ** and so but forgot to roll back to *.

Fixed!!!

And about memory leak:
I should "sys_free(TEMP);" at the end of the function, Am I right??
That wud fix it I fell??


Keep smiling laugh
http://translation.babylon.com/ - Translate many languages
Re: Script Crash [Re: Yashas] #411643
11/18/12 14:55
11/18/12 14:55
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
What is temp? If you're talking about SpeedRun_TEMP i doubt that this is a good idea. This will remove random bitmaps from the array.

I was talking about the three "bmap_create("button1.tga")". It's not only that you create three bitmaps where one would suffice, it's also that you create these bitmaps every time the function gets called. After calling it 1.000 times you will have 997 unused bitmaps in memory that are irrevertably lost and cannot be freed by anything else than closing the engine.


Always learn from history, to be sure you make the same mistakes again...
Re: Script Crash [Re: Uhrwerk] #411651
11/18/12 15:30
11/18/12 15:30
Joined: Nov 2011
Posts: 139
India
Yashas Offline OP
Member
Yashas  Offline OP
Member

Joined: Nov 2011
Posts: 139
India
I used to get Invalid Argument when I used to set the bitmap paramter in pan_setbutton to NULL.Hence I did bmap_create.

So what if I create a BMAP * abc = bmap_createblack (..) and use it as parameters(Actually I want to hide that button grin ) and sys_free at the end of the game


Keep smiling laugh
http://translation.babylon.com/ - Translate many languages
Re: Script Crash [Re: Yashas] #411653
11/18/12 15:38
11/18/12 15:38
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
It does not matter if you create them statically or with bmap_create or bmap_createblack. The point is that you should create the bitmap ONE time. As long as you don't want to get rid of it prematurely you don't even need to free it at the end of the game. The engine will take care of that for you.


Always learn from history, to be sure you make the same mistakes again...
Page 3 of 3 1 2 3

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