H5 - Changing Town Buildings with Script?

Maps and the art of mapmaking.
Sarvi
Leprechaun
Leprechaun
Posts: 46
Joined: 29 Sep 2006

H5 - Changing Town Buildings with Script?

Unread postby Sarvi » 12 Oct 2008, 10:58

Has anyone used the script function SetTownBuildingLevel() ??
It does'nt seem to work at all. I've been trying to restrict town buildings to level 2 ,(after capturing it and transforming to player1 type) in a map I'm working on, but without success....
I know the town ID's were changed for TotE. Maybe the town building IDs have been changed as well?
Ach wie schoen das niemand weiss....

User avatar
Grumpy Old Wizard
Round Table Knight
Round Table Knight
Posts: 2205
Joined: 06 Jan 2006
Location: Tower Grump

Re: H5 - Changing Town Buildings with Script?

Unread postby Grumpy Old Wizard » 12 Oct 2008, 12:30

I haven't used the SetTownBuildingLevel() function.

But when you transform a town the script name of the town changes (at least before TOTE that was the case, haven't checked it again.) That is your most likely culprit. I ran into that problem in Shadow Dreams where I transformed the center town into the player's town type.

You could keep the town as a particular type (not allowing building) and use external dwellings or quest huts to simulate dwellings.
Frodo: "I wish the ring had never come to me. I wish none of this had happened."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."

Sarvi
Leprechaun
Leprechaun
Posts: 46
Joined: 29 Sep 2006

town building levels (H5)

Unread postby Sarvi » 22 Oct 2008, 06:11

I found out how to do it!
The DestroyTownBuildingToLevel() functions won't work immediately following the TransformTown() function. BUT they work on the next day!
The script name for your town is not lost when you use TransformTown.
:o) Sarvi
Ach wie schoen das niemand weiss....

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 22 Oct 2008, 08:22

Try inserting sleep(10) between calls of transformtown() and settownbuildinglevel(), it should also work. No need to wait a whole day...


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 0 guests