The image is a piece of my scenario (attached)
I would like to create two scripts: one for the red line and another for black line. The idea behind black line is a sort of mission. I've tried to create a script, but it doesn't run. The summary: an UNIT (i.e. Phalanx) move from POINT A to POINT B, when UNIT arrive to POINT B, the PLAYER or NATION gets 2000 gold and a line in chat with ''Mission Complete''. This script is ''high-potential'', especially for tutorial.sav.
Code: Select all
function has_unit_type_name(unit, utype_name)
return (unit.utype.id == find.unit_type(utype_name).id)
end
function unit_moved_callback(unit, src_tile, dst_tile)
local beta = find.tile(178,192)
local owner = find.player(0)
local type = find.unit_type('Phalanx')
if unit.owner:is_human() then
if unit_type == type then
if dst_tile.tile == beta then
change_gold(owner, 2000)
notify.player(unit.owner, [[Mission complete!]])
end
end
end
end
signal.connect('unit_moved', 'unit_moved_callback')
Details greatbritainv2.5.sav.gz:
- 6 nations (English, Scottish, Welsh, Irish, French and Manx)
- map size 350x350 (122'500 tiles)
- 58 cities (English)
- 20 cities (Scottish)
- 15 cities (Manx)
- 13 cities (Irish)
- 11 cities (French)
- 07 cities (Welsh)
- 124 cities total