• 0

    posted a message on Should this array not be set to false?

    @BasharTeg: Go

    It wasn't even coming close and the problem was a bug with the interface. It was showing my copy+pasted variable resets but they weren't actually in the script. When I deleted and remade them exactly how they were it worked.

    Posted in: Triggers
  • 0

    posted a message on Building at the point
    Quote from iqddd: Go

    No such function.

    It returns a point. So you can make a point variable and set it using Find Placement.

    Posted in: Triggers
  • 0

    posted a message on Ability no longer usable after attacking?

    @Photoloss: Go

    Well the only other flag that I turned on was toggle, which doesn't seem like it should have any effect, either.

    Posted in: Data
  • 0

    posted a message on Ability no longer usable after attacking?
    Quote from Photoloss: Go

    That sounds extremely odd. Compare all fields on your ability to the original, especially Stats: Flags and Cost. The Cost has 2 "Link" fields, which can be used to implement shared cooldowns between abilities etc.

    Also make sure your weapon isn't doing anything fancy like running a channeled attack. Basic test, replace custom weapon with default Marine one and see if the problem persists.

    It was the flags, transient I'm guessing.

    Posted in: Data
  • 0

    posted a message on (Solved) Weapon doing wrong damage

    @Photoloss: Go

    Yeah I forgot to change the launch missile. I've named them very similarly and the name goes off the field.

    Works now, thanks.

    Posted in: Data
  • 0

    posted a message on (Solved) Weapon doing wrong damage

    So I've copied a weapon and its corresponding effect and added it to the unit it is from. The weapon I've copied only targets air units. I made the copy only target ground units, and I changed its damage.

    When I look in game at the unit, everything appears fine. The air weapon targets air and does X damage, the ground weapon targets ground and does Y damage. But when it comes to actually attacking, the ground weapon does X damage to units.

    Posted in: Data
  • 0

    posted a message on Ability no longer usable after attacking?
    Quote from SoulFilcher: Go

    @Tudentau: Go If its a one time upgrade to the unit, you should actually change how the ability works, and make the button disappear after use.

    At least that's how I'd make it.

    It does disappear. For normal gameplay, Generate Creep disappears as well, but Stop Generating Creep appears. When you use Stop Generating Creep, Generate Creep reappears.

    I might just end up making a new ability and trying to start from scratch, but there's so much going on in the data editor.

    Posted in: Data
  • 0

    posted a message on Should this array not be set to false?
    Quote from Mille25: Go

    @Tudentau: Go

    What is your point though? That it requires more work? That it causes more overhead?

    In general it's just nicer.

    When I'm looking over my code, it stands out better to me. The conditions are indented out from the start and the actions indented out from the conditions, whereas a for loop has the conditions in the same line with only the actions indented out. When I look at it under script, it looks ridiculously better. When I want to add an additional condition, it doesn't require using an if-then statement. In terms of resources, there are two less variables being used and no need to redeclare my counter variable unless I'm using another loop with the same variable.

    autoCE4A9CD2_ae = 9;
        autoCE4A9CD2_ai = 1;
        lv_loopCounter = 0;
        for ( ; ( (autoCE4A9CD2_ai >= 0 && lv_loopCounter <= autoCE4A9CD2_ae) || (autoCE4A9CD2_ai <= 0 && lv_loopCounter >= autoCE4A9CD2_ae) ) ; lv_loopCounter += autoCE4A9CD2_ai ) {
        }
    

    vs

     while ((lv_loopCounter < 9)) {
            lv_loopCounter += 1;
        }
    
    Posted in: Triggers
  • 0

    posted a message on Ability no longer usable after attacking?

    So what I've done is copy the Overlord's generate creep ability, but removed the disable validators, the delay, and increased the period. I've also made it reference different footprints so the creep generated is a particular size. I then added a 75 mineral cost.

    The intention was to have the unit have a 1-time purchasable upgrade that makes it generate a creep field, and it works, except if the unit has attacked, the ability will no longer be usable. It become white similar to how stop does on stationary units. If it attacks after already having used the ability, it still retains its creep field.

    Posted in: Data
  • 0

    posted a message on Should this array not be set to false?
    Quote from Mille25: Go

    @Tudentau: Go

    An if then else statement is not a function, nor is continue.

    Splitting hairs. The point remains the same.

    Posted in: Triggers
  • 0

    posted a message on Should this array not be set to false?

    @Mille25: Go

    'easily'

    That requires two additional functions as well as the condition. With a while loop I just add the condition.

    Posted in: Triggers
  • 0

    posted a message on Variable not being set?

    Nevermind I had accidentally pulled my if then statement out of my loop.

    Posted in: Triggers
  • 0

    posted a message on Should this array not be set to false?

    @Mille25: Go

    For other code as well.

    Also I can't go back and add an extra condition to a 'for loop'. In general I never use for loops because of this reason, as they're restricted to an integer and nothing more.

    Posted in: Triggers
  • 0

    posted a message on Should this array not be set to false?
    Quote from DeltaV: Go

    Before each while block you need to reset the respective loopCounter to 0. Otherwise once it does the first player, loopCounter 2 will still = 40. And once it does the first unit, loopcounter 3 will still be 9.

    E.g.

    Set loopCounter = 0 General - While (Conditions) are true, do (Actions) Conditions loopCounter < 9 Actions Set loopCounter 2 = 0 General - While (Conditions) are true, do (Actions) Conditions loopCounter 2 < 40 Actions Set loopCounter 3 = 0 General - While (Conditions) are true, do (Actions) Conditions loopCounter 3 < 7

    P.S. Why don't you just use FOR loops? Then you wouldn't have to do that reset to 0 thing because it does it automatically.

    Ok, so I'm not sure how this didn't copy, but I am resetting the loop counters outside themselves.

    I use while loops because they're generally just better in terms of programming and I can also visualize them the same anyway.

    Alright, so I guess them not copying was because they weren't actually there even though they were. I deleted and remade the loops exactly how they were and now it works as expected.

    Posted in: Triggers
  • 0

    posted a message on Yet another arithmetic problem - Modulus

    @joemart06: Go

    It seems SC2Galaxy takes the absolute value of numbers with mod. So continuing down that line,

    z = (5 - (4 - 1)) mod 6) = 2 mod 6 = 2 (x2 =4)

    z = (5 - (5 - 1)) mod 6) = 1 mod 6 = 1 (x2 =2)

    z = (5 - (6 - 1)) mod 6) = 0 mod 6 = 0 (x2 =0)

    z = (5 - (7 - 1)) mod 6) = -1 mod 6 = -1 (x2 =-2)

    z = (5 - (8 - 1)) mod 6) = -2 mod 6 = -2 (x2 =-4)

    z = (5 - (9 - 1)) mod 6) = -3 mod 6 = -3 (x2 =-6)

    z = (5 - (10 - 1)) mod 6) = -4 mod 6 = -4 (x2 =-8)

    z = (5 - (11 - 1)) mod 6) = -5 mod 6 = -5 (x2 =-10)

    z = (5 - (12 - 1)) mod 6) = -6 mod 6 = 0 (x2 =0)

    z = (5 - (13 - 1)) mod 6) = -7 mod 6 = -1 (x2 =-2)

    etc.

    If you want a sequence of 10/8/6/4/2/0 why not do

    var1 = 12 (global)

    if (var1 - (cw * 2 ) < 0 then modify var1 + 10

    z = var1 - (cw * 2)

    Posted in: Triggers
  • To post a comment, please or register a new account.