CEG Problems

CEG Problems

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

CEG Problems

Post by Erik »

Code: Select all

Killed()
{
 emit-sfx 1025 from main;
 emit-sfx 1026 from main; 
 // explode turret type FALL;  //fall off and bounce around!
}
gives an error while

Code: Select all

FireWeapon1()
{
    emit-sfx 1024 from muzzle1;
}
works fine

Unit def: (LUA)

Code: Select all

  sfxtypes            = {
    explosiongenerators = {
	  [[custom:Muzzleflash1]],
	  [[custom:Shell_impact]],
	  [[Custom:Blue_Death]],
    },
  },
what am i doing wrong?
On the death explosion it says "couldn't find CEG outside of script execution" or so.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: CEG Problems

Post by Tobi »

What about:

Code: Select all

FireWeapon1()
{
    emit-sfx 1025 from main;
}
and

Code: Select all

FireWeapon1()
{
    emit-sfx 1026 from main;
}
Do those work?

Also, copy and paste the error message exactly. That allows us to search for it in the engine source code.
User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: CEG Problems

Post by Erik »

lol funny
now that i changed the game crashes on spawing (its the start unit)
when i change it back it STILL crashes
so doing effectively nothing caused a different behavior WTF?
What is wrong with that stuff?

It seems to have to do with this:
Any errors in there?

Code: Select all

[Blue_Death] {
useDefaultExplosions = 0;
 [SMOKE1] {
    class=CSimpleParticleSystem;
		[properties]
		{
		alwaysVisible=1;
		Texture=blueexplosion;
		sizeGrowth=1.2;
		sizeMod=1.0;
       		 pos 		= r-3 r3, 1.5, r-3 r3;
       		 emitVector	= 0, 0, 0;
		gravity		= 0, 0, 0;
		colorMap	= 0.3 0.27 0.25 0.1  0 0 0 0.0; //1.0 0.5 0.0 0.01	0.5 0.4 0.3 1.0
		airdrag		= 0.9;
		particleLife=45;
		particleLifeSpread=13;
		numParticles=3;
		particleSpeed=0.5;
		particleSpeedSpread=0.2;
		particleSize=1.9;
		particleSizeSpread=0.6;
		emitRot=90;
		emitRotSpread=0;
		directional=1;
		useAirLos=0;
		}
        water=1;
	ground=1;
	air=1;
	count=1;
 } //smoke
[Groundflash]
{
flashsize=70;   // The radius of the groundflash. 
flashalpha=0.7; // [0, 1]: How transparent the groundflash is. Generally, the higher, the brighter. 
circlegrowth=3.5; //A groundflash can have an additional circle that expands outwards. This controls how fast the circle grows. 
circlealpha=0.4;// How transparent the circle is. 
ttl        =10; // How long the groundflash lasts. 
color= 0.5 0.5 0.8 0.01 0.3 0.3 0.3 0.01 0.0 0.0 0.0 0.01; 
}

} //DEF-system
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: CEG Problems

Post by KDR_11k »

Are you sure you're allowed to capitalize "custom:" ?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: CEG Problems

Post by Forboding Angel »

If it's crashing on unit spawn it's a problem in the unitdef. Ceg errors tend to fail pretty gracefully, but unitdef errors still cause outright crashes.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: CEG Problems

Post by FLOZi »

Forboding Angel wrote:If it's crashing on unit spawn it's a problem in the unitdef. Ceg errors tend to fail pretty gracefully, but unitdef errors still cause outright crashes.
bad unitdefs are usually stripped out when the game is loading
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: CEG Problems

Post by Argh »

Not ones that are the result of bad sound or CEG references.

Your CEG names, if using Lua for UnitDefs and TDF for CEGs should not include any capital letters, i.e.:

Code: Select all

     [[custom:muzzleflash1]],
     [[custom:shell_impact]],
     [[custom:blue_death]],
That's because all TDF-generated CEGs have lower-case names.
User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: CEG Problems

Post by Erik »

So i made all of it lowercase, nothing changes.
I even have uppercase ones that work so why not this one?

Edit: Seriously whats wrong with that shit?
I messed around a bit and overwrote a non working CEG with a working one result: both now crash the game.
WTF?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: CEG Problems

Post by Argh »

It sounds like you must have a problem with your resources or sounds.

If it's crashing the game, it's probably a bad sound reference, not the CEG. A bad CEG reference causes error spam, not a crash.
User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: CEG Problems

Post by Erik »

It was a type on the unit def that crashed it :\

But as i am here i've got another question:
I got a muzzleflash animation, how do i make it go straight vertical no matter how the point is orientated, i messed around a bit with
'dir x,y,z; ' to overwrite the standart values.
but i couldn't figure it out, straight left,right,front, back all work but not straight upwards/downwards.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: CEG Problems

Post by Forboding Angel »

Erik wrote:It was a type on the unit def that crashed it :\

But as i am here i've got another question:
I got a muzzleflash animation, how do i make it go straight vertical no matter how the point is orientated, i messed around a bit with
'dir x,y,z; ' to overwrite the standart values.
but i couldn't figure it out, straight left,right,front, back all work but not straight upwards/downwards.
Just rotate the piece it's emitted from... that would be the easiest way. If you don't have something you can already rotate, open up upspring and "Add Empty", position it, then in cob in the create function, just rotate it upwards, easy peazy :-)
Post Reply

Return to “Game Development”