Page 2 of 3

Re: How to Help with Scripting

Posted: Tue Jan 08, 2013 9:58 am
by Sloth
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.

Re: How to Help with Scripting

Posted: Thu Jan 17, 2013 12:30 am
by eleazar
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, ..."

Re: How to Help with Scripting

Posted: Thu Jan 17, 2013 12:36 am
by Geoff the Medio
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, ..."
I'd drop the articles and just put "... allows development of Protoplasmic Hull, Symbiotic Hull, ..."

Re: How to Help with Scripting

Posted: Thu Jan 17, 2013 9:22 am
by unjashfan
I'd drop the articles and just put "... allows development of Protoplasmic Hull, Symbiotic Hull, ..."
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.

Re: How to Help with Scripting

Posted: Thu Jan 17, 2013 9:39 am
by Geoff the Medio
unjashfan wrote:...It feels more natural...
Define "natural"?

Many (most?) content descriptions avoid articles, eg. "Increases industry on..." not "Increases the industry on..."

Re: How to Help with Scripting

Posted: Fri Aug 30, 2013 11:48 pm
by Snowflake
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

Posted: Fri Aug 30, 2013 11:50 pm
by eleazar
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.
I don't believe any of those things have been done yet.

Re: How to Help with Scripting

Posted: Sat Aug 31, 2013 12:29 am
by Snowflake
Edited to contain fixes and workarounds.
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.'''
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.

Re: How to Help with Scripting

Posted: Sat Aug 31, 2013 2:17 am
by eleazar
Snowflake, cool, did you test it?

Re: How to Help with Scripting

Posted: Sat Aug 31, 2013 2:24 am
by Geoff the Medio
Snowflake wrote:'''−− Ships are 20 uus slower.'''
What's with the weird accented a's? Writing something in MS word and pasting fancy dashes into what should be UTF-8 text?

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

Posted: Sat Aug 31, 2013 2:46 am
by Snowflake
eleazar wrote:Snowflake, cool, did you test it?
Yes and it works, but my first few tries at a % increase/decrease failed so I went with a flat one.
Geoff the Medio wrote:
Snowflake wrote:'''−− Ships are 20 uus slower.'''
What's with the weird accented a's? Writing something in MS word and pasting fancy dashes into what should be UTF-8 text?

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.
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.
I will change the uus to uu/turn and try to find a workaround for nonmoving/slowmoving ships.

Re: How to Help with Scripting

Posted: Sat Aug 31, 2013 2:50 am
by Geoff the Medio
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.
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, -.

Re: How to Help with Scripting

Posted: Sat Aug 31, 2013 2:59 am
by eleazar
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?

Re: How to Help with Scripting

Posted: Sat Aug 31, 2013 3:42 am
by Snowflake
Geoff the Medio wrote:
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.
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, -.
I tried a different text program and you were right. The fault was with my text editor.

Re: How to Help with Scripting

Posted: Fri Feb 28, 2014 9:45 am
by Chriss
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?