• 0

    posted a message on Day time events

    Finally got my day / night cycle to work!

    Which got me to try to find out what the current time is.
    The only thing however I found that has anything to do with day time is "get day length in game seconds".
    I was hoping for an event like "current time of day is 5:45".

    The "lights" object also defines, by default, something it calls "Time events+" (with keys e_gameTimeEventDawn and e_gameTimeEventDusk).
    Perhaps there is some way to wait for those?

    Any thoughts on this one?

    Posted in: Triggers
  • 0

    posted a message on [Solved] Lighting settings (was: 8bit textures...)

    Lightning!!!! Of course! (@!#?@! editor...)

    You clearly deserve this:
    http://i.imgur.com/h3V7x.jpg

    Posted in: Terrain
  • 0

    posted a message on [Solved] Lighting settings (was: 8bit textures...)

    http://i.imgur.com/8Sz4J.jpg

    That's what my terrain editor view normally looks like.

    Now, through the miracles of an unknown magical key combination,
    it now looks like this:

    http://i.imgur.com/upeoF.jpg

    A reduction to 8bit textures?
    Looks normal in game.
    Preferences / video is still set to "match game settings".

    So, question, how do I get it back to normal?

    Posted in: Terrain
  • 0

    posted a message on Attaching custom tactical AI scripts to units

    Basically, a custom tactical AI is a function of a predefined prototype, that suggests (or not) an order.

    The general layout is this:

    SomeCuteName
        Options: Action
        Return Type: (None)
        Parameters
            Owner = 0 <Integer>
            Caster = No Unit <Unit>
            Targets = (Empty unit group) <Unit Group>
        Grammar Text: SomeCuteName(Owner, Caster, Targets)
        Hint Text: (None)
        Custom Script Code
        Local Variables
        Actions
    

    You create one through "New action definition".

    The parameters are all required, with the given type and in this order.
    Owner is the owner (player) of the unit,
    Caster is the unit itself,
    and Targets is a unit-group with pretty much everything "nearby" the caster.
    The names are up to you.

    However, regardless of what filtering or other options you put in the AI data, this only ever includes enemy units!
    No idea if that's a bug, a feature or if my testing didn't quite work...

    Anyway, works well with the default settings, and really includes anything enemy nearby, including missiles.

    And, well, what exactly you are doing inside the Actions part is completely up to you.

    To get it to work:
    - the player must be computer controlled
    - you run the action "AI - Start the campaign AI" for that player.

    If there are pre-placed units (includes those the computer gets through "Melee - Create starting units",
    run "AI - Disable script control" on each one.

    If you feel like it, you can also run "AI Advanced - Set the APM count for ... to ..." for that player.
    Yes, they do play "better" (where better means faster that is) with higher numbers.
    300 feels somewhat slow, whereas at 3000 things are really starting to roll.

    Here's a complete, working example that's running in my map:

    AI_Infestor
        Options: Action
        Return Type: (None)
        Parameters
            ParamOwner = 0 <Integer>
            ParamCaster = No Unit <Unit>
            ParamTargets = (Empty unit group) <Unit Group>
        Grammar Text: AI_Infestor(ParamOwner, ParamCaster, ParamTargets)
        Hint Text: (None)
        Custom Script Code
        Local Variables
            LocalOrder = No Order <Order>
            LocalFilter = (Create AI Filter for ParamOwner) <AI Filter>
            LocalGroup = (Any units in (Region((Position of ParamCaster), 8.0)) owned by player ParamOwner matching Required: Visible; Excluded: Self, Structure, Resource (Raw), Resource (Harvestable), Missile, Destructible, Item, Uncommandable, Stasis, Under Construction, Dea <Unit Group>
            LocalUnit = No Unit <Unit>
            LocalEnemies = (Create AI Filter for ParamOwner) <AI Filter>
        Actions
            ------- -------
            ------- Suggest aggressive spell on enemies
            ------- -------
            ------- Make sure it s enemies only
            AI Advanced - Tactical AI Filter - include only Enemy Units in LocalEnemies
            ------- No more than range of the ability
            AI Advanced - Tactical AI Filter - limit search radius in LocalEnemies to 9.0 around ParamCaster
            ------- Some filtering
            AI Advanced - Tactical AI Filter - remove units from LocalEnemies that have less than 10.0 or more than 500.0 life
            ------- Some more filtering
            AI Advanced - Tactical AI Filter - include only Required: Visible; Excluded: Self, Structure, Resource (Raw), Resource (Harvestable), Missile, Destructible, Item, Uncommandable, Cloaked, Stasis, Dead, Hidden, Hallucination, Invulnerable in LocalEnemies
            ------- Get a group of potential targets, based on the previous filter
            Variable - Set LocalGroup = (Create a new unit group by running LocalEnemies on ParamTargets)
            ------- Suggest a target
            Variable - Set LocalOrder = (InfestorDamageAbility targeting (Unit 1 from LocalGroup))
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (LocalOrder is valid for ParamCaster) == true
                Then
                    ------- Order is valid, suggest using it
                    AI - Suggests order LocalOrder to ParamCaster using tactical AI logic
                    ------- Done here, forget the rest
                    General - Skip remaining actions
                Else
            ------- -------
            ------- Suggest helping spell on friendly units
            ------- -------
            ------- Friends only
            AI Advanced - Tactical AI Filter - include only Allied Units in LocalFilter
            ------- No more than range of the ability
            AI Advanced - Tactical AI Filter - limit search radius in LocalFilter to 8.0 around ParamCaster
            ------- Some filtering
            AI Advanced - Tactical AI Filter - remove units from LocalFilter that have less than 10.0 or more than 500.0 life
            ------- Get a group of potential targets, based on the previous filter
            Variable - Set LocalGroup = (Create a new unit group by running LocalFilter on LocalGroup)
            ------- Some more manuel filtering
            Unit Group - For each unit LocalUnit in LocalGroup do (Actions)
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            (LocalUnit Life (Current)) > ((LocalUnit Life (Default)) * 0.6)
                        Then
                            Unit Group - Remove LocalUnit from LocalGroup
                        Else
            ------- Suggest a target
            Variable - Set LocalOrder = (InfestorHealingAbility targeting (Unit 1 from LocalGroup))
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (LocalOrder is valid for ParamCaster) == true
                Then
                    ------- Order is valid, try using it
                    AI - Suggests order LocalOrder to ParamCaster using tactical AI logic
                Else
    

    It's perhaps a bit unreadable from all the filtering, which makes for very long lines...

    The short version is that it tries to target an enemy with a damage spell.
    If that doesn't work, it tries a healing spell on a friend.
    If neither works... well, we're just going to try it again next time.

    Filtering is, of course, somewhat required.
    You really want to make sure to get a working target, and, obviously, a target worthy of your attention.

    The other important part is how to get and check for the validity of an order.

    Of course, you also have to put it on the unit:

    Open menu: Data / View script.
    Scroll down a bit to a section called "Global Function Declarations".
    You'll see something like:
    void gf_AI_Infestor (int lp_Owner, unit lp_Caster, unitgroup lp_Targets);

    You want the "gf_AI_Infestor" part.
    Put that string in your unit's "AI - tactical AI function".

    Good fun, have luck

    Posted in: Triggers
  • 0

    posted a message on Morph actor...

    After looking and playing (for lack of a better word, can't really call it testing or so) with "zerg building ..." for way too long,
    I came to the conclusion that this is simply impossible.

    What I'm currently doing is using a from scratch Zerg structure and a Zerg Building based actor that uses the ZergbuildingBuild2x2 model.
    And the actor, in order, at creation, tells it to "animation play" build-b-start, limited in time duration, followed by build-d-start (the "explosion").
    The actor then destroys itself and the new structure's actor gets a create on abilmorph.finish.

    While that looks OK, and, actually, it's very difficult, if not nearly impossible, to tell the difference,
    that's very clearly not the way that every other Zerg structure in existence is doing it.
    All they need to do is actor-create-zergbuildingbuild...

    Well, some day perhaps...
    Until then, this will do.

    Posted in: Data
  • 0

    posted a message on Morph actor...

    I have this ability where you throw a Creep Tumor at a target spot, the Tumor settles in and automatically (through a morph ability) starts to morph into the final structure.
    All of this works as expected.

    What I'd like to do is add the usual Zerg building / construction thingy.
    You know, that kind of blob thing when they start being constructed.

    And, well, I tried different things here and there, had a look at plenty of Zerg morphings,
    but have still no idea where to start, or even what actor might be of use here.

    Ehm... help?

    Posted in: Data
  • 0

    posted a message on [Solved] Hero level on hover

    Done.

    Though, frankly, after wading through way too many validators and other checks, I'm beginning to question the validity of Blizzard's choice to start at 0.

    Posted in: Data
  • 0

    posted a message on [Solved] Hero level on hover

    Well... yet again one of those mapping moments :P

    Yes, all you have to do is uncheck the unit's "no tooltip" flag.
    Thing is, it won't show (no level info that is, just the unit's name) on Heroes that are level 0!

    Now, since my Heroes start at 0...

    Posted in: Data
  • 0

    posted a message on [Solved] Hero level on hover

    Is there a way to get a Hero unit to show its level (sort of like a tooltip) when you mouse over it?
    Seems that should be a simple option somewhere... or isn't it?

    Posted in: Data
  • 0

    posted a message on Command card - use next free spot?

    I guess that's what Eiviyn meant with "creative" :P

    Ehm, yeah, I guess I'll just go with 8 abilities to choose from, which makes for a nice 4x2 that I can fit in.

    Posted in: Data
  • 0

    posted a message on Command card - use next free spot?

    In the beginning, there was a Hero.
    And he could level, get some Hero points, learn whatever and use it happily ever after.

    So, in short, my Hero has a leveling and learning "system" in place that works.

    What I would like to do though is give that Hero, say, 10 abilities to chose from, but he'll only ever be able to learn 4 of them.
    Problem being that I have to reserve all those potential buttons' spaces on the main command card in advance.
    There's not room enough to do so.

    Now, given he'll only ever have 4 of them at most, is there some way to just have them show up... I don't know, like in the next free spot?
    Something like the first 4 bottom spaces and the abilities show up there in the order they are learned?
    The entire thing without reserving all those card spots.

    Posted in: Data
  • 0

    posted a message on Unit compare veterancy level

    Well, there's also some stuff on behaviors like "this behavior won't be disabled if this vlalidator doesn't return false".
    Good luck figuring it out.
    And that's for the things with help text.

    And, yes, later on that same unit, at a higher level, morphs one more time.
    Sure enough, with the same idea that not testing for the wrong level won't do it... works just fine with a similar condition.

    Let's just hope Blizzard will never "fix" that.

    Posted in: Data
  • 0

    posted a message on Unit compare veterancy level

    Behavior: my veterancy behavior
    compare: equal to
    unit: caster
    value: 1

    Used as validator on a morph ability (autocast validator as well as validator array) that is supposed to instantly (autocast) morph the unit into another type as soon as it reaches level 1.

    But, well, as expected, that just doesn't work.

    Depending on the validator settings, the unit either morphs the very second it enters the map, or it never ever even thinks about morphing.
    My current conclusion is that that validator type it broken and, instead of counting the level, it only "counts" (as yes / no) whether or not the unit has that behavior.

    Of course, I'm probably wrong.

    Any help?

    Edit:
    After setting it to "not equal to 1" it works???
    Which is... great? I guess. But why?

    Posted in: Data
  • 0

    posted a message on [Solved] Trained unit to move to caster

    Units involved:
    Queen: with an ability of type effect instant
    Egg: the result of a modified spawn larva behavior
    Zerglings: expected result of using the ability on an egg

    Eggs belong to the owner of the hatchery that spawned them.
    Can be anyone, including you, any enemy player or neutral.

    Upon use, the ability runs an effect search area.
    Search area has range 7, any direction, minimum 1, maximum 1 and a working error message if no usable eggs are in range.

    It applies an effect persistent to whatever it finds.

    The persistent effect uses a combined validator checking for unit type = egg and order count train = 0.
    Seems to work as it only targets eggs that aren't busy currently (training isn't instant, it takes 5 seconds).

    It runs an effect initial to change the owner of the egg to the caster.
    Done with an effect modify unit with owner checked in modification flags; everything else, launch, impact, transfer being default.
    Assumed to work since you do end up with Zerglings that are yours.

    The persistent then continues with a periodic effect. One single effect running once.
    It's of type issue order and tells (none):target to train:0.

    Train is an ability of type train on the eggs.
    With one option set (train01) to 2 Zerglings.
    Considered working, based on the observation that each successful cast on an egg produces two Zerglings.

    No other effects on that persistent.

    The train ability applies an effect of type issue order on each Zergling.

    That issue order is supposed to order the Zerglings to attack to, move to, or just whatever really to the original caster.

    Unit+ is set to (none):target.
    Seems correct as, depending on the target setting, they do indeed start to run... to the lower left bottom corner of the map.

    Which brings me to target+.
    I tried all caster/source/outer/... unit, point and unit/point variations without any effect, and without any result. (or perhaps there was one that said corner)

    With an effect?
    You pretty consistently get them to run to the bottom corner.
    Occasionally they don't run at all, which I assume means they were ordered to run to their current position.

    Posted in: Data
  • 0

    posted a message on [Solved] Trained unit to move to caster

    I'm currently ignoring units that are currently training (i.e. have a train order).
    Works perfectly.

    For the moving to caster part... well, I thought if the prophet doesn't go to the mountain...
    Have the trained units look for a nearby caster and walk there.

    Sounds simple enough, train launches a search area, unit type validator, issue order, done.
    Needless to say that one doesn't work either... they don't even go to the bottom left. Really just nothing at all.

    Business as usual.

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