Freeciv
Register
(give_technology() 'cost' added)
Tag: rte-source
mNo edit summary
Tag: rte-source
Line 13: Line 13:
 
==give_technology() cost==
 
==give_technology() cost==
   
'''eit.give_technology()''' / '''Player:give_technology()''' have new parameter '''cost'''. Note that it's not placed last, but is before '''reason'''. Add this parameter to all your give_technology() calls. Value '''-1''' ("apply freecost") results in similar behavior than previous versions had hardcoded.
+
'''edit.give_technology()''' / '''Player:give_technology()''' have new parameter '''cost'''. Note that it's not placed last, but is before '''reason'''. Add this parameter to all your give_technology() calls. Value '''-1''' ("apply freecost") results in similar behavior than previous versions had hardcoded.

Revision as of 23:01, 8 November 2015

This document describes how to convert freeciv 2.5 compatible lua script to S2_6 version (one that will become freeciv 2.6) compatible ones. Please check these carefully to avoid your script mis-behaving, maybe in some rarely reached special case. These are changes to scripting API incompatible with the previous version. Additions to the API that do not affect old scripts are not listed. Currently this goes up to compatibility with freeciv trunk revision 27397.

Disaster signal

Signal disaster has one new parameter. The new parameter had_internal_effect tells if the disaster caused any of the effects handled internally by the freeciv engine. Default default.lua has a handler that informs user that disaster was harmless if that parameter is true. If you are using default default.lua, and want to avoid it from giving out the message, for example if the disaster actually had some consequences in your own script.lua, simply prevent default.lua handler from firing by returning true from your own handler.

give_technology() cost

edit.give_technology() / Player:give_technology() have new parameter cost. Note that it's not placed last, but is before reason. Add this parameter to all your give_technology() calls. Value -1 ("apply freecost") results in similar behavior than previous versions had hardcoded.