Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,089 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[help] ent_clone crashes, on lite-C free version #268505
05/29/09 18:16
05/29/09 18:16
Joined: Apr 2002
Posts: 117
Spain
Abstracto Offline OP
Member
Abstracto  Offline OP
Member

Joined: Apr 2002
Posts: 117
Spain
Hi, im trying to make a puzzle game,
im using lite-C free, version 1.70

im getting a message box that says "Crash on mover1",
when i try to clone an entity, and then modify any attibute of the cloned entity.
Can anybody tell me what is wrong?


this is the code:
Code:

//------------------------------------------------------------------------------
// test_clone.c
//------------------------------------------------------------------------------
#include <acknex.h>
#include <default.c>


action mover1()
{
	
	while(1)
	{
		my.y+=time_step;
		wait(1);
	}
}


void main()
{
	level_load("sueloenraya.hmp");
	ENTITY* e1;
	ENTITY* e2;
	e1=ent_create("bola_simple32.mdl",vector(0,0,20),mover1);
	e2=ent_cloneskin(e1);
	e2.z=40;
	
	while(1)
	{
		wait(1);
	}
	
}


The level and the model e1 are ok. When i clone the entity, nothing happens, but when i try to modigy e2.x, a message box appears "Crash in mover1"

Thanks!

Re: [help] ent_clone crashes, on lite-C free version [Re: Abstracto] #268547
05/29/09 22:14
05/29/09 22:14
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
try either
Code:
e1=ent_create("bola_simple32.mdl",vector(0,0,20),mover1);
wait(1);
e2=ent_cloneskin(e1);
e2.z=40;
or
Code:
e1=ent_create("bola_simple32.mdl",vector(0,0,20),mover1);
e2=ent_cloneskin(e1);
wait(1);
e2.z=40;


It MAY be a timing issue where you are
A> trying to clone the entity before it is fully created.
or
B> trying to adjust the properties of a cloned object before the clone process is complete.

I have seen this on large, complex, big-texture models before.
But there seems to be no real pattern.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: [help] ent_clone crashes, on lite-C free version [Re: EvilSOB] #268617
05/30/09 09:58
05/30/09 09:58
Joined: Apr 2002
Posts: 117
Spain
Abstracto Offline OP
Member
Abstracto  Offline OP
Member

Joined: Apr 2002
Posts: 117
Spain
ouf, i found my error.
ent_clone doesn't returns a entity pointer, it just modifies the entity parameter so it gets its own texture and mesh,


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