• 0

    posted a message on Square root function 524287 limit bypass? [Solved]

    In reply to Forge_User_04585675:

     I looked into custom number types/functions and that seems beyond my ability. I altered the formula to work on a smaller scale. Even if the prices don't work exactly as well as the last one, I think its reasonable enough.
    Looking at especially the (p * q) part of the equation, I realized that since the values will often be around the millions, I would have to pay close attention to that part of the formula and drastically decreased the scale. Surprisingly with the reduced scale, it was off my intended output by only 5% at its worst.
    Here is the final result:
    Posted in: Triggers
  • 0

    posted a message on Square root function 524287 limit bypass? [Solved]

     

    In reply to Forge_User_04585675:

     
    Hello. I have a shallow understanding of programming and even after some research, can't really understand what custom floating points / fixed point libraries are. I do most of my coding through the GUI. 
    I'm trying to make a supply/demand curve with a functioning market to determine resource prices, in this case, it is food. 
    The long equation I provided originally finds the intercept point between the supply and demand equations.
    where: q = quantity supplied | c = GDP per capita | p = population | intercept x value = quantity demanded | intercept y value = price 
    The equation can be simplified... but I would prefer to have the equation be shaped in a curve which reflects the elasticity of food demand
    Posted in: Triggers
  • 0

    posted a message on Square root function 524287 limit bypass? [Solved]

    Hello, I am making use of a formula which involves long numbers in my starcraft map.

     

    Everything goes fine until I have to get the square root of a number greater than the real number limit (524287), then the math just overflows (circled in red above). I am not very good when it comes to math and don't know much about the best practices for decreasing the scale of the numbers. If it was a linear equation, I would just divide everything by a number and then multiply it by that number afterward. However, the presence of logarithms and exponents makes it so I'm not sure how I would decrease the scale of this equation.

     

    Please advice on how to alter equation or ways of getting the square root of a number > 524287 in the Starcraft Editor

    Posted in: Triggers
  • 0

    posted a message on [Solved] How to make a shield effect (Guardian Shield) around a structure?

    That fixed it, although it's now a static circle rather than more of a shield, I'm just glad I got somewhere with this. 

    Posted in: Data
  • 0

    posted a message on [Solved] How to make a shield effect (Guardian Shield) around a structure?

    In reply to DrSuperEvil:

     
    No, when the behavior is removed the model actor is removed.
    My point was that, unlike the shield actor, it doesn't just stop after 35 seconds even when it should be there.
     
    ShieldGenerator is the always running behavior which periodically runs a few effects for the shield generator, one of those effects creates ShieldGeneratorOn. Only ShieldGeneratorOn should be linked to the actor and that's fixed now. As a result, the shield now comes back after being attacked.
    My only remaining problem is that the shield actor doesn't remain for more than 35 seconds. Looking at the shield generator in the cutscene editor, I saw the animation was 5 seconds long although I don't really know how the cutscene editor works.
    Posted in: Data
  • 0

    posted a message on [Solved] How to make a shield effect (Guardian Shield) around a structure?

    In reply to DrSuperEvil:

     
    Marine doesn't come back after "shield on" behavior comes back but stays forever.
    Means something wrong with the way I create the actor in events and in the way I renew the animation?
    Posted in: Data
  • 0

    posted a message on [Solved] How to make a shield effect (Guardian Shield) around a structure?

    In reply to DrSuperEvil:

     
    Always has been the following:
    Shield Generator On Duration = 1.2
    Shield Generator Behavior (To periodically run effects) Period = 1
     
    Tried removing (Has Shields) Validator from set effect, actor doesn't disappear when shields are gone, but still disappears after 33 seconds or so
    Posted in: Data
  • 0

    posted a message on [Solved] How to make a shield effect (Guardian Shield) around a structure?

    In reply to DrSuperEvil:

     
    Even with Play Forever flag, the animation still stops after 35 seconds. Any way to slow it down so it would last let's say a few hours to make sure there would be no problems?
    I checked closely and buff does have periodic lapses in duration as shown:
    1. Shield Generator Created, buff is present
    2. Shield Generator Shot, no shields left and buff gone
    3. Shields back and so is buff, no actor
     
    Posted in: Data
  • 0

    posted a message on [Solved] How to make a shield effect (Guardian Shield) around a structure?

     

    After some investigating on how sentries use the guardian shield I ended up taking the following steps:

     

    The Shield Generator behavior periodically runs a Create Set with a validator for "has shields". This set runs the Search Effect (for my shield generator's functionality) and an Apply Behavior. The applied behavior is called Shield Generator On. In the Shield Generator On Actor (copied from Guardian Shield) the actor is created when the behavior turns on and the animation stops when the behavior turns off. This works in creating a shield effect and removing it when the shield is destroyed.

     

     

    However, there are two major problems:
    1. The shield expires after 31 seconds (I assume it's because the animation only lasts for this long, any way to extend it or to refresh it? I'm bad with data editor)
    2. Shields don't come back after going away
    Posted in: Data
  • 0

    posted a message on [Solved] How to make a shield effect (Guardian Shield) around a structure?

    How to make a shield effect (Guardian Shield) around a structure? I've tried to attach in events but didn't work. Shield should disappear when the structure's shields run out.

    Posted in: Data
  • 0

    posted a message on Creating "map modes" for my map [Solved]

    UI Elements are probably the best solution, however, after looking into it text tags aren't that bad in comparison and much easier. Sending actor message for tint wouldn't work well because different players would have different "map modes" selected.

    Posted in: Triggers
  • 0

    posted a message on [Solved] Attributes as a substitute for custom values? Would this cause more or less lag?

    Thanks guys, I think I'll stick with custom values and text tags then

    Posted in: Data
  • 0

    posted a message on [Solved] Attributes as a substitute for custom values? Would this cause more or less lag?

    The buildings in my map have a lot, important custom values that tie into player income (not really affecting the unit itself). I wished there was a better way of displaying these custom values. Soon after, I looked into using attributes as a substitute.

     

    These attributes would be changed very constantly and would range from negatives to positives in the millions (but less than 5 million)

     

    My question is: Are attributes less laggy that custom unit values when used for this purpose? 

    Posted in: Data
  • 0

    posted a message on Creating "map modes" for my map [Solved]

    In my map, there are a lot of important "custom unit values" (somewhere about 20). It's very hard for me to convey these values to players without some sort of visual mapmode. Right now, you can click a button to create text tags for 20 seconds (colored by value). However, I'm looking for something more visual, hopefully, that can show on the minimap as well. 

     

    Here is an example: Each building needs food, represented as custom value #4. You click a button and all buildings with high food stocks show up in green while starving buildings show up in red. Maybe through an effect, or simply changing the unit's color. Does somebody who know the editor well know if there is a way out there to effectively display this information in a "Map mode"? 

    Posted in: Triggers
  • 0

    posted a message on How to make a unit die after a set time? [Solved]

    Hey guys, I'm trying to get a unit to die after 60 seconds of being alive similar to the swarm host in regular Starcraft 2. I tried looking at how the swarm host does it but couldn't find anything. These temporary units would be spawned via trigger.

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