Jump to content


Photo

[BFME2] Preventing Fortress Spam


  • Please log in to reply
3 replies to this topic

#1 SnonJow

SnonJow
  • Members
  • 23 posts

Posted 07 February 2019 - 05:46 PM

Hello there!

 

I would like to prevent players from building more than one fortress. The following script works, but it has a major flaw. If you start building two fortresses simultaneously, not only are you allowed to keep them once constructed, the whole restriction is miraculously lifted, allowing you to build as many as you want from then on.

 

*** IF ***

Player '<This Player>' has Greater Than 0 unit or structure of this type 'DwarvenFortress'

Actions if True

Player '<This Player>' allowed to build 'DwarvenFortress' is FALSE.

 

Is there a way to make this script work? What I'm thinking is to destroy an object of the chosen type owned by a player if they build more than one, or better yet, ALL objects of the chosen type (to really punish fort spammers). But I don't know how to do that...



#2 Rider of Rohan

Rider of Rohan

    The Lazy Modder

  • Division Leaders
  • 1,555 posts
  • Location:The Caribbean
  • Projects:Age of the Ring and the HD Editions
  •  Mathijs' Bug fix expert
  • Division:BFME
  • Job:T3A Leader

Posted 07 February 2019 - 08:56 PM

Alternatively, you could use map.ini to add a "MaxSimultaneousOfType = 1" To each fortress object.
However I'm not to sure how to write that.
Basically, this code hard limits the unit/object to the number you state. i.e. Most mini hero hordes have this code but set to "MaxSimultaneousOfType = 3" so players and ai are limited to only be able to buy 3 hordes of hero units..


99dxc486ltde132zg.jpgh5je9noaofg3o26zg.jpg

No parent should have to bury their child - King Theoden


#3 -SilverBane-

-SilverBane-

    Inactive Noob

  • Project Team
  • 474 posts
  • Location:Bucharest
  • Projects:Life
  •  Mapper & Coder

Posted 12 February 2019 - 09:18 PM

As far as I know the MaxSimultaneousOfType thing is a little bit more complicated for fortresses....because the fortress is an object that unpacks...and that makes that parameter go wild and not recognize theres 1 already... worth a try though.

Otherwise the only way outside scripts that I can think of is using upgrades, fort giving an upgrade/removing it when its destroyed so builder can construct/not a new fort.


2qm3dd5.jpg


#4 SnonJow

SnonJow
  • Members
  • 23 posts

Posted 17 February 2019 - 08:20 AM

Thanks for the help, guys.

 

"MaxSimultaneousOfType" seems to work better than the scripts, but it is still possible to start building more than one fortress simultaneously. However, it still works after you've (re)built your fortress(es) and you can't build any more unless you demolish all you currently have.

 

I've tried the combination of the two, but that just completely prevents you from building forts, regardless of how many you own.


Edited by SnonJow, 17 February 2019 - 08:20 AM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users