Page 2 of 4
Re: Tech Requirements
Posted: 23 Oct 2009, 02:26
by zwzsg
Oh wait, the bug in Red UI is easy enough that I can find it myself.
In gui_red_buildordermenu.lua replace
Code: Select all
if (cmd.disabled) then
icon.texturecolor = {0.5,0.5,0.5,1}
end
by
Code: Select all
if (cmd.disabled) then
icon.texturecolor = {0.5,0.5,0.5,1}
else
icon.texturecolor = {1,1,1,1}
end
I guess Regret considered unit getting disabled before game, but not unit getting re-enabled mid-game. Though, his code would still be buggy anyway, since the same position doesn't always have the same command.
Re: Tech Requirements
Posted: 23 Oct 2009, 03:37
by Forboding Angel
YAY!!! Thank you!
I like using redui because it's a pretty good gui with a lot of nice features. It has some issues (as you've seen so far) but there aren't many alternatives, sadly.
I wish there was some sort of gui that could be used by moddevs to basically be able to do what you want with the stuff in spring. Unfortunately, meh, we got to live with what we get I guess.
Edit: Tested and it works perfectly, z you are awesome. Thanks so much!
Re: Tech Requirements
Posted: 23 Oct 2009, 23:33
by PTSnoop
For the Multi-Tech Advanced version, the comment gives instructions about how to add RequireTech and ProvideTech to TDF files. What would I need to write for Lua unitdefs?
I've tried
Code: Select all
CustomParams = {
ProvideTech = cuberes1,
},
and
Code: Select all
CustomParams = {
RequireTech = cuberes1,
},
but you can still build the second building without needing the first.
Re: Tech Requirements
Posted: 23 Oct 2009, 23:39
by CarRepairer
PTSnoop wrote:For the Multi-Tech Advanced version, the comment gives instructions about how to add RequireTech and ProvideTech to TDF files. What would I need to write for Lua unitdefs?
I've tried
Code: Select all
CustomParams = {
ProvideTech = cuberes1,
},
and
Code: Select all
CustomParams = {
RequireTech = cuberes1,
},
but you can still build the second building without needing the first.
Put quotes around cuberes1 like so: 'cuberes1'
Re: Tech Requirements
Posted: 24 Oct 2009, 00:20
by PTSnoop
It's working now. Thanks!
(It's always the quote marks, isn't it...)
Re: Tech Requirements
Posted: 24 Oct 2009, 15:59
by zwzsg
You can see in previous page Forboding Angel posting exemple in Lua unitdefs syntax.
Re: Tech Requirements
Posted: 15 Nov 2009, 16:26
by PTSnoop
Would I be able to use Multi_Tech.lua to have units as unable to move until a research building is built? (The basic plan is for all buildings to suddenly gain the ability to hover around the map.)
I've had a bit of a look at the instructions at the top of the lua file, and I'm still a bit confused. I'm using Lua unit animation; would I be able to put a GG.TechCheckCommand(commandID, teamID) somewhere to stop the unit from moving? If so, how would I actually do that? Or would I have to make a separate gadget to handle this?
Re: Tech Requirements
Posted: 15 Nov 2009, 16:29
by FLOZi
luaunitscripts are actually part of luarules, so yes you can access GG from them.
Re: Tech Requirements
Posted: 05 Dec 2009, 17:52
by daryl
hi zwzsg,
it is possible to hide the "morph" command/button of a unit until the contruction of a research lab unit ??
so could you post a lua example please??
thx!!
Re: Tech Requirements
Posted: 08 Dec 2009, 01:04
by zwzsg
Uh, yes, most probably. Where did you take your morphing code from?
Re: Tech Requirements
Posted: 08 Dec 2009, 09:06
by daryl
zwzsg wrote:Uh, yes, most probably. Where did you take your morphing code from?
i took the script from this topic
http://springrts.com/phpbb/viewtopic.ph ... 19#p385419
and you need the "colors.h.lua" file.
So.. I post the .zip file that contains all file needed to work!
I would like "hide", if possible, ( not disable ) the morph/upgrade button until the construction of determined unit.
If isn't possible hide, it's ok!... no problem..
So, for my mod i would like add the research lab that research new technology ( this laboratory will create invisible unit = technology )
for example:
when the research of commander update is done, X invisible unit is created by research lab and this x unit activate the "morph/upgrade" button.
( so i don't know more simple alternative at the moment to do this kind of research lab

)
thx for your help!!
Re: Tech Requirements
Posted: 08 Dec 2009, 19:52
by zwzsg
I've just stray files, not a mod, so I can't test. What I would try is:
File: unit_morph.lua
Function: UpdateMorphReqs
Between: morphCmdDesc.disabled = ...
And: morphCmdDesc.tooltip =
So between line 281 and 282
Add a new line:
morphCmdDesc.hidden = not GG.TechCheck(morphDef.RequireTech,teamID)
And also in AllowCommand, in the big if, between "(morphDef.xp<=Spring.GetUnitExperience(unitID))and" and "(UnitReqCheck(teamID, morphDef.require)) )", add "(GG.TechCheck(morphDef.RequireTech,teamID))and".
In morph_defs.lua add some RequireTech field like you did already for the first one. And use together with my Better_Ranged_Counted_Multi_Tech.lua
Re: Tech Requirements
Posted: 08 Dec 2009, 20:59
by daryl
zwzsg wrote:I've just stray files, not a mod, so I can't test. What I would try is:
File: unit_morph.lua
Function: UpdateMorphReqs
Between: morphCmdDesc.disabled = ...
And: morphCmdDesc.tooltip =
So between line 281 and 282
Add a new line:
morphCmdDesc.hidden = not GG.TechCheck(morphDef.RequireTech,teamID)
And also in AllowCommand, in the big if, between "(morphDef.xp<=Spring.GetUnitExperience(unitID))and" and "(UnitReqCheck(teamID, morphDef.require)) )", add "(GG.TechCheck(morphDef.RequireTech,teamID))and".
In morph_defs.lua add some RequireTech field like you did already for the first one. And use together with my Better_Ranged_Counted_Multi_Tech.lua
hi zwzsg,
I tested your modified unit_morph.lua Script but doesn't work at the moment.
I copied your file in \LuaRules\Gadgets and i didn't modified the morph_defs.lua in \LuaRules\Configs directory.
you know there are those fields in morph_defs.lua:
[...]
armcom = {
into = 'armcom1',
tech = 0,
time = 120,
metal= 600,
energy= 2000,
RequireTech = 'armham', -- ( for example arm hammer )
--xp = .05,
[...]
morph button appear from the start of the game and i can morph my commander withouth the construction of an arm hammer unit but, when I click on morph button an error appear. I post an image of this error. I hope this can help you!!..
thx again!!
Re: Tech Requirements
Posted: 15 Dec 2009, 02:07
by zwzsg
Any way I could grab your W.I.P. mod?
Rebuilding a whole mod just to plug these gadgets so I can start debugging is an unenticing task.
Re: Tech Requirements
Posted: 15 Dec 2009, 17:19
by daryl
zwzsg wrote:Any way I could grab your W.I.P. mod?
Rebuilding a whole mod just to plug these gadgets so I can start debugging is an unenticing task.
sure..
i just started with this mod!.. so it's based on BA 7.01 but i have too many things to do!! ( i want upgrade models geometry, textures, add this research lab option, add some OTA 3ds party units and remodel it, etc! ).
first of all i need this "research lab"!. I need to know if it is possible to do.
download this mod at:
http://www.totalannihilation.it/files/m ... v0.26a.sd7
if you want, i can give you my msn contact.
thx again!
bye!!
Re: Tech Requirements
Posted: 16 Dec 2009, 21:33
by Forboding Angel
*sob*
./facepalm
Re: Tech Requirements
Posted: 19 Dec 2009, 00:28
by zwzsg
Daryl: So, I had a look at it today, an uh.... You don't even need my gadget at all! The morph gadget you use already support a "require" tag in morph_defs.lua. (And also you need to put the unit id of the required unit in morph_defs.lua where it's said to add it)
Re: Tech Requirements
Posted: 19 Dec 2009, 08:13
by daryl
zwzsg wrote:Daryl: So, I had a look at it today, an uh.... You don't even need my gadget at all! The morph gadget you use already support a "require" tag in morph_defs.lua. (And also you need to put the unit id of the required unit in morph_defs.lua where it's said to add it)
oi really?
it's ok!!!!!!!
I will need morph + Better_Ranged_Counted_Multi_Tech.lua becouse (example) I need to morph a x unit only when I researched a y tech. ( I will build an y invisible unit corresponding at y tech -> y tech = researched -> x unit can morph). But I need to research this tech ( build this invisible unit) only 1 time!!! I can do this with your script!...
" RequireTech=y unit;
ProvideTech=-y unit;
"
without this I can research 1000 time the same tech ( i build 1000 invisible units corresponding at y tech )
ok "problem" 99,9% solved.
it is possible lock the button of units that you can have only one at a time?
thx again!!!!!!!!!!!!
Re: Tech Requirements
Posted: 19 Dec 2009, 17:06
by zwzsg
In the FBI of Arm hammer, add:
UnitRestricted=1;
Re: Tech Requirements
Posted: 19 Dec 2009, 19:39
by daryl
zwzsg wrote:In the FBI of Arm hammer, add:
UnitRestricted=1;
aah ok!!!
yes it is working!!!
thx zwzsg !!!!!!!!!!!!!!!!!