Gamestudio Links
Zorro Links
Newest Posts
hello all
by jcl. 09/24/19 09:04
Right AssetsFix for trading Forex on IG?
by Andy60. 09/23/19 21:11
Converting fbx file to mdl7
by Dark_Light. 09/23/19 15:50
New system for Zorro S subscriptions
by jcl. 09/23/19 08:34
IG plugin initial release
by Andy60. 09/23/19 07:40
Any chance of PBR materials with A8?
by Dooley. 09/22/19 21:43
Levels, textures, etc for A8
by Dooley. 09/22/19 03:57
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
8 registered members (svenbob, Tamas, MatPed, Superku, kvm, jenGs, 3run, 1 invisible), 642 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Zylo, Hjuutgckk, Dark_Light, oxygenjoe, web20tpo
18292 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 14 of 14 1 2 12 13 14
Re: ShadeCEVO simple grass (OVERLAY) ? [Re: rayp] #472476
04/29/18 23:18
04/29/18 23:18
Joined: Jul 2008
Posts: 1,968
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 1,968
Germany
I faced a really strange thing. When adding entity Arrays to a shadeC Project, ull be hunted by strange randomly appearing bugs.

Its hard to explain, but already confirmed by 3run ( my example i uploaded ).

I made this example. Its basicly the std. example from shadeC with around 50 new lines.
In this example the c_move call makes the script Crash ( but only if its commented out WTF ). This is just one example of bug with Array in shadeC.
Without Arrays all works fine. And if you take the Array stuff out of shadec Project it also works.


https://www.file-upload.net/download-13105427/arrayBUGshadeC.rar.html

Code:
#define MAX_ENEMY   9999
#define MAX_ENEMY2   9999

var ENEMIES_TOTAL    = 0;
var ENEMIES_TOTAL2    = 0;

ENTITY* enemy_list  [MAX_ENEMY];
ENTITY* enemy_list2  [MAX_ENEMY2];


action actEnemy(){
	// ----------------------------------------------------------------------------------------------------------
	if (ENEMIES_TOTAL >= MAX_ENEMY) { ptr_remove(my); return; }
	enemy_list [ENEMIES_TOTAL] = my;
	ENEMIES_TOTAL++;
}
action actEnemy2(){
	// ----------------------------------------------------------------------------------------------------------
	if (ENEMIES_TOTAL2 >= MAX_ENEMY2) { ptr_remove(my); return; }
	enemy_list2 [ENEMIES_TOTAL2] = my;
	ENEMIES_TOTAL2++;
}

void updateNPC_both(){
	ENTITY* tempEnt;                           // instead of my/me were using tempEnt
	ENTITY* tempEnt2;                           // instead of my/me were using tempEnt
	int i = 0;                                 // the "itemindex" in the for cycle
	// ----------------------------------------------------------------------------------------------------------
	while (1){                                 // handle all enemys as long as... 
	   // -------------------------------------------------------------------------------------------------------


		for (i = 0; i < ENEMIES_TOTAL; i++){    // cycle through all enemys in array now
		   // ----------------------------------------------------------------------------------------------------
			// --- [ fill pointers ] ------------------------------------------------------------------------------
			// ----------------------------------------------------------------------------------------------------
			tempEnt   = enemy_list[i]; 
			tempEnt2  = enemy_list2[i]; 
                        if (tempEnt == NULL) continue;
                        if (tempEnt2 == NULL) continue;
                        if (tempEnt2.skill1 == 0) beep; // baam
                 }
                 wait (1);
           }
}

main.c:

updateNPC_both();
ent_create ("modela.mdl", vector (0,0,0), actEnemy);
ent_create ("modela.mdl", vector (0,0,0), actEnemy2);

This tiny contruct will Crash when u continue adding stuff, hard to explain.

edit:
I know the using of two arrays like i did in this example is shitty...anyway it should work.

Last edited by rayp; 04/30/18 00:16.

My entry...your exits
Zombies dont like pink glow slime, fact!
"We gonna rock down to electric avenue" "One way ... or anotha ..."
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
-=GOOGLE IS SKYNET=-
rayp.flags |= UNTOUCHABLE;
Re: ShadeCEVO simple grass (OVERLAY) ? [Re: rayp] #472479
04/30/18 08:56
04/30/18 08:56
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
try using dynamic memory allocation
Edit: or try increasing the nexus. to my knowledge the engine doesn't tell you s*** when it's full

Last edited by Kartoffel; 04/30/18 08:58.

POTATO-MAN saves the day! - Random
Re: ShadeCEVO simple grass (OVERLAY) ? [Re: Kartoffel] #472480
04/30/18 09:11
04/30/18 09:11
Joined: Jun 2007
Posts: 1,247
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,247
Hiporope and its pain
Hi,
I tried the downloadable example and it crashes because 'pos' and 'ang' are declared as 'VECTOR*' inside the loop of 'updateNPC_both' instead of 'VECTOR'. By the rest, it works fine here.


Re: ShadeCEVO simple grass (OVERLAY) ? [Re: txesmi] #472482
04/30/18 10:20
04/30/18 10:20
Joined: Jul 2008
Posts: 1,968
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 1,968
Germany
Oh man you are right...

edit:
what a stupid typo-mistake caused of the Long break. I cant believe...i rewrote the lines a 100 times...

Thanks for the time man!

Last edited by rayp; 04/30/18 10:30.

My entry...your exits
Zombies dont like pink glow slime, fact!
"We gonna rock down to electric avenue" "One way ... or anotha ..."
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
-=GOOGLE IS SKYNET=-
rayp.flags |= UNTOUCHABLE;
Page 14 of 14 1 2 12 13 14

Moderated by  Blink, Hummel, Superku 

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