Flare effect using emit-sfx - Page 2

Flare effect using emit-sfx

Requests for features in the spring code.

Moderator: Moderators

User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

It'll probably use the first two vertices and no, you can't specify more than one part.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

You need to specify an object with more than two vertices.
Emitting from a flare = detonation at that point. Too bad that I can't import pieces with only two vertices into upspring (wakes on ships for instance). At least in .obj format.

Would be cool if you could pass over two pieces (vertices) so it the direction can be calculated...
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Or if it could just use the object's orientation.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Um yeah. I'm still looking forward to the CBitmapMuzzleFlame projectile which can be emitted as well. Totally rocks... only needs to be oriented and aligned properly now.
esteroth12
Posts: 501
Joined: 18 May 2006, 21:19

Post by esteroth12 »

rattle wrote:Would be cool if you could pass over two pieces (vertices) so it the direction can be calculated...
that's what I was saying... it would be nice if it could fire along the ray of the two specified flares...
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

Hmm. Spring crashes with this:

Code: Select all

[UNITINFO]
	{
//What am I? Why am I here? What is my purpose in life?
	ID=4;
	UnitName=GHE_conhmg;
	Version=1;
	Side=ARM;
	Objectname=GHE_conhmg;
	Designation=GHE_conhmg;
	Name=Conscript HMG;
	Description=Conscript, Heavy Machine Gun;
	FootprintX=1;
	FootprintZ=1;
	BMcode=1;
	ThreeD=1;
	ZBuffer=1;
	NoAutoFire=0;
	ExplodeAs=Infantry;
	SelfDestructAs=Infantry;
	Category=ARM KBOT LEVEL1 NOTAIR NOTSUB CTRL_G;
	TEDClass=KBOT;
	Copyright=Copyright 1997 Humongous Entertainment. All rights reserved.;
	Corpse=GHE_con_dead2;
	unitnumber=15;
	ShootMe=1;
	EnergyMake=100;
	MetalMake=100;
	Mass=1;
	idleAutoHeal=5;

//Build me an army...
	BuildDistance=100;
	BuildCostEnergy=400;
	BuildCostMetal=140;
	MaxDamage=80;
	MaxWaterDepth=15;
	MaxSlope=40;
	EnergyUse=3;
	BuildTime=270;
	EnergyStorage=-10;
	MetalStorage=0;
	Builder=1;
	WorkerTime=50;

//I can see! I can see! *Goes looking for porno*
	SightDistance=450;
	RadarDistance=0;
	SoundCategory=PSY_INF;

//Run away! (Movement tags)
	MovementClass=Infantry;
        DefaultMissionType=Standby;
	maneuverleashlength=200;
	mobilestandorders=1;
	StandingMoveOrder=1;
	canmove=1;
	canpatrol=1;
	canstop=1;
	canguard=1;
	MaxVelocity=2.1;
	BrakeRate=0.6;
	Upright=1;
	Acceleration=2;
	TurnRate=1010;
	SteeringMode=1;

//Shoot-me-do! (Weapon tags)
        CanAttack=1;
        Weapon1=con_hmg;
	firestandorders=1;

//Springy stuff (boing!)
	HideDamage=1;
	ShowPlayerName=1;
	SeismicSignature=1;
	iconType=inf;
	canBuild=1;
        canRepair=0;
        canRestore=0;
        canReclaim=0;
        canAssist=0;
	shownanoframe=0;
	shownanospray=0;
	[SFXTypes]
		{
		explosiongenerator1=bloodsmall;
		explosiongenerator2=bloodlarge;
		}
      }
Revelant part of the .bos

Code: Select all

HitByWeapon(anglex,anglez)
{
    signal SIG_HIT; 
    set-signal-mask SIG_HIT;
	emit-sfx 1024+1 from body;
} 
The explosion generator entry

Code: Select all

[bloodsmall]
{
	usedefaultexplosions=1;
	[dirt]
	{
		[properties]
		{
		alpha=50;
		alphaFalloff=0;
		size=1;
		sizeExpansion=2;
		slowdown=1;
		color=1 0 0;
		speed=4;
		pos=0; 
		}
	underwater=1;
	air=1;
	water=1;
	ground=1;
	count=10;
	}
}
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Did you grab the latest files from the svn?

http://rattle.from-hell.net/spring/reso ... ld2274.rar
I hope I didn't miss anything. Extract that over a latest dev-build installation and the exe as well (not included of course). It should work. Oh and you should begin with explosiongenerator0 and emit-sfx 1024. Shouldn't cause troubles though.

Just noticed,

Code: Select all

explosiongenerator2=bloodlarge;
is missing the custom: in front of the explosion type.

EDIT: Comment out "usedefaultexplosions=1;", this works. Looks wierd though :)

Code: Select all

[smallblood]
{
//	usedefaultexplosions=1;
	[dirt]
	{
		[properties]
		{
			alpha=50;
			size=10;
			color=1.0, 0.0, 0.0;
			alphaFalloff=2;
			speed=0.75 r-1.5, 1.7 r1.6, 0.75 r-1.5;
			pos=-10 r20, 20, -10 r20;
			slowdown=1;
			sizeExpansion=2;
		}
	underwater=1;
	air=1;
	water=1;
	ground=1;
	count=10;
	}
}
Looks pretty nice and works...
esteroth12
Posts: 501
Joined: 18 May 2006, 21:19

Post by esteroth12 »

eh, you don't need a TEDClass, Copyright, and the Categories ought to be changed (i doubt you have Kbots in your mod :P)
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

Can I get some help?

Code: Select all

Engine()
{
		emit-sfx 1024+0 from smokepoint1;
		emit-sfx 1024+0 from smokepoint2;
		sleep 50;
}
and

Code: Select all

Create()
{
	hide firep1;
	hide firep2;
	hide smokepoint1;
	hide smokepoint2;
	Static_Var_1 = 0;
	start-script SmokeUnit();
	start-script Engine();
}
are the relevant bits from the script

Code: Select all

[AFT]
{
	[muzzleflame]
	{
		[properties]
		{
			size = 40;
			sizeGrowth = -2;
			pos = 0, 0, -5 r2;
			speed=0.5 r-1, 0.5 r-1, 1.5 r0.5;
			color=1, 0.4, 0.1;
			alphaFalloff=2; 
		}
		underwater=0;
		air=1;
		water=1;
		ground=0;
		count=4;
	}
	[smoketrail]
	{
		[properties]
		{
			size = 5;
			sizeGrowth = 0;
			pos = 0, 0, -5 r2;
			speed=0.5 r-1, 0.5 r-1, 1.5 r0.5;
			color=1, 1, 1;
			alphaFalloff=2; 
		}
		underwater=0;
		air=1;
		water=0;
		ground=1;
		count=1;
	}
}
is th relevant bit from the explosions tdf

Code: Select all

	[SFXTypes]
		{
		explosiongenerator0=custom:AFT;
		}
is the relevant bit from the unit.

Worked perfect before I added the stuff. I know the explosion itself probably looks like crap, but I wasn't aiming for pretty, just a starting point.

Oh yeah, game crashes on .give [unit]

I've got all the latest svn stuff.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

smoketrail and muzzleflame aren't available for the custom explosion generator as it seems...
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

Aha. Is there a list of ones that are?

~~~

Tried FLAME and SMOKE, still got crashes.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

use heatcloud and smoke
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

Ehh....

"Uknown unit type"??

At least it doesn't crash now.

~~~

Wait, I think I fixed it. FBIEd mucked up the custom stuff in the fbi.

~~~~

Fixed the FBI problems, but now the game crashes again on .give
Last edited by Caydr on 27 Sep 2006, 21:15, edited 1 time in total.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Code: Select all

[AFT]
{
	[smoke2]
	{
		[properties] 
		{ 
			ageSpeed=0.02; 
			size = 10; 
			sizeGrowth = -1;
			pos = -4 r8, r4, -4 r8;
			wantedPos = -3 r6, r3, -3 r6;
			speed = -1 r2, -1 r2, -1 r2;
			glowFalloff=10;
		}
		water=1; 
		ground=1;
		air=1;
		count=1;
	}
	[heatcloud]
	{
		[properties]
		{
			pos = 1 r-1, -1 r1, 1 r-1;
			speed = 0, -0.5 r0.5, 0;
			heat=75;
			maxheat=100;
			heatFalloff=3;
			size = 5;
			sizeGrowth=-0.01;
		}
		air=1;
		ground=1;
		water=1;
		count=3;
	}
}
Try that, looks neat. Needs a refresh time of 30-45. Increase the heatcloud count value (one at a time) to get more intense flames

EDIT: FFS

Code: Select all

 replaces tabs... so does [quote]... bah

Now while we're at it, could anyone explain to me what the three values for pos are?
I was assuming XYZ offset values from the initial emit location and r = radius and the value after r is a multiplier or something...
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

Using yours instead, game doesn't crash now, but I don't see any evidence the effect is happening.

The effect is supposed to happen continuously until the unit dies, how should I modify the script so that happens?

Thanks!
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

This needs a static-var called bMoving. In the Create() function initialize bMoving with FALSE and start the Engine script.

Code: Select all

bMoving = FALSE;
start-script Engine();
Change the Engine() function to

Code: Select all

Engine()
{
	while (bMoving)
	{
		emit-sfx 1024+0 from smokepoint1;
		emit-sfx 1024+0 from smokepoint2;
		sleep 50;
	}
}
Add to the StartMoving()/StopMoving() functions

Code: Select all

bMoving = TRUE; // in StartMoving()
bMoving = FALSE; // in StopMoving()
If you really want it to emit all the time then leave out the parts involving bMoving and use while (1) or while (TRUE) (there isn't really a difference) instead of while (bMoving).
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

OOOooooo

So now I've got

Code: Select all

Create()
{
	hide firep1;
	hide firep2;
	hide smokepoint1;
	hide smokepoint2;
	Static_Var_1 = 0;
	start-script SmokeUnit();
	start-script Engine();
}

.....

Engine()
{
	while (true)
   {
      emit-sfx 1024+0 from smokepoint1;
      emit-sfx 1024+0 from smokepoint2;
      sleep 50;
   }
}
And it says "unknown identifier true"
Last edited by Caydr on 27 Sep 2006, 21:52, edited 3 times in total.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

I assume you want to replace the default exhausts on the atlas and lvl 2 transport thingy... I've only tested this on a tank right now :P but it should look good on them too.
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

rattle wrote:I assume you want to replace the default exhausts on the atlas and lvl 2 transport thingy... I've only tested this on a tank right now :P but it should look good on them too.
Hmm... that's a good idea too :-)
esteroth12
Posts: 501
Joined: 18 May 2006, 21:19

Post by esteroth12 »

I'm pretty sure the engine only recognizes TRUE, not true :P

and if that doesn't work... ther's always 1 or get HEALTH! (as if its dead, you don't want it emitted anyway) ;)
Post Reply

Return to “Feature Requests”