An experimental MorphInto method has also been added to the engine unit object, it takes a unit type object as a parameter and returns true/false.
It's assumed the Morphing implementation takes the command ID 32210 and takes the unit definition ID as its first parameter. Thanks to Knorke for the help.
This is built from git master, so it includes a raft of stability fixes and safeguards, the things I mentioned in the previous posts, and a lot of other small changes and architectural improvements.
Please use this build if you're developing with Shard or using it for your game, so that I can iterate quickly in the coming days.
function map:GetMapFeaturesAt(position,radius) local m = game_engine:Map() local fv = m:GetMapFeaturesAt(position,radius) local f = {} local i = 0 if fv:empty() then fv = nil return nil else while i < fv:size() do table.insert(f,fv[i]) i = i + 1 end fv = nil return f end end
My theory at the moment is that it could not handle the API returning no units. If true I'll modify the other functions accordingly, but I'm at work so I can't test atm
nope thats not it, i tried by grabbing all features on the map which has plenty of them. The error should be somwhere within the function since it has to do with the variable fv which is not even returned.
Also it would be really usefull to have not only a list of all functions that are available but also some example calls as there are some non intuitive things there.
I'm new to the Forum, but have played Spring for the last 3 or 4 years, and now i decide to write my own BA config for Shard, but i have a serious Problem:
My LUA skills are Bad...
I need your Help.
For my Build units i try to check how much units from a specific Typ are aleready build. (i.e. How many Solar Collectors are build) Is there a way to count all units and see how many of them are Solar Collectors? I Try fiddling arround with game:GetUnits, but i dont realy understand how it works. I am able to count all Units, but how can i find out how many are Solar Collectors
I have read through the Whole Thread, and looked into other Shard Config files, but i dont get it...
Maybe someone can explain it to me? In this Thread or via PN...
This module will have a table such that tableobject[unittype] = XofThisType
Everytime a unit of yours is built, increment the number
Decrement on unit death
To get the number of units for say a corsolar, all you would need to do now is local solarCount = tableobject["corsolar"] or something similar.
We currently have something similar to this already to count factories for evo, and I'm thinking this is such a nice example of a module I'll probably write up a tutorial when I get home ( yay ). The code Erik posted above has 2 behaviours that do the same thing, basically acting as tags on a unit and doing nothing more than incrementing and decrementing a number on creation and death.
AttackBehaviour also does very little too, when an attack is built, it says to the Attack Handler, I'm here, and waits. It does this every time the attack is idle.
All in all you should be able to go quite far with just modifying taskqueues for BA, but there are a lot of primitive simple behaviours that will help a lot.
first of all i have to Thank you for your great AI. I played al lot of games against NTai a few years ago, but Shard is much better, i think.
I hope i can follow your instructions...
I have seen the 'Unit Inventory' stuff in the EvoRTS Config, but it seems very complex. (for me) I will try modify that functions for my BA Config if no one is angainst that.
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum