Unit Descriptions

Everything about mods can be found here.

Moderator: Morax

Unit Descriptions

Postby RavenCurow » 08 Sep 2016, 16:01

Okay, so I'm trying to add unit descriptions to my units so people can tell what they do. I've added a unit descriptions lua in my hook/lua/ui/help folder. I've added all my descriptions. I've added the necessary code in my unit <LOC UAC1101c_desc> etc, but nothing shows up in the little tooltip box under the ability list. Also, nothing shows in the error log as being amiss so I'm completely lost.
RavenCurow
Avatar-of-War
 
Posts: 98
Joined: 30 Oct 2014, 01:17
Has liked: 1 time
Been liked: 14 times
FAF User Name: RavenCurow

Re: Unit Descriptions

Postby Uveso » 08 Sep 2016, 18:47

\lua\ui\help\unitdescription.lua :)
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Unit Descriptions

Postby RavenCurow » 09 Sep 2016, 00:30

Still no dice.
RavenCurow
Avatar-of-War
 
Posts: 98
Joined: 30 Oct 2014, 01:17
Has liked: 1 time
Been liked: 14 times
FAF User Name: RavenCurow

Re: Unit Descriptions

Postby RavenCurow » 09 Sep 2016, 00:35

If it helps here is my code.

Code: Select all
-----------------------------------------------
-- File     :  lua/ui/help/unitdescriptions.lua
-- Author(s):  RavenCurow
-- Descriptions for new units in Civilians V2
-----------------------------------------------

Description = {

-- Cybran
['URC1101c'] = "<LOC Unit_Description_02001> The Cybran Residential Structure is an all purpose utility structure that boosts the efficiency of adjacent structures.",
['URC1201c'] = "<LOC Unit_Description_02002> The Cybran Science Facility is a prototype power generator producing more energy than the Antimatter Reactor but less than a Quantum Reactor.",
['URC1301c'] = "<LOC Unit_Description_02003> The Cybran Admin Structure produces a small cloaking field the obscures line-of-sight for all buildings in its operational radius.",
['URC1302c'] = "<LOC Unit_Description_02004> The Cybran Comm Station is equipped with a sophisticated long range radar system that is a considerable improvement over the standard T2 Radarbut at the cost of increased energy consumption and production costs.",
['URC1401c'] = "<LOC Unit_Description_02005> The Cybran Agricultural Center produces and stores biomass in exchange for high energy costs.",
['URC1501c'] = "<LOC Unit_Description_02006> The Cybran Manufacturing Facility produces and stores parts for adjacent buildings increasing mass storage capabilities and the construction rates of adjacent structures.",
['URC1901c'] = "<LOC Unit_Description_02007> The QAI Secondary Mainframe gives a moderate efficiency boost to all adjacent buildings in your grid.",
['URC1902c'] = "<LOC Unit_Description_02008> The Cybran Network Node gives a large energy adjacency bonus to adjacent energy using buildings.",
['XRC1101c'] = "<LOC Unit_Description_02009> The QAI Jamming Station is an Experimental Stealth Field generator with exceptional rangebut a higher energy cost. Countered by Omni sensors.",
['XRC1501c'] = "<LOC Unit_Description_02010> The Samantha Carter Stature houses an experimental command suit that automatically assits or repairs anything in its operational range. It also contains all the blueprints necessary to build a basic army from scratch.",
['XRC2201c'] = "<LOC Unit_Description_02011> The QAI Mainframe houses and Experimental Omni Sensor Jammer that emits quantum pulses that reduce the operational range of all Omni Sensors in its operational radius.",

-- UEF
['UEC1101c'] = "<LOC Unit_Description_01001> The UEF Residential Structure is an all purpose utility structure that boosts the efficiency of adjacent structures.",
['UEC1201c'] = "<LOC Unit_Description_01002> The UEF Science Facility is a prototype power generator producing more energy than the Antimatter Reactorbut less than a Quantum Reactor.",
['UEC1301c'] = "<LOC Unit_Description_01003> The UEF Secondary Administrative Structure is equipped with a sophisticated long range radar system that is a considerable improvement over the standard T2 Radarbut at the cost of increased energy consumption and production costs.",
['UEC1401c'] = "<LOC Unit_Description_01004> The UEF Agricultural Center produces and stores biomass in exchange for high energy costs.",
['UEC1501c'] = "<LOC Unit_Description_01005> The UEF Manufacturing Facility produces and stores parts for adjacent buildings increasing mass storage capabilities and the construction rates of adjacent structures.",
['XEC1301c'] = "<LOC Unit_Description_01006> The UEF Administrative Structure is an Experimental Stealth Field generator with exceptional rangebut a higher energy cost. Countered by Omni sensors.",
['XEC1401c'] = "<LOC Unit_Description_01007> UEF High Command provides complete line-of-sight within its operational area at no energy costbut can only be build on Hydrocarbon deposits. It has a small defensive shield to protect point defense emplacements.",
['XEC1501c'] = "<LOC Unit_Description_01008> The Samantha Carter Stature houses an experimental command suit that automatically assits or repairs anything in its operational range. It also contains all the blueprints necessary to build a basic army from scratch.",

-- Aeon
['UAC1101c'] = "<LOC Unit_Description_03001> The Aeon Residential Structure is an all purpose utility structure that boosts the efficiency of adjacent structures.",
['UAC1201c'] = "<LOC Unit_Description_03002> The Aeon Science Facility is a prototype power generator producing more energy than the Antimatter Reactorbut less than a Quantum Reactor.",
['UAC1301c'] = "<LOC Unit_Description_03003> The Aeon Administrative Structure is equipped with a sophisticated long range radar system that is a considerable improvement over the standard T2 Radarbut at the cost of increased energy consumption and production costs.",
['UAC1401c'] = "<LOC Unit_Description_03004> The Aeon Agricultural Center produces and stores biomass in exchange for high energy costs.",
['UAC1501c'] = "<LOC Unit_Description_03005> The Aeon Manufacturing Facility produces and stores parts for adjacent buildings increasing mass storage capabilities and the construction rates of adjacent structures.",
['XAC1401c'] = "<LOC Unit_Description_03006> The Oracle provides complete line-of-sight within its operational area at no energy costbut can only be build on Hydrocarbon deposits.",
['XAC1501c'] = "<LOC Unit_Description_03007> The Prophet is an experimental stationary command suit that automatically assits or repairs anything in its operational range. It also contains all the blueprints necessary to build a basic army from scratch.",
['XAC2101c'] = "<LOC Unit_Description_03008> Contains a mass produced version of Princess Burke's palace shield. Has a great radiusbut is comparatively weaker.",
['XAC2201c'] = "<LOC Unit_Description_03009> The Aeon Temple is an Experimental Stealth Field generator with exceptional rangebut a higher energy cost. Countered by Omni sensors.",

-- Seraphim
['XSC1301c'] = "<LOC Unit_Description_04001> The Serpahim Administrative Structure is an Experimental Stealth Field generator with exceptional rangebut a higher energy cost. Countered by Omni sensors.",
['XSC1401c'] = "<LOC Unit_Description_04002> Uyal Ha-Esel provides complete line-of-sight within its operational area at no energy costbut can only be build on Hydrocarbon deposits. It has a small defensive shield to protect point defense emplacements",
['XSC1501c'] = "<LOC Unit_Description_04003> The Seraphim Manufacturing Facility produces and stores parts for adjacent buildings increasing mass storage capabilities and the construction rates of adjacent structures.",
['XSC2201c'] = "<LOC Unit_Description_04004> The Rift Support Structure increases the regeneration of all buildings within its operational area.",

}
RavenCurow
Avatar-of-War
 
Posts: 98
Joined: 30 Oct 2014, 01:17
Has liked: 1 time
Been liked: 14 times
FAF User Name: RavenCurow

Re: Unit Descriptions

Postby Uveso » 09 Sep 2016, 05:13

Hehe this is a cruel thing.

Dont use upper case letter. like
Code: Select all
['URC1101c'] =


Only lower case will work here:
Code: Select all
['urc1101c'] =
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Unit Descriptions

Postby Uveso » 09 Sep 2016, 05:46

You must not declare the Description array again.

Hooking means, your file unitdescription.lua will be appended to the original unitdescription.lua and the executed.
If you declare Description again, the whole file will look like this:

Code: Select all
-- This is from the original file:
Description = {
    ['uel0001-tm'] = "<LOC Unit_Description_0004>Mounts a tactical cruise missile launche....",
    ['uel0001-dsu'] = "<LOC Unit_Description_0006>Greatly increases the speed at which t....",
}

--This is from your file and will overwrite the Description Array:
Description = {
    ['URC1101c'] = "<LOC Unit_Description_02001> The Cybran Residential Structure is an all purpose ....",
    ['URC1201c'] = "<LOC Unit_Description_02002> The Cybran Science Facility is a prototype power ....",
}


So you can't just make a new Description Array. You have to insert your description with an Array index directly:
Code: Select all
Description['urc1101c'] = "<LOC Unit_Description_02001> The Cybran Residential Structure is an ..."


This way the code execution inside unitdescription.lua will now look like this:
Code: Select all
-- This is from the original file:
Description = {
    ['uel0001-tm'] = "<LOC Unit_Description_0004>Mounts a tactical cruise missile launche....",
    ['uel0001-dsu'] = "<LOC Unit_Description_0006>Greatly increases the speed at which t....",
}

-- Now we are injecting data directly into the array with an index:
    Description['URC1101c'] = "<LOC Unit_Description_02001> The Cybran Residential Structure is an all purpose ....",
    Description ['URC1201c'] = "<LOC Unit_Description_02002> The Cybran Science Facility is a prototype power ....",


And here is the copy & paste ready script:
Code: Select all
-----------------------------------------------
-- File     :  lua/ui/help/unitdescriptions.lua
-- Author(s):  RavenCurow
-- Descriptions for new units in Civilians V2
-----------------------------------------------


-- Cybran
Description['urc1101c'] = "<LOC Unit_Description_02001> The Cybran Residential Structure is an all purpose utility structure that boosts the efficiency of adjacent structures."
Description['urc1201c'] = "<LOC Unit_Description_02002> The Cybran Science Facility is a prototype power generator producing more energy than the Antimatter Reactor but less than a Quantum Reactor."
Description['urc1301c'] = "<LOC Unit_Description_02003> The Cybran Admin Structure produces a small cloaking field the obscures line-of-sight for all buildings in its operational radius."
Description['urc1302c'] = "<LOC Unit_Description_02004> The Cybran Comm Station is equipped with a sophisticated long range radar system that is a considerable improvement over the standard T2 Radarbut at the cost of increased energy consumption and production costs."
Description['urc1401c'] = "<LOC Unit_Description_02005> The Cybran Agricultural Center produces and stores biomass in exchange for high energy costs."
Description['urc1501c'] = "<LOC Unit_Description_02006> The Cybran Manufacturing Facility produces and stores parts for adjacent buildings increasing mass storage capabilities and the construction rates of adjacent structures."
Description['urc1901c'] = "<LOC Unit_Description_02007> The QAI Secondary Mainframe gives a moderate efficiency boost to all adjacent buildings in your grid."
Description['urc1902c'] = "<LOC Unit_Description_02008> The Cybran Network Node gives a large energy adjacency bonus to adjacent energy using buildings."
Description['xrc1101c'] = "<LOC Unit_Description_02009> The QAI Jamming Station is an Experimental Stealth Field generator with exceptional rangebut a higher energy cost. Countered by Omni sensors."
Description['xrc1501c'] = "<LOC Unit_Description_02010> The Samantha Carter Stature houses an experimental command suit that automatically assits or repairs anything in its operational range. It also contains all the blueprints necessary to build a basic army from scratch."
Description['xrc2201c'] = "<LOC Unit_Description_02011> The QAI Mainframe houses and Experimental Omni Sensor Jammer that emits quantum pulses that reduce the operational range of all Omni Sensors in its operational radius."

-- UEF
Description['uec1101c'] = "<LOC Unit_Description_01001> The UEF Residential Structure is an all purpose utility structure that boosts the efficiency of adjacent structures."
Description['uec1201c'] = "<LOC Unit_Description_01002> The UEF Science Facility is a prototype power generator producing more energy than the Antimatter Reactorbut less than a Quantum Reactor."
Description['uec1301c'] = "<LOC Unit_Description_01003> The UEF Secondary Administrative Structure is equipped with a sophisticated long range radar system that is a considerable improvement over the standard T2 Radarbut at the cost of increased energy consumption and production costs."
Description['uec1401c'] = "<LOC Unit_Description_01004> The UEF Agricultural Center produces and stores biomass in exchange for high energy costs."
Description['uec1501c'] = "<LOC Unit_Description_01005> The UEF Manufacturing Facility produces and stores parts for adjacent buildings increasing mass storage capabilities and the construction rates of adjacent structures."
Description['xec1301c'] = "<LOC Unit_Description_01006> The UEF Administrative Structure is an Experimental Stealth Field generator with exceptional rangebut a higher energy cost. Countered by Omni sensors."
Description['xec1401c'] = "<LOC Unit_Description_01007> UEF High Command provides complete line-of-sight within its operational area at no energy costbut can only be build on Hydrocarbon deposits. It has a small defensive shield to protect point defense emplacements."
Description['xec1501c'] = "<LOC Unit_Description_01008> The Samantha Carter Stature houses an experimental command suit that automatically assits or repairs anything in its operational range. It also contains all the blueprints necessary to build a basic army from scratch."

-- Aeon
Description['uac1101c'] = "<LOC Unit_Description_03001> The Aeon Residential Structure is an all purpose utility structure that boosts the efficiency of adjacent structures."
Description['uac1201c'] = "<LOC Unit_Description_03002> The Aeon Science Facility is a prototype power generator producing more energy than the Antimatter Reactorbut less than a Quantum Reactor."
Description['uac1301c'] = "<LOC Unit_Description_03003> The Aeon Administrative Structure is equipped with a sophisticated long range radar system that is a considerable improvement over the standard T2 Radarbut at the cost of increased energy consumption and production costs."
Description['uac1401c'] = "<LOC Unit_Description_03004> The Aeon Agricultural Center produces and stores biomass in exchange for high energy costs."
Description['uac1501c'] = "<LOC Unit_Description_03005> The Aeon Manufacturing Facility produces and stores parts for adjacent buildings increasing mass storage capabilities and the construction rates of adjacent structures."
Description['xac1401c'] = "<LOC Unit_Description_03006> The Oracle provides complete line-of-sight within its operational area at no energy costbut can only be build on Hydrocarbon deposits."
Description['xac1501c'] = "<LOC Unit_Description_03007> The Prophet is an experimental stationary command suit that automatically assits or repairs anything in its operational range. It also contains all the blueprints necessary to build a basic army from scratch."
Description['xac2101c'] = "<LOC Unit_Description_03008> Contains a mass produced version of Princess Burke's palace shield. Has a great radiusbut is comparatively weaker."
Description['xac2201c'] = "<LOC Unit_Description_03009> The Aeon Temple is an Experimental Stealth Field generator with exceptional rangebut a higher energy cost. Countered by Omni sensors."

-- Seraphim
Description['xsc1301c'] = "<LOC Unit_Description_04001> The Serpahim Administrative Structure is an Experimental Stealth Field generator with exceptional rangebut a higher energy cost. Countered by Omni sensors."
Description['xsc1401c'] = "<LOC Unit_Description_04002> Uyal Ha-Esel provides complete line-of-sight within its operational area at no energy costbut can only be build on Hydrocarbon deposits. It has a small defensive shield to protect point defense emplacements"
Description['xsc1501c'] = "<LOC Unit_Description_04003> The Seraphim Manufacturing Facility produces and stores parts for adjacent buildings increasing mass storage capabilities and the construction rates of adjacent structures."
Description['xsc2201c'] = "<LOC Unit_Description_04004> The Rift Support Structure increases the regeneration of all buildings within its operational area."



greetings, Uveso.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Unit Descriptions

Postby RavenCurow » 09 Sep 2016, 07:15

Thank you for the explanation. That fixed everything. I had tried it like that originally, but nothing happened because it was in capital letters and I didn't know capitals made the code defunct lol. So I tried it the other way and broke it even more. Now everything works and my civilians mod is finished for the most part unless someone requests more features or I get more models to flesh out the seraphim buildings as they don't have very many. Thanks for you help on this. Now back to Nomads work.
RavenCurow
Avatar-of-War
 
Posts: 98
Joined: 30 Oct 2014, 01:17
Has liked: 1 time
Been liked: 14 times
FAF User Name: RavenCurow

Re: Unit Descriptions

Postby Uveso » 10 Sep 2016, 16:55

Civilians ftw! :)

Can't wait to see the first version of nomads for the new gameversion. :mrgreen:
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest