OK -- I just took a look at the Scripting Guide and some of my notes from the old days. The problem with your code, I THINK, is that the TransformTown() function takes a
numeric value the town type argument. Here is example code from the Scripting Guide:
Code: Select all
function transform(townname)
local towntype = 5;
TransformTown(townname, towntype);
end;
-- townname and towntype are both variables. The value of the first is defined when the function is called up. The value of the second was set to 5 right before.
As far as I know, the list below gives the valid numeric values for the town type.
@TransformTown("Town",0) - invalid town type #0
@TransformTown("Town",1) - invalid town type #1
@TransformTown("Town",2) - invalid town type #2
@TransformTown("Town",3) ->Haven
@TransformTown("Town",4) ->Sylvan
@TransformTown("Town",5) ->Academy
@TransformTown("Town",6) ->Dungeon
@TransformTown("Town",7) ->Necropolis
@TransformTown("Town",8) ->Inferno
@TransformTown("Town",9) ->Fortress
The weird format for this list is because I originally copied it from a game file. As you can see, the value of 5 used in the example results in transforming the town into an Academy.
I have
not fired up the editor and tested any of this, but I think it will help you.