Is there higher praise? Im dancing in my room right noaw... :DFLOZi wrote:Speed is a float so that should be fine. Picasso is probably on the right track

Moderator: Moderators
Is there higher praise? Im dancing in my room right noaw... :DFLOZi wrote:Speed is a float so that should be fine. Picasso is probably on the right track
Code: Select all
[f=0005778] LuaRules::RunCallIn: error = 2, GameFrame, [string "LuaGadgets/Gadgets/unit_script.lua"]:745: attempt to index field '?' (a nil value)
stack traceback:
[string "LuaGadgets/Gadgets/unit_script.lua"]:745: in function 'GameFrame'
[string "LuaGadgets/gadgets.lua"]:936: in function <[string "LuaGadgets/gadgets.lua"]:934>
(tail call): ?
Code: Select all
buildoptions =
{
"cyberfac",
"cybergen",
"cyberlord",
},
No idea really. Maybe try switching the order of the entries in buildoptions to see if something happens.For some reason this only gives me the build option to make the fac, not the gen or the lord.
Don't think so.Is there somthign differnt between mobile and non-mobile builders that means that list won't work?
that is to get what unit a player is currently FPS-controlling.>>Spring.GetPlayerControlledUnit
is the tool of choice if you want to find out if "your" unit is the currently selected?
Take the comma out form the last entry:aGorm wrote:Ok, so progress moves forward, and I've hit another problem.
Namly,For some reason this only gives me the build option to make the fac, not the gen or the lord. I know the lord should be buildable because the fac can build it and several other units fine. However thsi mobile builder only seems to be able to build the fac and nothign else.Code: Select all
buildoptions = { "cyberfac", "cybergen", "cyberlord", },
I also know the gen unit works cause I can /give myself one and it comes out fine.
Is there somthign differnt between mobile and non-mobile builders that means that list won't work?
aGorm
Code: Select all
buildoptions =
{
"cyberfac",
"cybergen",
"cyberlord"
},
http://www.lua.org/pil/3.6.htmlYou can always put a comma after the last entry. These trailing commas are optional, but are always valid:
Such flexibility makes it easier to write programs that generate Lua tables, because they do not need to handle the last element as a special case.Code: Select all
a = {[1]="red", [2]="green", [3]="blue",}
Finally, you can always use a semicolon instead of a comma in a constructor. We usually reserve semicolons to delimit different sections in a constructor, for instance to separate its list part from its record part:
Code: Select all
{x=10, y=45; "one", "two", "three"}
This is why we ignore Forb,aGorm wrote:Sorry, I fixed this but never thought to post back here... it was actully a lot more simple. Nothing was wrong with the code. It was just I had a back up of teh file in a subdirectory of units, not realising it would load up any file in a sub over the one in the root...
aGorm
Code: Select all
local function PlayUnitSound(unitID, sound, volume)
local x,y,z = Spring.GetUnitPosition(unitID)
local dx,dy,dz = Spring.GetUnitVelocity(unitID)
Spring.PlaySound(sound, volume or 1, x,y,z, dx,dy,dz, "unitreply")
end
GG.PlayUnitSound = PlayUnitSound
Code: Select all
local PlayUnitSound = GG.PlayUnitSound
...
PlayUnitSound(unitID, "sayhitoknorke")