Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 831 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
E1513 fehler? #434373
12/17/13 16:30
12/17/13 16:30
Joined: May 2008
Posts: 113
Italien, Südtirol, Naturns
P
Patrick92 Offline OP
Member
Patrick92  Offline OP
Member
P

Joined: May 2008
Posts: 113
Italien, Südtirol, Naturns
hallo

Ich möchten eine kanonen kugel abschiessen die von der schwerkraft beeinflust wird und die dann nach gewisser zeit verschwindet aber sobalt ich denn ent_remove(me) benutzte kommt der fehler E1513(soweit ich weis ist das der fehler das er was löschen will was nicht existiert aber die kugel seh ich ja fliegen also existierst sie ja?)

hier mein code[code]
var high;


function sh()
{
my.emask |= ENABLE_ENTITY;
my.event = bounce_event; //macht querschläger

vec_set(my.x,camera.x);
vec_set(my.pan,camera.pan);
my.skill1 = 80;
while(1)
{

c_move(my,vector(my.skill1*time_step,0,0),vector(0,0,-9.1*time_step),IGNORE_PASSABLE+IGNORE_ME+IGNORE_MODELS);
my.skill1 -= 0.5*time_step;
high = my.z;
if(my != NULL)
{
if(my.skill1 < 0)
{

ent_remove(me);


}
}
wait(1);
}
}

//in der function zum erstellen der kanonen kugel steht das
if(key_lastpressed == 57)
{
ent_create("shoot.mdl",camera.x,sh);

key_lastpressed = 0;
}

/code]

danke im voraus für eure hilfe

Re: E1513 fehler? [Re: Patrick92] #434374
12/17/13 16:33
12/17/13 16:33
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
...
while(me)
...
wait(1);
ent_remove(me);
...

Re: E1513 fehler? [Re: Ch40zzC0d3r] #434376
12/17/13 16:53
12/17/13 16:53
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
What I normally do is the following:

action dummy()
{
...
my.skill1 = 5*16; // 5 seconds
while(my.skill1 > 0)
{
...
my.skill1 -= time_step;
wait(1);
}
effect...
ptr_remove(me);
}

Then you can easily use events (for impact detection and the like) where you set skill1 to 0.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: E1513 fehler? [Re: Superku] #434377
12/17/13 17:02
12/17/13 17:02
Joined: May 2008
Posts: 113
Italien, Südtirol, Naturns
P
Patrick92 Offline OP
Member
Patrick92  Offline OP
Member
P

Joined: May 2008
Posts: 113
Italien, Südtirol, Naturns
danke jetzt funktionierts

Re: E1513 fehler? [Re: Patrick92] #434385
12/17/13 20:29
12/17/13 20:29
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Did return become uncool or what's up with that?

Edit: Also, every sane compiler will optimize the `if(my != NULL)` away because it can safely assume it's not NULL since you've already used the pointer previously. Not vouching for the Lite-C compiler here, but yeah, it's highly superfluous.

Last edited by JustSid; 12/17/13 20:40.

Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: E1513 fehler? [Re: WretchedSid] #434386
12/17/13 20:44
12/17/13 20:44
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
Did return become uncool or what's up with that?

If you deal with objects in a game (world), then yes. It's always better (at least from my experience) to let the entity function end at it's last bracket where it oftentimes gets removed and plays death animations, effects and or sounds before that (and after its main loop).


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

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