[TREPAN] Commandfire=1 is broken in luadefs

[TREPAN] Commandfire=1 is broken in luadefs

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

[TREPAN] Commandfire=1 is broken in luadefs

Post by Forboding Angel »

I tried it using every way I could think of for a true value, and no dice.

1,
"1",
true,
"true", << WHich being a boolean should be correct, even tho I have seen booleans accept 1, and true, as possible values.

Fix Plox?

I'mma stick the weapon as a TDF for the moment, but I would really like to be able to use the actual luadef for it.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by KDR_11k »

Why are you calling for Trepan? It has been broken long before Trepan was a team member. Commandfire only makes the weapon cancel its attack order after shooting once, it doesn't prevent autotargetting.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by lurker »

Forb said repeatedly it worked in the tdf. :?
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by trepan »

Looks like it's working for CA. The fact that it works for
TDFs means that it's at least possible to have it work
through the lua defs (as TDFs are actually parsed by lua).
Try something like this to check your state:

/luaui run for k,v in pairs(WeaponDefNames) do print(k,v.manualFire) end
(the DoLine widget needs to be enabled).

P.S. "manualFire" is the both the internal variable name
and the lua interface name for "commandFire".
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by Forboding Angel »

Hmmm, ok I will test it.

Funky... BTW KDR, Commandfire 1 means that you must physically target something with the attack button for it to shoot.

The reason that this is a big deal to me is because that the orbital laser in evolution keeps wanting to pop off...

Come to think of it... When the orbital laser was on a different unit, it never blew it's load prematurely. Am I missing something here?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by KDR_11k »

I had commandfire=1 on the Titan in CvC, it would still shoot stuff by itself IIRC.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by lurker »

Is there any way for lua to access the clipboard?
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by trepan »

From uikeys.txt:
// bind Ctrl+v pastetext

(not exactly lua access, but you can
paste commands for /luaui using it)
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by yuritch »

KDR_11k wrote:I had commandfire=1 on the Titan in CvC, it would still shoot stuff by itself IIRC.
Hmm. The fact *A commanders don't DGun everything on sight should mean commandfire is working like it should. I've done a weapon with that, and it works like it should - it only fires if manually ordered to.
Are you sure you put the tag into weapon definition and not the unit definition? It only works in weapon files...
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by Pxtl »

yuritch wrote:
KDR_11k wrote:I had commandfire=1 on the Titan in CvC, it would still shoot stuff by itself IIRC.
Hmm. The fact *A commanders don't DGun everything on sight should mean commandfire is working like it should. I've done a weapon with that, and it works like it should - it only fires if manually ordered to.
Are you sure you put the tag into weapon definition and not the unit definition? It only works in weapon files...
There may be different autotargeting logic depending on whether or not CanDgun is true.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by Forboding Angel »

yuritch wrote:
KDR_11k wrote:I had commandfire=1 on the Titan in CvC, it would still shoot stuff by itself IIRC.
Hmm. The fact *A commanders don't DGun everything on sight should mean commandfire is working like it should. I've done a weapon with that, and it works like it should - it only fires if manually ordered to.
Are you sure you put the tag into weapon definition and not the unit definition? It only works in weapon files...

Luadefs...

Luadefs...

Luadefs...

Not FBI/tdf
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by KDR_11k »

You still haven't posted the def in question.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by Forboding Angel »

KDR_11k wrote:You still haven't posted the def in question.
Edit: I didn't think there was much point...

Luadef that doesn't work...

Code: Select all

local weaponDefs = {
  deathray = {
    areaOfEffect       = 500,
    avoidFeature       = false,
    avoidFriendly      = false,
    beamWeapon         = true,
    cegTag             = "electricbolt",
    collideFeature     = false,
    collideFriendly    = false,
    commandfire        = true,
    coreThickness      = 3,
    duration           = 0.5,
    energypershot      = 250000,
    explosionGenerator = "custom:NUKE",
    fallOffRate        = 0.1,
    fireStarter        = 90,
    guidance           = true,
    id                 = 666,
    impluse            = "1",
    interceptedByShieldType = 1,
    largeBeamLaser     = true,
    lineOfSight        = true,
    metalpershot       = 0,
    name               = "Doom Laser",
    range              = 200000,
    reloadtime         = 180,
    renderType         = 0,
    rgbColor           = "1 0.5 0",
    rgbColor2          = "0 0 1",
    soundHit           = "18402_inferno_xplo.wav",
    soundStart         = "doomlaser2.wav",
    startVelocity      = 5000,
    sweep              = "1",
    sweepfire          = true,
    targetMoveError    = 0,
    texture1           = "megaparticle",
    texture2           = "empty",
    texture3           = "empty",
    texture4           = "empty",
    thickness          = 120,
    tolerance          = 50000,
    turret             = true,
    weaponVelocity     = 5000,
    damage = {
      default            = 25000,
    },
  },
}
unitDef.weaponDefs = weaponDefs
Last edited by Forboding Angel on 24 May 2008, 10:56, edited 2 times in total.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by Forboding Angel »

However if you stick this in the luadef for the unit it does work.

noAutoFire = true,

Since when did that responsibility get transferred from the weapon to the unit?

Also, I think commander = 1, is the culprit for why commandfire is being broken.

Might be worth looking into.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: [TREPAN] Commandfire=1 is broken in luadefs

Post by KDR_11k »

IIRC that's what I had to do for the CvC titan too, regular weapons that are neither dgun nor stockpile don't seem to care much for commandfire.
Post Reply

Return to “Engine”