Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ent_create #118420
03/20/07 14:43
03/20/07 14:43
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
When I create a sprite with;
Code:

string sign; // declare an empty, unlimited string

funtion blabla()
{
..............
str_cpy(sign," "); // make the string empty
str_cpy(sign,"abc.bmp"); // set sprite in sign
ent_create(sign,vector(x,y,z)); // place sprite on screen
..............
..............
}


that works perfect, but now I want to remove the sprite again because I want to create and show an other sprite in 'sign'.
I tried it with ent_remove, but that does not work, it has to be an entity.

Does anyone know how I can do that?


I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits
Re: ent_create [Re: Frits] #118421
03/20/07 14:51
03/20/07 14:51
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
ent_remove(ENTITY* entity).

You need a pointer to your sprite (entity).

Re: ent_create [Re: Frits] #118422
03/20/07 14:52
03/20/07 14:52
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
Quote:


Code:

string sign; // declare an empty, unlimited string
entity* to_delete;

funtion blabla()
{
..............
str_cpy(sign," "); // make the string empty
str_cpy(sign,"abc.bmp"); // set sprite in sign
to_delete =ent_create(sign,vector(x,y,z)); // place sprite on screen
..............
..............
}







later then just call ent_remove(to_delete);
hope this helps


Visit:
schwenkschuster-design.de
Re: ent_create [Re: aztec] #118423
03/20/07 15:15
03/20/07 15:15
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
Thanks guys for the quick response.
I changed the script in;
Code:

string sign; // declare an empty, unlimited string
entity* sign_sprite;

funtion blabla()
{
..............
ent_remove(sign_sprite); // remove previous sprite
str_cpy(sign," "); // make the string empty
str_cpy(sign,"abc.bmp"); // set sprite in sign
sign_sprite=ent_create(sign,vector(x,y,z)); // place sprite on screen
..............
..............
}


but then ofcource I get an error, because the entity is empty with the first call.
How can I check if the entity has a value?
(like with a var fisttime 'if(firsttime==0)' or something like that?)


I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits
Re: ent_create [Re: Frits] #118424
03/20/07 15:18
03/20/07 15:18
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
why do you delete something before you create it?


Visit:
schwenkschuster-design.de
Re: ent_create [Re: Frits] #118425
03/20/07 15:18
03/20/07 15:18
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
if(sign_sprite)
{
ent_remove(sign_sprite);
}

Re: ent_create [Re: Slin] #118426
03/20/07 15:33
03/20/07 15:33
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
Thanks Slin, I think I am working to long, not thinking straight anymore. How simple can the solution be.

Aztec, this is explained in my initial post, 'I want to remove the sprite again because I want to create and show an other sprite in 'sign'.
So, I can't set the ent_remove at the end of the function, first remove the previous and than create a new one.


I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits

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