"effect_sprite()" causes engine crash

Posted By: DonaldThief

"effect_sprite()" causes engine crash - 08/10/13 17:49

I made a glass sprite entity, then attached the action "glass_action1" to it. After that, I wanted to make some glass breaking effect when the enemy shoots the glass (using "c_trace" weapon)......

I use "effect_sprite()" function to make the broken glass pieces ,but the engine crashes. Even I used "effect_sprite()" in many other small projects and the same problem occurs, the engine crashes


Here's my code (glass sprite is attached to "glass_action1"):


Code:
#include <particles.c>




function glass_broken(PARTICLE* glassy)
{
   vec_add(glassy.vel_x,vector(random(5)-2.5,random(5)-2.5,random(5)-2.5));
   vec_set(glassy.blue,vector(random(255),random(255),255));
   
   set(glassy, MOVE | BRIGHT | TRANSLUCENT);
   glassy.alpha = 100;
   glassy.size = 16-random(12);
   glassy.gravity = 0.2;
   glassy.alpha = 50;
   glassy.lifespan = 16;
   
   glassy.event = NULL;
}


function glass_shot()
{
	if(event_type == EVENT_SHOOT && (mouse_left) && (player_shooting) && (ammo[current_weapon] > 0) && (player_health > 0))
	{
   effect_sprite("glass_piece1.tga",glass_broken,20,my.x,nullvector);
   
   wait(1);
   ent_remove(my);
   }
}


action glass_action1()
{
	my.pan += 360;
   set(my,POLYGON);
   
   my.emask |= ENABLE_SHOOT;
   my.event = glass_shot;

	if(is(my,TRANSLUCENT) == 0) set(my,TRANSLUCENT);
	my.alpha = 50;
}






ThanQ for reading
Posted By: Arrovs

Re: "effect_sprite()" causes engine crash - 08/10/13 20:40

at moment only what i could think of is, you here making 20 pieces every frame if you here making trace to that object. Try to put variable in glass skill for letting it break once.

But now i see wait statement and ent_remove. hard to tell if ent_remove is terminating all other functions as it could happen there is function in next frame which tries to do same thing.

So make skill for breaking. In event you will set my.broken = true <-- or anything like that and destroy it from action. Put there while(my != NULL) cycle or so which will check moment when it needs to create sprite effect and destroy himself.

Just fast ideas - possibly it helps. If that not helps then problem could be in effect_sprite. Easy way to check that is to comment that line and see what happens.
Posted By: Uhrwerk

Re: "effect_sprite()" causes engine crash - 08/11/13 00:20

You forgot about:
Originally Posted By: Manual
The emulated particle function (func) looks almost like a normal particle function, but some particle-specific parameters and flags are replaced by entity skills skill60..69 and FLAG7 : vel_x/y/z => _VEL_X/Y/Z; gravity => _GRAVITY; size => _SIZE; lifespan => _LIFESPAN; you => _CREATOR; MOVE => _MOVE . BEAM and STREAK are not supported.

http://www.conitec.net/beta/particles_c.htm
Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/11/13 10:10

Ok, but I have for this function a sprite of size 64x64 pixels and I even set the _SIZE to 800 ,even though, the sprite is simply as small as a dot!! And it doesn't move....
Posted By: Uhrwerk

Re: "effect_sprite()" causes engine crash - 08/11/13 12:35

Please post your corrected code.
Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/11/13 17:02

Here's my corrected code


Code:
function glass_broken(PARTICLE* glassy)
{
	VECTOR temp;
	
	vec_randomize(temp.x,2);
   vec_add(glassy._VEL_X,temp.x);
   
   set(glassy, _MOVE | BRIGHT | TRANSLUCENT);
   glassy.alpha = 100;
   glassy._SIZE = 800;
   glassy._GRAVITY = 0.2;
   glassy.alpha = 50;
   glassy._LIFESPAN = 16*2;
   
   glassy.event = NULL;
}


function glass_shot()
{
	if(event_type == EVENT_SHOOT && (mouse_left) && (player_shooting) && (ammo[current_weapon] > 0) && (player_health > 0))
	{
   effect_sprite("glass_piece1.tga",glass_broken,20,player1.x,nullvector); //The download link for "glass_piece.tga" is lying below
   
   wait(1);
   ent_remove(my);
   }
}


action glass_action1()
{
	my.pan += 360;
   set(my,POLYGON);
   
   my.emask |= ENABLE_SHOOT;
   my.event = glass_shot;

	if(is(my,TRANSLUCENT) == 0) set(my,TRANSLUCENT);
	my.alpha = 50;
}





And here's a download link for the glass piece sprite ("galss_piece1.tga"):

I'm the download link!... Click me!!
Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/12/13 11:57

Must I include another file?
Posted By: PadMalcom

Re: "effect_sprite()" causes engine crash - 08/12/13 12:58

A missing include is not causing a crash but a compiler error. What I would do now:

- Remove line by line of grass_shot. E.g. start with:

Code:
function glass_shot()
{
  beep();
}



then add:

Code:
function glass_shot()
{
  if(event_type == EVENT_SHOOT)
  {
    beep();
  }
}



And so on. This is called debugging wink

Next step would be to read the manual which says that all pointers are only valid until the next wait call. What you do is
that you call a wait(1); and then the ent_remove(me) but the "me" might be empty or point to another entity already. So try to
save your me pointer in a temporaty pointer and call a delete on that one.
Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/12/13 19:00

Originally Posted By: PadMalcom
A missing include is not causing a crash but a compiler error. What I would do now:




OK. I don't have a crash here ,the crash problem was solved ,now the problem changed....



Originally Posted By: PadMalcom


- Remove line by line of grass_shot. E.g. start with:

Code:
function glass_shot()
{
  beep();
}



then add:

Code:
function glass_shot()
{
  if(event_type == EVENT_SHOOT)
  {
    beep();
  }
}



And so on. This is called debugging wink


I know this method and I'll see that....

But.....



Originally Posted By: PadMalcom


Next step would be to read the manual which says that all pointers are only valid until the next wait call. What you do is
that you call a wait(1); and then the ent_remove(me) but the "me" might be empty or point to another entity already. So try to
save your me pointer in a temporaty pointer and call a delete on that one.




That's not the problem of course and I have to put the wait(1) instruction before calling ent_remove(me) so that no crash happens

In the manual: http://www.conitec.net/beta/engineerrors.htm

Look at warning W1511
Posted By: PadMalcom

Re: "effect_sprite()" causes engine crash - 08/12/13 20:42

Yes, I know why you put a wait there and it is correct. What I mean is, that the me pointer might not longer be pointing on your glass object after the wait(1). It might already point to the next entity or nowhere.

Does your code work when you comment the line with the "effect_sprite"? Since you said you know how to debug I'm sure that it does(?).
Posted By: rayp

Re: "effect_sprite()" causes engine crash - 08/12/13 20:48

Btw. as far as i know, its not good to remove an entity in its event. I would do it this way
Code:
function glass_shot()
{
   if(event_type == EVENT_SHOOT && (mouse_left) && (player_shooting) && (ammo[current_weapon] > 0) && (player_health > 0))	
	{
   effect_sprite("acti.bmp",glass_broken,20,myplayer.x,nullvector); //The download link for "glass_piece.tga" is lying below
   my.skill100 = 1;
   }
}


action glass_action1()
{
	my.pan += 360;
   set(my,POLYGON);
   
   my.emask |= ENABLE_SHOOT;
   my.event = glass_shot;

	if(is(my,TRANSLUCENT) == 0) set(my,TRANSLUCENT);
	my.alpha = 50;
	while (!my.skill100) wait (1);
        wait (1);
	ptr_remove (me);
}

Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/14/13 17:57

@rayp I did that ,but the bug still exists.....
Posted By: PadMalcom

Re: "effect_sprite()" causes engine crash - 08/15/13 06:41

Please tell us in which line (exactly) the error occurs.
Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/15/13 11:25

This engine is dumb and stupid!!....Look at Unity 3D or ShiVa 3D or any other engine ,you'll see a real GAME ENGINE!!...The only reason I chose this retarded game engine is that I was tricked by many people ,but now I realised that THAT IS A DUMB ENGINE WITHOUT TUTORIALS, WITHOUT SPECIAL FEATURES ,WITHOUT ADVANCED DEBUGGING OR ERROR REPORTING!!.......


Posted By: Ch40zzC0d3r

Re: "effect_sprite()" causes engine crash - 08/15/13 11:40

lol look at your code and tell me whos the dumb "thing" here laugh
I dont even think you COULD use the debugging functions provided by other engines.
Ah and there is one thing I wanted to tell you...
Uhm... Unity.... is for RETARDS LIKE YOU.
I hope you have fun c&ping other retarded peoples scripts and adding them to your all loving interface wink
Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/15/13 11:59

@Ch40zzC0d3r I'll prove you are an idiotic creature......

My code is normal ,idiot. It is your fuckin' engine that is a mothe'fucke' less than 6-year-old kids game maker ,and for retards only!! You know that ,but ignorants like you will never admit it!! Give me an example for a wide spread game made by it!!

You don't even know how to talk ,idiot! And Unity is the best ,RETARDED. Look at the no. of its users and the number of the users of this fuckin' engine!



Posted By: Ch40zzC0d3r

Re: "effect_sprite()" causes engine crash - 08/15/13 12:32

Yes its the number of people who actually cant code laugh
Also I dont know any popular games made with unity.
Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/15/13 12:37

Originally Posted By: Ch40zzC0d3r
Yes its the number of people who actually cant code laugh


Really?! Do you even believe that?!! LOL!!!


Originally Posted By: Ch40zzC0d3r
Also I dont know any popular games made with unity.


Look at these:

- Need For Speed World
- Tiger Woods PGA Tour
- Wolf Quest
- Global Conflicts


I won't say GTA or Call of Duty made by it!! What's wrong with you ,people?!!

Just walk in the streets and ask anyone in the street: Do you know 3D Gamestudio? The answer will be: what the f*ck are you talking about?!!

Then ask him about Unity 3D ,the answer will be: F*CK YOU!!....You want to see if I know Unity or not?!! EVERYBODY KNOWS IT!!

And you CAN NOT deny that Unity is Popular but your engine is fuckin' unknown!!!


Even the people in charge in these forums are retarded!! I haven't been banned yet!!!
Posted By: Ch40zzC0d3r

Re: "effect_sprite()" causes engine crash - 08/15/13 12:47

The people are not online. Most of the people are inactive.
The nice thing in gamestudio is how fast you can build a simple game to test your ideas and realize them.
Quote:
I won't say GTA or Call of Duty made by it

Oh, you think they are made with unity?
Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/15/13 12:54

Originally Posted By: Ch40zzC0d3r

Quote:
I won't say GTA or Call of Duty made by it

Oh, you think they are made with unity?


I don't mean that ,dumb!!! I mean don't expect I say GTA or Call of Duty are made with it!!

Simpler explanation for idiots: Unity is not so powerful like that!...but you know what ,with a pro team ,Unity can make games like them!! I am confident of that!
Posted By: PadMalcom

Re: "effect_sprite()" causes engine crash - 08/15/13 13:02

Donald, I asked you several times to determine the line of code that is not working. You didn't respond, so how should we help you? Not even the mighty Unity will prevent you from doing beginners mistakes. Furthermore, if you want us to help you professionally, you should be professional, too, and watch your language.
Posted By: Ch40zzC0d3r

Re: "effect_sprite()" causes engine crash - 08/15/13 13:02

You think CoD engine is "powerful" ?
lol.
Posted By: rayp

Re: "effect_sprite()" causes engine crash - 08/15/13 13:26

Another guy, not able to code in such an simple language then complaining about the engine, shouting at people who want to help. Go to unity, no one will miss you here.
Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/15/13 14:52

@PadMalcom you are very polite ,but I used all methods to debug and I couldn't find that line


@Ch40.... or whatever (even your name says you're retarded) Yes, mothe'fucke'!...CoD engine is powerful. What the f*ck r u arguing about?

@rayp I can't code because of one thing: there are no tutorials for this dumb engine except 25 basics-of-the-basics workfucks and a sick AUM....
You can code 'cause you keep sitting in front of your PC for ages till your ass becomes as huge as a blue whale and learn stuff from scattered tuts. I need ages to be even a little more than beginner 'cause it's a dumb engine
Posted By: rayp

Re: "effect_sprite()" causes engine crash - 08/15/13 14:58

Quote:
I can't code because of one thing: there are no tutorials for this dumb engine except 25 basics-of-the-basics workfucks and a sick AUM....
You can code 'cause you keep sitting in front of your PC for ages till your ass becomes as huge as a blue whale and learn stuff from scattered tuts. I need ages to be even a litter more than beginner 'cause it's a dumb engine
Thats what we call "learning process". Maybe i stand infront of my pc ? Thought of that ? How old are you btw ? I guess 13, while reading your kiddish posts. All in all a very poor show.

greets
Posted By: Superku

Re: "effect_sprite()" causes engine crash - 08/15/13 14:59

I didn't want to post in this thread as I've apparently already wasted too much time trying to help you in your previous threads, however I want to tell you only a few words that most likely reflect your current and many other future issues you will encounter in game design and even life: You are the problem.
Posted By: Ch40zzC0d3r

Re: "effect_sprite()" causes engine crash - 08/15/13 15:23

1. The CoD engine received its last real update
on the 10th of November 2009.
and do you know why? Because Im hacking that damn game since CoD4 which used QuakeEngine. I dont have to update classes, I dont have to update ANY addresses I dont have to do ANYTHING my hack works for all CoD games since 2009!!!
Doesnt seem that powerful, they just use some nice EyeCandy Shaders.....
2. I dont get you. Making your own game means learning to know the engine functions and workflow and not register on the forum, asking for help and raging about your missing knowledge about programming. Or is it like register on the forum and expecting to c&p code and get your own AAA game?
Posted By: PadMalcom

Re: "effect_sprite()" causes engine crash - 08/15/13 16:07

@DonaldThief: What country are you from? Maybe we can point you to some tutorials in your language.
Posted By: rayp

Re: "effect_sprite()" causes engine crash - 08/15/13 16:33

After that thread i only would point him to the logout button.
Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/15/13 21:31

@rayp You may stand in front of your PC? Maybe you sleep while standing ,like horses ,it's the same thing. And if this thread is "kiddish" as you say ,why did you get your WISE GROWN UP ass into it seeing it and putting replies? You'll point me to the logout button? LOL. It has been hours and the people in charge of this forum didn't ban me yet!! I told you, you all are retarded!!!


@Superku I am the problem? Why do you always talking about your PRECIOUS HOLY time? Do you have a mental problem? What do you do in it? LOL!! You know that this engine is not good ,and I think you needed over 10 years to master it and at the end, you can't make a good game for an individual developer. I bet you!


@Mr. retarded/ Ch40....bla bla bla

I have to ask for help in the forum 'cause there is no other place to learn from. I said that before. THERE ARE NO G-O-O-D TUTORIALS FOR THIS PATHETIC ENGINE. Even the YouTube video tutorials, most of them are in GERMAN as if it is an international language!!


@PadMalcom you're the best and the most polite guy I've ever seen. I am sorry ,just for you, if I was aggressive against you in my previous posts. And there's no need to find tutorials as I won't work with that engine again


Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/16/13 03:18

FUCK THIS RETARDED ENGINE!
Posted By: Ch40zzC0d3r

Re: "effect_sprite()" causes engine crash - 08/16/13 07:23

Haha how I love it that you cant bring up any arguemnts against me but call me a retard laugh
I think my current knowledege is more then you will ever have in your whole life wink
And now close this topic please, I have anough from this little kid which is too dump to code in Lite-C. I hope unity will show you how helpless and retarded you are!
Posted By: rayp

Re: "effect_sprite()" causes engine crash - 08/16/13 14:53

Quote:
Maybe you sleep while standing ,like horses
You know what horses have ? A huge and long * ^^
Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/16/13 15:40

@Ch40.....why do you choose a code for ur name? Whatever! Listen, you dumb, do you even know who I am? Do you think me insulting this engine means that I can't code in that dumb language? LOL!! You all say I am a kid, ok. If I am a kid you idiot, why do you put replies? Just ignore this thread! I am doing this just for fun!! You all are in a big trick, believe me. If you've got HUGE experience (I think you're 10000 years old if I will never reach your knowledge in my whole life!) ,and probably know much about this engine and Lite-C (even it's not a popular language) beside other languages, do you believe that this piece of shit called 3DGS is something you can spend time thinking about learning it? I bet you! You are tricked!! And if you've got any cohones, tell me who you are and where you work......


wait a minute I can give a pic of a guy similar to you....



LOL!!...


AND I'LL NEVER STOP POSTING IN THIS THREAD UNTIL THIS FORUM BAN MY ACCOUNT ,'CAUSE I REALLY LOVE THE FACT THAT I CAN STILL POST AFTER INSULTING YOU! LOL! I'VE NEVER SEEN SUCH A FORUM!!


@rayp Yeah, it's got such a huge one, but your one may be cut off 'cause you don't deserve it!! LOL!!
Posted By: rayp

Re: "effect_sprite()" causes engine crash - 08/16/13 16:29

Your parents are proud for sure. ^^
Posted By: DonaldThief

Re: "effect_sprite()" causes engine crash - 08/16/13 16:34

...and rayp, you look like this.....




LOL!!

Why do all of you think I am a kid? You are retard!! I like harrassing people and watch their reactions! That's all!!

BTW, just a hint: if you left me without replying, I'll get bored and leave this thread, but your keeping putting these replies makes me continue!....
© 2023 lite-C Forums