New COB constants?
Moderator: Moderators
Well, sort of. If you order it to move elsewhere it'll keep tyring to turn to that direction to move that way. But yes it can still move 'straight'.yuritch wrote:Won't this just lock a unit to one direction? I don't see any "set MAX_SPEED" in there, so the unit will still be able to move straight, right?
Yeah, that's more a case of giving teamcolour access to effects rather than anything COB related.Noruas wrote:Well i either need a way for the cob to detect team color for different but same effects can go, with colors that some what match... Or i need, which would be easier, the special effect i am calling, to detect team color.
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
Would be good, requires me shifting uncloakradius over to unit from unitdef, mind. As would builddistance.Guessmyname wrote:UNCLOAK_RADIUS for the reveal cloaked units distance thingy?FLOZi wrote:Not currently, what do you want it for? There is a way to get a units team however.
I'm thinking of adding set RADAR/SEISMIC/JAMMER/SONAR/ETC_RADIUS, anyone want?
EDIT: And Builddistance perhaps?
Ignoring those for the time being:
Have all been added. Fairly self explanatory I think?
I have something planned for 92.
@neddie: some useteamcolour=1; tag somewhere that would render the whole sprite in teamcolour.
Code: Select all
#define RADAR_RADIUS 87 // set or get
#define JAMMER_RADIUS 88 // set or get
#define SONAR_RADIUS 89 // set or get
#define SONAR_JAM_RADIUS 90 // set or get
#define SEISMIC_RADIUS 91 // set or get
#define CURRENT_FUEL 93 // set or get
I have something planned for 92.
@neddie: some useteamcolour=1; tag somewhere that would render the whole sprite in teamcolour.
What about tan, sin and cos? Really nice to see exponents, and fuel is also VERY handy.
Things like:
PIECE_XZ
you get two variables at once? how exactly does that work? Can I get just the Z value for example? Now that I think of it, A fun way of getting sin etc is to use a dummy piece rotaded some angle and then read in values with PIECE_XZ.
Things like:
PIECE_XZ
you get two variables at once? how exactly does that work? Can I get just the Z value for example? Now that I think of it, A fun way of getting sin etc is to use a dummy piece rotaded some angle and then read in values with PIECE_XZ.
i guess i can add tan sin and cos. They'd have to be * 65536 though as they would return floats.
The coords are packed; you can get the seperate elements thusly;
Note that your compiler.cfg for scriptor probably still has a '?' character instead of '&' for bit-wise and. I must get around to releasing my updated one.
Anyway, next up are
get TRANSPORT_ID gets the unitid of the transport the unit is currently in
and adapting get HEADING to take an optional unitid parameter. This will allow scriptors to align loaded units with their transport.
Also lucky number 92 will be implemented; get DO_SEISMIC_PING or something along those lines. Reads poorly but should be handy.
The coords are packed; you can get the seperate elements thusly;
Code: Select all
x = packed / 65536;
z = packed & 65535
Anyway, next up are
get TRANSPORT_ID gets the unitid of the transport the unit is currently in
and adapting get HEADING to take an optional unitid parameter. This will allow scriptors to align loaded units with their transport.
Also lucky number 92 will be implemented; get DO_SEISMIC_PING or something along those lines. Reads poorly but should be handy.
Hurrah, done:
TRANSPORT_ID (94)
- usage: get TRANSPORT_ID
- returns the ID of the transport the unit is currently loaded into
- returns -1 if not loaded
HEADING (82)
- usage: get HEADING (unitid)
- returns the heading of the current unit if no unitid supplied, or the heading of the supplied unit
DO_SEISMIC_PING (92)
- usage: get DO_SEISMIC_PING (size)
- Does a seismic ping of the units seismicSignature by default, or of the size specified
- Does the LUA calls and Global AI calls that a standard movement-caused seismic ping will do.
- This would probably be more efficient if I made a 'DoSeismicPing' method in unit.cpp rather than copying the code across. Possibly I'll clean it up in the future.
EDIT: Made the change in DoSeismicPing. Comitted, rev 3823.
TRANSPORT_ID (94)
- usage: get TRANSPORT_ID
- returns the ID of the transport the unit is currently loaded into
- returns -1 if not loaded
HEADING (82)
- usage: get HEADING (unitid)
- returns the heading of the current unit if no unitid supplied, or the heading of the supplied unit
DO_SEISMIC_PING (92)
- usage: get DO_SEISMIC_PING (size)
- Does a seismic ping of the units seismicSignature by default, or of the size specified
- Does the LUA calls and Global AI calls that a standard movement-caused seismic ping will do.
- This would probably be more efficient if I made a 'DoSeismicPing' method in unit.cpp rather than copying the code across. Possibly I'll clean it up in the future.
EDIT: Made the change in DoSeismicPing. Comitted, rev 3823.
