Jump to content


Photo

Commandbutton in World builder

commandbutton world builder rotwk mapping rise of the witch-king

  • Please log in to reply
6 replies to this topic

#1 DrHouse93

DrHouse93
  • Members
  • 18 posts
  • Location:Rome
  • Projects:RotWK Maps (Both Edain and 2.02 versions)

Posted 26 October 2014 - 01:40 AM

Hi all :)
These days I was messing with the World builder (I've already made a custom map) and I remembered the old game mechanic featured in the first mission of the Evil Campaign in BFME1 (Isengard): you had to build lumber mills while the land was tainted and trees were chopped down. So, I tried to implement that feature in a cool Isengard map which I downloaded, and I almost succeeded in it. I've got in fact a bunch of problems:
 
1. The land doesn't stay tainted forever and it will revert back to normal after a while
2. Whenever I put a control (if there are less than or equal than 0 trees in the area "...", then taint land and spawn a buildplot) that doesn't work, even if there are no more trees at all
3. The buildplots correctly spawn, but the structures I can build in it are decided completely randomly by the game: with Isengard, I can build just 5 buildings (Uruk-Pit, Warg-Pit, Siege Works, Battle Tower and Armory), with Mordor just the Orc-Pit and with Gondor all of them. But the main problem is that, looking in the original script of the map for BFME, there was a feature in the Map/Gameplay section of the scripts, where you could add and/or remove Command_Buttons to any building, unit, hero or whatever. So I made a script (Add "Command_PorterConstructIsengardLumberMill" to any unit of type "IsengardBuildFoundation"), like it was in the original script, but that doesn't work. It just doesn't happen anything. It doesn't even work with any kind or variations, not even its contrary (remove [...])
 
Why does this happen? I hope someone can help me


#2 MattTheLegoman

MattTheLegoman

    LEGO Knight of Minas Ithil

  • T3A Staff
  • 3,669 posts
  • Location:Tomorrow, when the War began
  • Projects:Mapping this Middle-earth
  •  Mapper
  • Division:BFME
  • Job:T3A Staff

Posted 26 October 2014 - 02:05 AM

One of these issues I can attribute to differences between BfME and BfME II. In BfME tainted land doesn't have a timer and in BfME II it lasts for a short time.


Remember that all worlds draw to an end and that noble death is a treasure which no one is too poor to buy. - C.S. Lewis

There will come a time when you believe everything is finished. That will be the beginning. - Louis L'Amour

What will matter then will be people. If relationships will matter most then, shouldn't they matter most now? - Max Lucado


#3 DrHouse93

DrHouse93
  • Members
  • 18 posts
  • Location:Rome
  • Projects:RotWK Maps (Both Edain and 2.02 versions)

Posted 26 October 2014 - 11:29 AM

Thanks for your answer. I'll try then to put some kind of code to make it everlasting. What about instead the buildplot problem? It also depends on differences between BFME 1 and 2 or it is just a bug which doesn't make the Command_Button code not working?



#4 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,069 posts
  • Location:Germany
  • Projects:Lot3A
  •  ~~
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 26 October 2014 - 02:30 PM

As far as I remember, you will need new CommandButtons for the buildplots or override existing ones in map.ini. EA replaced BFME 1's construction buttons with the Porter contruction buttons and they do not work for foundations. This is why the plots do not show all buildings; EA removed most of the command buttons that belonged to foundations. This is BFME 1 code:

CommandButton Command_ConstructMordorPen
  Command          = FOUNDATION_CONSTRUCT
  Object           = MordorMumakilPen
  TextLabel        = CONTROLBAR:ConstructMordorMumakilPen
  ButtonImage      = BMMumakilPen
  ButtonBorderType = BUILD ; Identifier for the User as to what kind of button this is
  DescriptLabel    = CONTROLBAR:ToolTipMordorMumakilPen
  Radial           = Yes  
End

This is BFME 2:

CommandButton Command_PorterConstructMumakilPen
  Command          = DOZER_CONSTRUCT
  Object           = MordorMumakilPen
  TextLabel        = CONTROLBAR:ConstructMordorMumakilPen
  ButtonImage      = BMMumakilPen
  ButtonBorderType = BUILD
  DescriptLabel    = CONTROLBAR:ToolTipMordorMumakilPen
  Radial           = Yes  
End

Edit the commandbuttons/create new ones (no idea if that actually works in a map.ini) and replace DOZER_CONSTRUCT with FOUNDATION_CONSTRUCT and add the command to the commandset of the building foundation. Note that if you do that, your porter commands will be screwed. I suggest you only replace commandbuttons that are not necessary for your map; if you need porters, then do not touch porter contruct buttons. If you're doing this for a mod or an inofficial patch, maybe ask the coder to put in BFME 1's old commandbuttons? That would be the easiest way. ;)


26285.png


#5 DrHouse93

DrHouse93
  • Members
  • 18 posts
  • Location:Rome
  • Projects:RotWK Maps (Both Edain and 2.02 versions)

Posted 26 October 2014 - 09:20 PM

@Echo, Thanks, that worked!! :D
 
I've also managed to make the land eternaly tainted^^. Now, I just need to figure out why the "tree control" doesn't work. In World builder, I created a script like this:
 
* IF *
There are Less Than or Equal To 3 comparison trees in the area "Plot 3 Area"
* THEN *
Spawn buildplot, taint land etc.

 
But, even if there are no more trees at all, nothing happens, and since Builders for the Player inside fortress are gone, I cannot build other buildings. Also, I wanted to ask:
 
I put in the map the IsengardTent2 object, from where you can recruit Orc Fighters and Orc Archers and also research Banner Carriers and Fire Arrows at level 2 and 3 respectively. So I made this code to make them be recruited from there:

 

CommandSet IsengardTentOverride

1 = Command_ConstructMordorOrcFighterHorde
2 = Command_ConstructMordorOrcArcherHorde

End

Object IsengardTent2

CommandSet = IsengardTentOverride

End

 

And the buttons correctly showed up. However, when I click on them to recruit them, nothing happens (also, I have no idea how to add a custom button to upgrade the tent to level 2 and 3 xD)



#6 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,069 posts
  • Location:Germany
  • Projects:Lot3A
  •  ~~
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 27 October 2014 - 06:26 AM

Maybe you will need something like this:

  Behavior = ProductionUpdate ProductionUpdateModuleTag
    ; nothing
  End

  Behavior = QueueProductionExitUpdate QueueProductionModuleTag
    PlacementViewAngle = -180
    UnitCreatePoint    = X:28.0 Y:-35.2 Z:0.0    // modify values as they fit best for you :p
    NaturalRallyPoint  = X:-60.0 Y:-35.2 Z:0.0
    ExitDelay = 750
  End

If that doesn't work, what happens if you add FS_FACTORY and/or AUTO_RALLYPOINT to the KindOf of the IsengardTent2 object? I have no idea what FS_FACTORY does but the Gondor Archer Range has it so it might be worth a try :D . For the levelling of the tent, does it have an experience level? If it has, orientate yourself on existing buildings, like the orcpit:

CommandSet MordorOrcPitCommandSetLevel1
  1    = Command_ConstructMordorOrcFighterHorde
  2    = Command_ConstructMordorOrcArcherHorde
  3    = Command_PurchaseTechnologyMordorBasicTraining
  4 = Command_UpgradeMordorOrcPitLevel2  // <--- You will need a button like this for your IsengardTent2
  6    = Command_Sell
End

CommandSet MordorOrcPitCommandSetLevel2
  1    = Command_ConstructMordorOrcFighterHorde
  2    = Command_ConstructMordorOrcArcherHorde
  3    = Command_PurchaseTechnologyMordorBasicTraining
  4 = Command_UpgradeMordorOrcPitLevel3
  6    = Command_Sell
End

CommandSet MordorOrcPitCommandSetLevel3
  1    = Command_ConstructMordorOrcFighterHorde
  2    = Command_ConstructMordorOrcArcherHorde
  3    = Command_PurchaseTechnologyMordorBasicTraining
  6    = Command_Sell
End

As you can see, the orcpit has different CommandSets on different levels, triggered by a CommandSetUpgrade in the orcpit.ini code. How all this works with map.ini I can't tell you unfortunately, as you will need an experiencelevel for the IsengardTent2 object, and it is important that the IsengardTent2 receives upgrades on level 2 and 3 so it can properly upgrade the CommandSet. I am so glad that I am modding BFME 1. :xd:

 

About the tree script I am not sure. Did you copy this over from BFME 1?


Edited by Echo, 27 October 2014 - 06:28 AM.

26285.png


#7 DrHouse93

DrHouse93
  • Members
  • 18 posts
  • Location:Rome
  • Projects:RotWK Maps (Both Edain and 2.02 versions)

Posted 27 October 2014 - 03:24 PM

Ok, I'm gonna try the code you gave me and see if it works. Thanks for your help^^. The problem is that by default, the tent is considered as a "decorative object", meaning it has a default health, is selectable and attackable. But nothing else. You can't even sell it and it doesn't have a building animations (meaning that it instantly show up if built)

 

About the tree control, yes, I took it from the Isengard Mission of BFME (not copy-paste, I just remade it by myself). It's located under the "Scripting" tab






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users