Community Forums > Voobly General > General Discussion / Off Topic > How to disable a building on a custom map

How to disable a building on a custom map

 Denver17


Posted 31 March 2023 - 5:00 pm
they are building in castle age! Is the constants for feudal age and castle age are right? are they
#const FEUDAL_AGE_MARKET 116
#const CASTLE_AGE_MARKET 134
Link | Reply | Quote
 +pablo@voobly

Community Patch Developer


Edited 31 March 2023 - 5:07 pm by +pablo@voobly
#const CASTLE_AGE_MARKET 137

To be precise:
  • Unit 84 is the feudal age market
  • Unit 116 is the castle age market
  • Unit 137 is the imperial age market
How you call them is irrelevant as long as you disable the three of them.

Let me know if the AI is able to build in all ages or only in some.
Link | Reply | Quote
 Denver17


Posted 31 March 2023 - 5:18 pm
they are unable to build in feudal age! but they are building in castle age
Link | Reply | Quote
 +pablo@voobly

Community Patch Developer


Posted 31 March 2023 - 5:21 pm
Let me do some tests...
Link | Reply | Quote
 +pablo@voobly

Community Patch Developer


Edited 31 March 2023 - 5:48 pm by +pablo@voobly
Ok, new idea. Make the market impossible to build.

I've increased the cost to 32000 thousand wood so the AI doesn't think to build it. Do not change that cost as higher numbers go all the way around to negative (things related to how computers store numbers).

Appart from that, I've set the terrain the market can be placed to none, so even if you have the wood, there's nowhere to place it. I've tested and the AI doesn't seem to go crazy because of that.

And, I've added the train location part for human players.
Code:
#const SET_ATTRIBUTE 0 #const ATTR_TRAIN_LOCATION 42 #const ATTR_TERRAIN_ID 53 #const ATTR_WOOD_COST 104 #const FEUDAL_AGE_MARKET 84 #const CASTLE_AGE_MARKET 116 #const IMPERIAL_AGE_MARKET 137 <PLAYER_SETUP> effect_amount SET_ATTRIBUTE FEUDAL_AGE_MARKET ATTR_TERRAIN_ID 5 effect_amount SET_ATTRIBUTE CASTLE_AGE_MARKET ATTR_TERRAIN_ID 5 effect_amount SET_ATTRIBUTE IMPERIAL_AGE_MARKET ATTR_TERRAIN_ID 5 effect_amount SET_ATTRIBUTE FEUDAL_AGE_MARKET ATTR_WOOD_COST 32000 effect_amount SET_ATTRIBUTE CASTLE_AGE_MARKET ATTR_WOOD_COST 32000 effect_amount SET_ATTRIBUTE IMPERIAL_AGE_MARKET ATTR_WOOD_COST 32000 effect_amount SET_ATTRIBUTE FEUDAL_AGE_MARKET ATTR_TRAIN_LOCATION -1 effect_amount SET_ATTRIBUTE CASTLE_AGE_MARKET ATTR_TRAIN_LOCATION -1 effect_amount SET_ATTRIBUTE IMPERIAL_AGE_MARKET ATTR_TRAIN_LOCATION -1

That should be it
Link | Reply | Quote
 Denver17


Posted 31 March 2023 - 5:49 pm
ok, after changing castle age from 134 to 137 it started to build market even in feudal age
Link | Reply | Quote
 +pablo@voobly

Community Patch Developer


Posted 31 March 2023 - 5:53 pm
Denver17 wrote:
ok, after changing castle age from 134 to 137 it started to build market even in feudal age
Is this with the code I just sent?
Link | Reply | Quote
 Denver17


Posted 31 March 2023 - 6:27 pm
Got any clue?
Link | Reply | Quote
 Denver17


Posted 31 March 2023 - 6:28 pm
Yes, but even with both 134 and 137 they are building market. They are building in all ages
Link | Reply | Quote
 Denver17


Posted 31 March 2023 - 6:29 pm
No, sorry I was busy playing that test, I didn't see your code, I will update
Link | Reply | Quote
 Denver17


Posted 31 March 2023 - 6:31 pm
Actually I put all the time, DARK AGE 84
Link | Reply | Quote
 Denver17


Posted 31 March 2023 - 6:32 pm
I have put all the changes, Now I m abt to test
Link | Reply | Quote
 Denver17


Edited 31 March 2023 - 7:09 pm by Denver17
Yes It worked!! ;yahoo ;yahoo ;yahoo ;yahoo ;yahoo
Link | Reply | Quote
 +pablo@voobly

Community Patch Developer


Posted 31 March 2023 - 9:19 pm
Finally! Damn AIs...
Link | Reply | Quote
 Denver17


Posted 31 March 2023 - 9:21 pm
Yes!


Link | Reply | Quote
12[3]4
Displaying 31 - 45 out of 50 posts
Forum Jump:
1 User(s) are reading this topic (in the past 30 minutes)
0 members, 1 guests

What's popular right now: