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?
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:
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".
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.
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.
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.
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!
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?
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.
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.
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?
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.
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.
0
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?
0
Lightning!!!! Of course! (@!#?@! editor...)
You clearly deserve this:
0
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:
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?
0
Basically, a custom tactical AI is a function of a predefined prototype, that suggests (or not) an order.
The general layout is this:
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:
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
0
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.
0
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?
0
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.
0
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...
0
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?
0
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.
0
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.
0
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.
0
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?
0
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.
0
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.