Jump to content


Photo

Mount Nazgûl (Foot/Horse/Fellbeast)

two mounts flags

  • Please log in to reply
7 replies to this topic

#1 Super Hippo

Super Hippo
  • Members
  • 25 posts

Posted 28 January 2019 - 10:36 PM

Hello,

the main reason I started to mod recently was to give Mordor a bit more interesting heroes. I already found a few threads about this topic in this forum (mainly BFME2). For example:

https://forums.revor...llbeast-solved/ (especially #4, but I don't know what I do wrong)

https://forums.revor...raith-in-bfme2/ (solution was given via PM in the end, not in the thread)

 

However, I feel like I don't entirely understand the "engine" of the game. (See Question 1 for example)

 

(I use BFME 1 with patch 1.03 and mod with the -mod command.)

 

I want to use one object for it, so the health isn't replenished whenever I (dis)mount the fellbeast...

 

What I did so far:

- nazgûl on foot (model+animations) -- used the one from the fellbeast, removed the fellbeast and voilà

- nazgûl on horse (model+animations) -- used normal horse model and edit a texture to get a black horse, then put the nazgûl on this horse

- toggle between both (Not working perfectly. I am not sure why the horse is not fading in when toggling while the rider is... but I can live with that for now.)

 

What I can't achieve:

- mount a fellbeast

- housecolors (I have no clue how a TGA file works. It can be applied to a model, but how does it know where each part of the image belongs to?) -- but the mounting problem is more important for now  :wink_new:

 

(Question 1:) What exactly is the line "FlagsUsedForToggle" doing in a definition of a commandbutton? What I thought it should do is that whenever I use the command, it switches the flags (booleans?) listed in that line from TRUE to FALSE and the other way around. So when I put in "MOUNTED", this flag will be true when I mount and false when I dismount. And based on that flag, I can use the correct models, animations, armors, commandsets… However, replacing the "MOUNTED" with another flag doesn't have the effect that it should. It still toggles the "MOUNTED" flag and the model and animations are picked accordingly. So no matter which button I press, it toggles between foot and horse.

 

My thought-process here:

- there are three different states (foot/horse/fellbeast)

- there are three different transitions (foot-horse / foot-fellbeast / horse-fellbeast) -- each for both directions

- I can use two flags to pick the correct model/animation (will be called "f1" and "f2" here, are actually MOUNTED + something else (which is WEAPONSET_TOGGLE_1 currently but that also results in another problem, see next paragraph below)

--- foot: f1 false, f2 false --> default

--- horse: f1 true, f2 false

--- fellbeast: f1 false, f2 true

- in the transitions, I toggle the flags

--- foot to horse: f1

--- foot to fellbeast: f2

--- horse to fellbeast: f1 and f2

 

 

I put all the animation code from the fellbeasts found in nazgul.ini and added it to my object. In the condition line of each animation (and the model condition state), I added "f2" (see above). When I use WEAPONSET_TOGGLE_1 as "f2" here, then the game doesn't launch because it won't pick an armor based on this weapon set toggle variable (which makes sense I guess) [Errormessage: Token 'WEAPONSET_TOGGLE_1' is not a valid member of the index list]

(Question 2:) Is there a "MOUNTED_2" or something like that? And what do I have to do to make it work in a command like the toggle mounted?

If the answer to Question 1 is that the flags are somehow the condition and not what will actually toggle, then how can I make a special power (or find if there is already one) which toggles a different flag than "MOUNTED" which can also be used for everything needed (modelcondition state, animations, weapon set, armor set)?

 

(Question 3): Or is my thought process completely wrong and it has to be done differently?

 

 

Here are the (I think) relevant parts of the code (tell me if I missed something):

 

 

 

specialpower.ini

Spoiler

commandset.ini

(I didn't find a working way to change the commandset when mounting yet which will be next on the list after it is possible to mount the fellbeast at all. That's why there are some of Eowyn's commands in there.)

Spoiler

commandbutton.ini

Spoiler
CommandButton Command_MountRingWraithFootToHorse
  Command               = SPECIAL_POWER
  SpecialPower          = SpecialAbilityToggleMountedFootToHorse
  TextLabel             = CONTROLBAR:RingWraithMountFootToHorse
  Options		= TOGGLE_IMAGE_ON_WEAPONSET ON_GROUND_ONLY     ; -- not exactly sure what this is by the way
  FlagsUsedForToggle	= MOUNTED
  ButtonImage           = HSMountHorse HSMountFoot
  ButtonBorderType      = ACTION 
  DescriptLabel         = CONTROLBAR:ToolTipRingWraithMountFootToHorse
  InPalantir            = Yes  
  UnitSpecificSound     = FellBeastAlert	;EowynVoiceModeMount		EowynVoiceModeFoot	; Sound when mounting / unmounting
  ;UnitSpecificSound2	= HorseWhinnyForMountButton	UnmountButtonFoley
End

CommandButton Command_MountRingWraithFootToFellbeast
  Command               = SPECIAL_POWER
  SpecialPower          = SpecialAbilityToggleMountedFootToFellbeast
  TextLabel             = CONTROLBAR:RingWraithMountFootToFellbeast
  Options		= TOGGLE_IMAGE_ON_WEAPONSET ON_GROUND_ONLY
  FlagsUsedForToggle	= WEAPONSET_TOGGLE_1
  ButtonImage           = HSMountFellbeast HSMountFoot	;HSTheodenWarSpeech HSTheodenWarSpeech
  ButtonBorderType      = ACTION 
  DescriptLabel         = CONTROLBAR:ToolTipRingWraithMountFootToFellbeast
  InPalantir            = Yes  
  UnitSpecificSound     = FellBeastAlert	;EowynVoiceModeMount		EowynVoiceModeFoot	; Sound when mounting / unmounting
  ;UnitSpecificSound2	= HorseWhinnyForMountButton	UnmountButtonFoley
End

CommandButton Command_MountRingWraithHorseToFellbeast
  Command               = SPECIAL_POWER
  SpecialPower          = SpecialAbilityToggleMountedHorseToFellbeast
  TextLabel             = CONTROLBAR:RingWraithMountHorseToFellbeast
  Options		= TOGGLE_IMAGE_ON_WEAPONSET ON_GROUND_ONLY
  FlagsUsedForToggle	= MOUNTED WEAPONSET_TOGGLE_1
  ButtonImage           = HSMountFellbeast HSMountHorse	;HSTheodenWarSpeech HSTheodenWarSpeech
  ButtonBorderType      = ACTION 
  DescriptLabel         = CONTROLBAR:ToolTipRingWraithMountHorseToFellbeast
  InPalantir            = Yes  
  UnitSpecificSound     = FellBeastAlert	;EowynVoiceModeMount		EowynVoiceModeFoot	; Sound when mounting / unmounting
  ;UnitSpecificSound2	= HorseWhinnyForMountButton	UnmountButtonFoley
End

ringwraith.ini

(moved it out of nazgul.ini to have a file for its own -- no difference when it is in)

(the behaviors for the buttons are at the very bottom)

(I did something similar to the weaponset than what I have for the armorset… I guess it was removed when I needed to go back to an earlier state of my mod)

Spoiler

upgrade.ini

Spoiler

experiencelevels.ini

Spoiler

I hope someone can help me with this  :)


Edited by Super Hippo, 03 February 2019 - 10:55 PM.


#2 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,021 posts
  • Projects:Blue Wizard Mod
  •  yay blue
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 30 January 2019 - 01:16 AM

First of all, hi and welcome :)

I really do not want to put your hopes down, but BFME 1's engine is a lot more limited to BFME 2's/ROTWK's. Many people (including also really skilled coders) have tried to implement a toggle for the Fellbeast in BFME 1 before, but no one has really achieved anything yet. And I'm not talking about the 3-step toggle, I'm just talking about the Fellbeast - on foot toggle. BFME 1's engine seems to have a problem with this transition. I also have investigated for a long time, but I gave up at some point and just decided that my witchking will be unmounted instead.

 

A lot of attempts have also been made to switch it in 2 separate files, and upon button click just kill the objects and spawn new ones. That is problematic because not only can you avoid certain death by just switching states (you get your health back every time), but you can also not maintain rank information upon killing and transfer it to the new object. Another person attempted to do it via Eowyn disguise ability, but I can't remember how that went. Elvenstar Mod managed to make the Witchking switch and maintain some of the information of the animation states, but altogether it was still pretty bugged.

What I suggest you if you want to stay with it (Trying is never wrong, I myself tried a lot of stuff regarding this): Start small. Just try to make the switch between Fellbeast and On-foot work in BFME 1 properly, and you will be a hero for every BFME 1 modder. Once you achieve that, the rest shouldn't be difficult either.

 

EA implemented the MountedTemplate in BFME 2, probably just to make this toggle work properly. There seems to be something that restrained even EA itself from implementing the toggle from foot to air in the classic way. Anyway, it doesn't mean that there is no workaround. I think a good start would be to compare for example Eomer to the fellbeast object, and try to mount and dismount him regularly. Look especially at the GiantBirdAIUpdate and the RiderChangeContain behavior, as these two are the only behaviors that are different between Eomer and the fellbeast (or rather they are unique to the fellbeast/eagles), and it might play a crucial role in the strange toggle behavior.

And no, there does not seem to be a MOUNTED_2 state. Also the FlagsUsedForToggle thing doesn't seem to help. This is a quote from one of EA's coders:

 

 


FlagsUsedForToggle = MOUNTED ;What we really want is to toggle Theoden's audio if he is mounted or unmounted. Ya, this is a hack

 

So I suppose it just lets the game know which audio to use, or maybe even just changes the weaponset or armorset. Never looked to much into it but it doesn't look like it's really necessary for the power to work.

Don't worry, BFME 1's engine confuses all. Sometimes I really wonder why I mod BFME 1 and not BFME 2... but there are good sides in both games. Anyway, feel free to come back with more questions if you have, I'm also still somewhat interested in this ability. But it just took too many of my nerves.  :xd:


Edited by Echo, 30 January 2019 - 01:23 AM.

26285.png


#3 Super Hippo

Super Hippo
  • Members
  • 25 posts

Posted 30 January 2019 - 04:09 PM

Hi Echo,

thank you for your reply! It gave me some hope. Even though it isn't exactly what I was hoping for. :wink_new:

 

I just tried two things. First was that I gave the MOUNTED flag of the animations to the fellbeast instead of the horse… but I must have messed something up because the game crashed when I build a nazgul even when I reset the nazgul/ringwraith object to the original… Need to investigate.

 

Second was that I tried to restart from the original files and make the nazgul dismount his fellbeast and mount a horse instead, using a normal mount toggle. (Shouldn't matter if I toggle to foot or horse. Used horse so I already have the "MOUNTED" flag on the animations.) What happened was that the sound was playing, it faded out, it faded back in and it was the same as before. Now I used "RIDER2 MOUNTED" in the ModelConditionState and it changes from fellbeast to horse, but it is still flying, moving and attacking like a fellbeast. Somehow it is using different animations/AnimationStates than a "normal" unit, I guess. But I don't have an idea what is causing it to use a different one.

In the locomotor.ini, the locomotors have a "Surfaces" line [GROUND / AIR] (and a lot more information I am not familiar with), so I thought that this might be causing this problem. Adding another Locomotorset for the mounted state didn't change anything though:

	LocomotorSet
		Locomotor = HeroHorseLocomotor
		Condition = SET_MOUNTED 
		Speed     = 2000 ;90 --- high speed to see the difference immediately (if there would be a difference)
	End	

Short question here: Why is it SET_MOUNTED in the Locomotors while it is MOUNTED for animations?

 

To the extra behaviors… The fellbeast is like a "Transport" (see RiderChangeContain-Bevavior), but I have no clue how the transport can be left. (I only see the ExitTransportOnDeath.) This behavior is the same for the ringwraith/witchking except for the InitialCrew.

 

The fellbeast has "ThingClass = LARGE_MONSTER" (Eomer doesn't, but both have 1 Transport_Slot) which might also become a problem because I don't see a way to toggle it. (Or it is also a large monster when not on the fellbeast. Not too sure if it matters at all)

 

I never played BFME 2 and I also don't own it so I don't have the witchking code to check it is done there.

 

The main problem I see when trying to implement something is that I don't know which behaviors exist, how each behavior is working exactly and not even when they are called. Some (like UnpauseSpecialPowerUpgrade) have a TriggeredBy-line which makes it quite obvious. But for example the "RiderChangeContain"-behavior doesn't have a line like this, so maybe it is only executed once at the beginning when the object is created, but if there isn't a way to change the rider in the middle of the game, then "InitialCrew" and listing more than one possible rider seem odd. Despite the fact that the name "...Change..." suggests that it would be used to change the rider.

 

But in the end, I have the feeling that it is impossible when it was tried by a lot of people and all of them failed.  :sad:



#4 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,021 posts
  • Projects:Blue Wizard Mod
  •  yay blue
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 30 January 2019 - 07:29 PM

As I said, don't focus too much on the fellbeast-horse-foot version, just try the fellbeast-foot for now. Once you figure something out concerning that, the other mount really should not be a problem - regular mounting is not too difficult to achieve.

 

I don't know why EA varied between MOUNTED in the Model Condition and SET_MOUNTED in the locomotor/weapon sets, it seems to just be a design choice by them. They're linked though. I also feel like the "ToggleMountedSpecialAbilityUpdate" is directly linked to these conditions, and triggers the actual MOUNTED model condition. 

I understand what you mean, it truly is confusing which behavior takes certain components and which doesn't. I'm still not familiar with all of them after gathering a lot of modding experience. But this is also part of the fun and challenges to overcome. BFME2/ROTWK allows the WK to dismount through a "MountedTemplate", which is basically just transferring the Witch-kings current information (health, cooldowns, experience) to the unmounted Witch-king, and vice-versa. This is not really of any concern because it doesn't work in BFME 1 unfortunately. 

 

I would actually not worry too much about the ChangeRiderContain module. It seems like if you split The WitchKing and the Fellbeast in 2 individual Objects (without inheritance from the other), you can leave it out for the start. I will also take a look at this ability, maybe I can figure something out. Another thing to keep in mind is that the Witch-king's original scale (fellbeast) is 0.8, while the unmounted Witch-king is a really tiny object even without scale. So you'll either end up with a really tiny unmounted Witch-king, or a gigantic Witch-king on its fellbeast. :p

 

 

Edit: So I've reached this state:

The Witch-king uses the unmounted animations flawlessly, but the problem is indeed the GiantBiardAIUpdate thing. An AIUpdate is directly connected to the locomotor set, so if you remove the GiantBirdUpdate, you also remove some functionality of the unit itself. And if you leave the GiantBirdAIUpdate in, it will trigger the mounted/air locomotor automatically and in this case the WK goes cray cray. So for now, I took the GiantBirdAIUpdate out. The Mounted version of the Witchking therefore does the animations nearly flawlessly, but it's not moving :p

 

I went into the locomotor, removed GIANT_BIRD and now he's moving, but no longer playing the attack animation. And on Osgiliath he's really struggling with the bridge. :p

 

if you (or anyone else) want to check what I have, it's here:

Witchking code:

 

Spoiler

 

 

The locomotor:

Spoiler

 

 

The commandset (can be anything, just needs a toggle mount)

Spoiler

 

 

The commandbutton:

Spoiler

 

 

The next step would be to find out if there's a way to actually disable the GIANT_BIRD locomotor manually. Or if there's a way to enable or disable AIUpdateInterface behaviors.

2nd Edit:  No idea why it formatted the code so strangely..  :whathuh:


Edited by Echo, 01 February 2019 - 11:35 PM.

26285.png


#5 Super Hippo

Super Hippo
  • Members
  • 25 posts

Posted 01 February 2019 - 02:51 PM

I figured this scale thing out when I saw the witchking unmounted the first time (just placed him in through Worldbuilder). I already scaled every nazgul/witchking model (foot and horse) (+30 %, didn't know the 0.8 which would result in a +25 %. However, they are about as big as a "normal human").

 

Just tested your code. (Had to change a few things duo to compatibility to 1.03.) Witchking on-foot is invisible, but the change to the fellbeast works perfectly! But yes, I see the problem with the attacks and those bridges... (no idea why you had the idea to test it on the bridges, but nice catch :thumbsupcool: )

 

I thought ...AI... would mean that only the AI makes use of this method... guess I was wrong.

 

Thinking of my last message talking about the fellbeast as a transport brought me to the idea that the mumakil is also a transport which units can enter. And it also has a way to evacuate them. But the command doesn't really have a behavior defined to it. There is only the "HordeTransportContain" module. But even if this could be transferred to the Nazgul, this would still be different in many ways...

 

Spoiler

(I wonder what the cavalry is doing in the PassengerFilter line.)

 

 

It seems like you are "close" to make it work. But I also thought I was close when I started this topic. I thought the fellbeast would be the smallest problem because the code is already there...  :ermm:

 

One little thing: You are saying that the horse as the second mount wouldn't be a problem once it is figured out how to use the foot/fellbeast. But how? I mean you use the MOUNTED flag for the fellbeast. So this flag is gone and can't be used for the other mount.

 

 

For the code formatting: The 'code'-tag here in the forum doesn't seem to work that well with the syntax used in BFME. The green text is used for Strings but because comments (semicolon until end of line) aren't detected, a apostrophe (') inside a comment starts a String, too. None of the available code types detects comments with semicolon, but the JavaScript one doesn't start Strings with apostrophe at least. So no half green codes with that one.



#6 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,021 posts
  • Projects:Blue Wizard Mod
  •  yay blue
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 01 February 2019 - 11:28 PM

Kind of a hack, but you could trigger a ModelConditionUpdate + LocomotorSetUpdate +CommandSet change via Upgrade that the Nazgul gets on button click and changes model conditions, and the same for going back on foot. This *should* work, but I have not tested it just yet. I'm sure there are other ways also, but this would be my first try.

 

The model is probably invisible because it's supposed to be "MUWchKng_SKN" instead of "MUWchKing_SKN". In my mod he uses a different model. I edited my post. Also 0.8 scale actually means that he shrinks by 20%. EA's default size for the fellbeast is 0.8, but the unmounted Witch-King (in order to look somewhat normal) should be around 1.3-1.5... that's another issue here. :p

 

I also thought about TransportContain behavior, but how do you then get rid of the fellbeast if you dismount? A lot of hacks are possible with this, but I did not yet find a "clean" way to get the Witch-king to unmount in BFME 1... the Cavalry tag is interesting indeed, could be one of EA's original plans for the Mumakil, for instance that he can impale Rohirrim or something...


Edited by Echo, 01 February 2019 - 11:35 PM.

26285.png


#7 Miraak5

Miraak5

    Dragonborn

  • Members
  • 322 posts
  • Location:France
  • Projects:ROTWK Patch 2.02, BFME1 Patch 1.08
  •  BIG coding, Map scripting and AI coding

Posted 03 February 2019 - 10:25 AM

I dont think you will ever be able to implement fellbeast toggle for bfme1
because the onfoot and flying objects need specific codes and stuff that are diffrent from each other, unlike classic mounted heroes

 

in rotwk using the regular mounted code will also cause these problem, it can only work with the object toggle code but sadly it did not existed in bfme1


He was the first...


#8 Super Hippo

Super Hippo
  • Members
  • 25 posts

Posted 03 February 2019 - 04:26 PM

Changing ModelConditionUpdate, LocomotorSetUpdate and CommandSet doesn't change the way he attacks in air I guess  :sad: 

 

I meant when it is 80 % of "normal" size, then you need to scale it up by 25 % to have it at 100 % again. 0.8 * (1+0.25) = 4/5*5/4 = 1

 

And yeah, that's where my thought were, too... the fellbeast as a transport had to leave the visible world. Maybe making it invisible or move it below the earth or very far away in the sky. In addition, the fellbeast's kills should give experience to the rider and not the "transport". Probably not going to work either way.

 

Just tried, you can put Rohirrim on a Mumakil… but they are invisible and don't have an effect. Probably because they don't have a passenger bone assigned in the HordeTransportContain. Legolas however can't enter it.

 

 

Hm, I guess it isn't possible to edit the game.dat or even take the one from BFME2 to get access to this mount template, right?  :unsure:

 

Right now, all heroes start at level 1 but even a weak fellbeast is still a fellbeast. So having nine of them without the downside of them needing to level to get access to the fellbeast is quite ridiculous. In the lategame, they should have access to nine on fellbeast, but in the mid-game this is probably too much.

The only good thing about not making it work is that I don't have to think about giving the foot/horse ones abilities besides screech which is probably not that much of a help without the fellbeast.

Maybe I should move on to other ideas but I fear they won't work either  :sad:







Also tagged with one or more of these keywords: two mounts, flags

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users