How to Help with Scripting
Moderators: Oberlus, Committer
Re: How to Help with Scripting
Here is another big batch of crosslinks, mostly between ship hulls and required buildings. Also corrected some wrong info caused by recent changes to organic hulls rebalancing.
- Attachments
-
[The extension patch has been deactivated and can no longer be displayed.]
All released under the GNU GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0 licences.
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: How to Help with Scripting
revision 5649.
"another big batch of crosslinks, mostly between ship hulls and required buildings by sloth."
Excellent.
Future note:
rather than this:
"... allows development of Protoplasmic Hulls, Symbiotic Hulls, ..."
where the "s" is not part of the link and thus stands out, you could phrase it thus:
"... allows development of the Protoplasmic Hull, the Symbiotic Hull, ..."
"another big batch of crosslinks, mostly between ship hulls and required buildings by sloth."
Excellent.
Future note:
rather than this:
"... allows development of Protoplasmic Hulls, Symbiotic Hulls, ..."
where the "s" is not part of the link and thus stands out, you could phrase it thus:
"... allows development of the Protoplasmic Hull, the Symbiotic Hull, ..."
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: How to Help with Scripting
I'd drop the articles and just put "... allows development of Protoplasmic Hull, Symbiotic Hull, ..."eleazar wrote:rather than this:
"... allows development of Protoplasmic Hulls, Symbiotic Hulls, ..."
where the "s" is not part of the link and thus stands out, you could phrase it thus:
"... allows development of the Protoplasmic Hull, the Symbiotic Hull, ..."
Re: How to Help with Scripting
It feels more natural with the articles. I would keep the articles for the first and last object and omit the rest: "...allows development of the Protoplasmic Hull, Symbiotic Hull, and the Bio-Adaptive Hull." something like that.I'd drop the articles and just put "... allows development of Protoplasmic Hull, Symbiotic Hull, ..."
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: How to Help with Scripting
Define "natural"?unjashfan wrote:...It feels more natural...
Many (most?) content descriptions avoid articles, eg. "Increases industry on..." not "Increases the industry on..."
Re: How to Help with Scripting
Is the Scripting Work page on the wiki still relevant? If so I would like to work on some of the ship tasks.
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: How to Help with Scripting
I don't believe any of those things have been done yet.Snowflake wrote:Is the Scripting Work page on the wiki still relevant? If so I would like to work on some of the ship tasks.
Re: How to Help with Scripting
Edited to contain fixes and workarounds.
Here is a go at giving ships variable speeds depending on species.
Species.txt :
en.txt (stringtables folder) under Species Picks heading:
It works just like any other species bonus/malus.
Edited to contain fixes and workarounds.
Immobile ships will now not be affected and slow ships will not grind to a halt with ships now being given a minimum speed of 20-29 uu per turn.
This code is released under: Creative Commons Attribution-ShareAlike 3.0 license, and the GNU GPL 2.0 license.
Here is a go at giving ships variable speeds depending on species.
Species.txt :
Code: Select all
//##### S T A R L A N E S P E E D #####//
POOR_ENGINES
'''EffectsGroup
scope = And [
Source
Ship
StarlaneSpeed low = 40
]
effects = SetStarlaneSpeed Value - 20
'''
BAD_ENGINES
'''EffectsGroup
scope = And [
Source
Ship
StarlaneSpeed low = 30
]
effects = SetStarlaneSpeed Value - 10
'''
GOOD_ENGINES
'''EffectsGroup
scope = And [
Source
Ship
StarlaneSpeed low = 1
]
effects = SetStarlaneSpeed Value + 10
'''
GREAT_ENGINES
'''EffectsGroup
scope = And [
Source
Ship
StarlaneSpeed low = 1
]
effects = SetStarlaneSpeed Value + 20
'''
ULTIMATE_ENGINES
'''EffectsGroup
scope = And [
Source
Ship
StarlaneSpeed low = 1
]
effects = SetStarlaneSpeed Value + 40
'''
en.txt (stringtables folder) under Species Picks heading:
Code: Select all
POOR_ENGINES
'''−− Ships are 20 uu per turn slower.'''
BAD_ENGINES
'''− Ships are 10 uu per turn slower.'''
GOOD_ENGINES
'''+ Ships are 10 uu per turn faster.'''
GREAT_ENGINES
'''++ Ships are 20 uu per turn faster.'''
ULTIMATE_ENGINES
'''+++ Ships are 40 uu per turn faster.'''
Edited to contain fixes and workarounds.
Immobile ships will now not be affected and slow ships will not grind to a halt with ships now being given a minimum speed of 20-29 uu per turn.
This code is released under: Creative Commons Attribution-ShareAlike 3.0 license, and the GNU GPL 2.0 license.
Last edited by Snowflake on Sat Aug 31, 2013 3:40 am, edited 2 times in total.
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: How to Help with Scripting
Snowflake, cool, did you test it?
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: How to Help with Scripting
What's with the weird accented a's? Writing something in MS word and pasting fancy dashes into what should be UTF-8 text?Snowflake wrote:'''−− Ships are 20 uus slower.'''
Also, never write "uus". Unit symbols don't get an s to be plural, and the point here is that it's a distance per turn, so put "uu/turn".
Also, these scripts are potentially problematic for ship designs that by default move 20 or fewer uu/turn, or for designs that aren't supposed to be able to move.
Re: How to Help with Scripting
Yes and it works, but my first few tries at a % increase/decrease failed so I went with a flat one.eleazar wrote:Snowflake, cool, did you test it?
The weird text was what was in the code so I went with what was there. They supposedly represent the "-" that appear before the text on the species selection screen.Geoff the Medio wrote:What's with the weird accented a's? Writing something in MS word and pasting fancy dashes into what should be UTF-8 text?Snowflake wrote:'''−− Ships are 20 uus slower.'''
Also, never write "uus". Unit symbols don't get an s to be plural, and the point here is that it's a distance per turn, so put "uu/turn".
Also, these scripts are potentially problematic for ship designs that by default move 20 or fewer uu/turn, or for designs that aren't supposed to be able to move.
I will change the uus to uu/turn and try to find a workaround for nonmoving/slowmoving ships.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: How to Help with Scripting
I think you're not viewing the stringtable with a good text editor then. You need one that reads and saves as UTF-8. Some of those are minus signs, −, which are not the same character as hyphens, -.Snowflake wrote:The weird text was what was in the code so I went with what was there. They supposedly represent the "-" that appear before the text on the species selection screen.
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: How to Help with Scripting
Off the top of my head all ships have a speed much greater than 20uu, but skipping the negative version of the pick would be fine by me too.
Can we use a tag to distinguish immobile hulls from the rest?
Can we use a tag to distinguish immobile hulls from the rest?
Re: How to Help with Scripting
I tried a different text program and you were right. The fault was with my text editor.Geoff the Medio wrote:I think you're not viewing the stringtable with a good text editor then. You need one that reads and saves as UTF-8. Some of those are minus signs, −, which are not the same character as hyphens, -.Snowflake wrote:The weird text was what was in the code so I went with what was there. They supposedly represent the "-" that appear before the text on the species selection screen.
Re: How to Help with Scripting
Could someone please drop some hints on script debugging in here or on the Wiki? As in: where do I find error messages caused by scripting? I did look at freeorion.log and freeoriond.log, but that is so cluttered with a myriad of other stuff... Since I caught hints of the code using some kind of logging facility, could effects messages be split off into another file?
Attached patches are released under GPL 2.0 or later.