Page 1 of 1

New CEG Operator: OP_RADIUS

Posted: 02 Jan 2009, 02:28
by Evil4Zerggin
If possible, I (and most likely other people) would like a new CEG operator, OP_RADIUS. This would multiply the operand by the radius of the explosion. Also helpful would be a unit variable cegRadius and a COB constant CEG_RADIUS to get/set it.

As far as I can tell, the relevant files are:
rts\Sim\Projectiles\ExplosionGenerator.h
rts\Sim\Projectiles\ExplosionGenerator.cpp

The code that executes the CEG code.

rts\Sim\Units\Unit.h
rts\Sim\Units\Unit.cpp

To add the cegRadius variable.

rts\Sim\Units\COB\COBInstance.cpp
COB access to cegRadius.

We'd probably have to assign it a strange letter since 'r', 'a', 'd', 'i', and 's' are already taken. Maybe 'u'?

A wind ('w'?) and/or a gravity ('g'?) operator would also be nice, but radius is the most helpful since people generally want their explosions to match the radius of the weapon without having to define a separate explosion for each radius.

I should really figure out how to build Spring >_>... I did rewrite the wiki's CEG documentation at least.

Re: New CEG Operator: OP_RADIUS

Posted: 02 Jan 2009, 09:27
by KDR_11k
I think wind and gravity should be lumped into an operator along with direction (one op with different numbers selecting different components of different vectors). It's probably not the most intuitive way but at least it leaves us with more letters to work with in the future.

Re: New CEG Operator: OP_RADIUS

Posted: 02 Jan 2009, 10:18
by Evil4Zerggin
So you're suggesting an operator, let's call it 'v' for the moment, such that, say, v0, v1, and v2 select the elements of dir, v3, v4, v5 select the elements of wind, and so on? I think that's a great idea--it would get past the problem that at current dir can only be used to specify an entire float3. In addition to saving letters, this would also allow multiplying dir by a scalar; for example, spawning CEGs on a line using CExpGenSpawner.

Re: New CEG Operator: OP_RADIUS

Posted: 14 Jan 2009, 23:58
by REVENGE
++++++++++++++++++++ +++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++ ++++++

KDR's suggestion ftw.

Re: New CEG Operator: OP_RADIUS

Posted: 15 Jan 2009, 12:26
by Tobi
Unbroke forum by inserting spaces between your pluses.

Re: New CEG Operator: OP_RADIUS

Posted: 15 Jan 2009, 17:26
by lurker
Rather oddly placed spaces.