Scripting: the emit-sfx function
Moderator: Moderators
Scripting: the emit-sfx function
OK, I've only just started scripting and can *sort-of* do basic stuff, or look up how to do it, but I can't find anything on the emit-sfx function. I know that
emit-sfx 2048 from piece spawns weapon1, 2049 weapon 2 etc, and I've also read that it can be used to create custom explosions.
How do you do this? What different numbers passed as arguments do what?
emit-sfx 2048 from piece spawns weapon1, 2049 weapon 2 etc, and I've also read that it can be used to create custom explosions.
How do you do this? What different numbers passed as arguments do what?
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Scripting: the emit-sfx function
It's pretty straight foward really.
It is an Honest firing of a weapon though. It's useful for many situations (of course I can't really think of any atm)...
Check out the Evolution RTS svn and look at the hellfire script, there is a vid on youtube showing the firing pattern.
It is an Honest firing of a weapon though. It's useful for many situations (of course I can't really think of any atm)...
Check out the Evolution RTS svn and look at the hellfire script, there is a vid on youtube showing the firing pattern.
-
- Posts: 1176
- Joined: 23 Aug 2007, 19:46
Re: Scripting: the emit-sfx function
Well you can use it the following way:
You for example want to have a special firing FX (like the Core Reapers have in e.g. BA) you use this. In your gamedata/explosions directory you somewhere define yourself an explosion i.e. particle effect which matches your whishes. Then you open the FBI of the unit which shall have the effect and add a
As this now is your new firing FX you open the script of the unit and go to the FireWeapon function. There you add a
I don't know what exactly is defined with the first 1024 number but the + 0 tells Spring to use the "explosiongenerator0" you have defined in your FBI and "from flare1" makes it spawn at the object flare1...
With that said you of course can define several of those SFX-Types for one unit:
Which you then can call by
Maybe someone else can tell you something about that first number but I found it to work even if you always use the same number...
You for example want to have a special firing FX (like the Core Reapers have in e.g. BA) you use this. In your gamedata/explosions directory you somewhere define yourself an explosion i.e. particle effect which matches your whishes. Then you open the FBI of the unit which shall have the effect and add a
Code: Select all
[SFXTypes]
{
explosiongenerator0=custom:NAMEOFYOUREFFECT;
}
Code: Select all
emit-sfx 1024 + 0 from flare1;
With that said you of course can define several of those SFX-Types for one unit:
Code: Select all
[SFXTypes]
{
explosiongenerator0=custom:NAMEOFYOURFIRSTEFFECT;
explosiongenerator1=custom:NAMEOFYOURSECONDEFFECT;
explosiongenerator2=custom:NAMEOFYOURTHIRDEFFECT;
}
Code: Select all
emit-sfx 1024 + 0 from OBJECTX;
emit-sfx 1024 + 1 from OBJECTY;
emit-sfx 1024 + 2 from OBJECTZ;
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Scripting: the emit-sfx function
He is talking about emitting a Ceg. I am speaking of emitting a weapon.
Re: Scripting: the emit-sfx function
There's also 4096 which spawns the explosion of the corresponding weapon.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Scripting: the emit-sfx function
orly?
I didn't know about that one.
I didn't know about that one.
Re: Scripting: the emit-sfx function
Surprisingly all of this is in the changelog...
- Calling emit-sfx 2048 from a script will now allways fire the weapon. Emit-sfx 4096 will now take over the previous behavior of detonating the weapon at the piece position.
- Added the abillity to call explosiongenerators and weaponfire from within script via emit-sfx command.
Explosiongenerators to be called via script are defined in the unit TDF file in a section called SFXTypes, with tags explosiongenerator+n=some_explosion
and then called via emit-sfx 1024+n.
Weaponfire are called via emit-sfx 2048+weapon_to_fire.
Re: Scripting: the emit-sfx function
Ok, and this is all good and cool, and I can see ways where I can apply it (the 4096 and 1024 + n) but it fails to answer my real question. What to the other numbers do (i.e., those smaller than 1024)?
(borrowed from the Decade gunship)
In this example the "emit-sfx 2" creates bubbles in the ships wake. What are the other numbers that are built in, and what do they do?
Code: Select all
StartMoving()
{
signal SIG_MOVE;
set-signal-mask SIG_MOVE;
while( TRUE )
{
emit-sfx 2 from wake1; //these two
emit-sfx 2 from wake2; //lines
sleep 300;
}
}
In this example the "emit-sfx 2" creates bubbles in the ships wake. What are the other numbers that are built in, and what do they do?
Re: Scripting: the emit-sfx function
From SFXTYPE.H (that's in your Includes folder, came with Scriptor):
Code: Select all
// Vector-based special effects
#define SFXTYPE_VTOL 0
#define SFXTYPE_THRUST 1
#define SFXTYPE_WAKE1 2
#define SFXTYPE_WAKE2 3
#define SFXTYPE_REVERSEWAKE1 4
#define SFXTYPE_REVERSEWAKE2 5
// Point-based (piece origin) special effects
#define SFXTYPE_POINTBASED 256
#define SFXTYPE_WHITESMOKE (SFXTYPE_POINTBASED | 1)
#define SFXTYPE_BLACKSMOKE (SFXTYPE_POINTBASED | 2)
#define SFXTYPE_SUBBUBBLES (SFXTYPE_POINTBASED | 3)
Re: Scripting: the emit-sfx function
OK, good, are there any other numbers? SFXTYPE.h isn't the actual definition file, it just makes it easier to name stuff in scriptor, isn't it?
Also, how does the pipe work (256|1 etc)?
I should probably stop asking questions and just start modding, but I'm finding it really difficult to get models. If anyone wants to help make an Epic 40k mod and has 1337 modeling skillZ (with a capital Z) please PM me.
Also, how does the pipe work (256|1 etc)?
I should probably stop asking questions and just start modding, but I'm finding it really difficult to get models. If anyone wants to help make an Epic 40k mod and has 1337 modeling skillZ (with a capital Z) please PM me.
Re: Scripting: the emit-sfx function
You may be better off joining GuessMyName with his Epic Legions mod instead of redoing it all from scratch.
Re: Scripting: the emit-sfx function
Yeah I thought of doing that but we're going to start higher, making really big stuff available, you know, titans, capitol ships, horribly overpowered shield generators etc.