Scripting / sfx question

Scripting / sfx question

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
Runecrafter
Posts: 148
Joined: 30 Oct 2005, 00:23

Scripting / sfx question

Post by Runecrafter »

In the arm_commander script (for the XTA mod) there is a line:
emit-sfx 1024 + 1 from nanospray;

I'm looking for information on "1024 + 1" and other codes like it.
I have been searching without any luck and do not know where this information is defined, or how it is defined.

I know that the command tells the script to emit a graphic effect from the nanospray, but beyond that I'm lost.

Any help would be greatly welcome.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Scripting / sfx question

Post by Argh »

That 1024+1 does, indeed, refer to an Explosion event. Here's an example from a P.U.R.E. unit:

Code: Select all

[SFXTypes]
	{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////RESERVED
	explosiongenerator0=custom:SMOKEPUFF_PURE_FX;
	explosiongenerator1=custom:MED_EXPLOSION_FX2;
	explosiongenerator2=custom:ROCKET_ARTY_EXPLOSION_FX;
	explosiongenerator3=custom:MED_EXPLOSION_FX;
	explosiongenerator4=custom:GUNCRAFT_EXPLOSION_FX;
	explosiongenerator5=custom:BIG_EXPLOSION_FX;
	explosiongenerator6=custom:BIG_EXPLOSION_FX;
	explosiongenerator7=custom:BIG_EXPLOSION_FX;
	explosiongenerator8=custom:BIG_EXPLOSION_FX;
	explosiongenerator9=custom:BUILDING_DUST_FX;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////END RESERVED
////////////////////////////////////////////////////////////////////////////////////FX
	explosiongenerator10=custom:GUNFLARE_RAPID_RED;
	}
1024+1, therefore, refers to MED_EXPLOSION_FX2.

I usually write my BOS script sections dealing with that like this:

#define MED_EXPLOSION_FX2 1024+1

So that, from there on out, all references to MED_EXPLOSION_FX2 in the BOS are the same as the FBI. Keeps maintenance simpler.
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Scripting / sfx question

Post by REVENGE »

1024 does the explosion effect at a certain piece.
2048 fire a weapon at a certain piece (it's just blindfired, no control over aiming/whatnot by itself, but it does obey selfdamage rules).
4096 does the explosion at a certain piece (this is a real explosion with damage, but does NOT obey selfdamage rules).
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: Scripting / sfx question

Post by [Krogoth86] »

It's also in the Wiki:
http://spring.clan-sy.com/wiki/COB_Constants

I also have a question at this point:
I tried to let a bomber with a "manual" bomb weapon drop its bombs sooner than the auto calculation via gravity & stuff defines. For that I used a dummy weapon which had a bigger range but it didn't really work so is there a problem with those customized bomb weapons or even burst weapons?

My problem was that I couldn't make it fire more than once and when just calling the emit-sfx line for several times I got several bombs but they didn't obey things like the weapon firing with a small inaccuracy ( so the bombs don't drop in a line but are spread a bit) and just spawned at the exact same place...

I had a look at how CA does handle their laser bombers for example but couldn't come up with any difference besides the different weapon type...
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Scripting / sfx question

Post by Argh »

is there a problem with those customized bomb weapons
No, they just don't obey the range parameter, and fire automatically when the range / gravity algorithm says that they should. You can make a bomb a slave to another weapon, to make it fire under different conditions, if you need to solve that problem.

Ok... now I've really, really gotta go...
User avatar
Runecrafter
Posts: 148
Joined: 30 Oct 2005, 00:23

Re: Scripting / sfx question

Post by Runecrafter »

Thank you all, you have been most helpful. 8)
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: Scripting / sfx question

Post by [Krogoth86] »

Argh wrote:No, they just don't obey the range parameter, and fire automatically when the range / gravity algorithm says that they should. You can make a bomb a slave to another weapon, to make it fire under different conditions, if you need to solve that problem.
You didn't get what my point was. It's not about triggering the weapon earlier (as I've done that with another weapon) but that when the bombs get triggered it doesn't act like it's defined in the script. For each emit-sfx call I just get one single bomb which gets emitted right at the queried object piece. This also makes it impossible to fake the "burst" of the weapon by just calling the emit-fx order for several times because the bombs just spawn at the exact same place and aren't spread a bit like they should...
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Scripting / sfx question

Post by imbaczek »

so move the pieces around.
Post Reply

Return to “Game Development”