Jump to content


Photo

Resolution: Use MOUNTEDTEMPLATE to "upgrade" the toggled commandset

commandsetupgrade monitorconditionupdate commandset modelconditionupgrade player_upgrade

  • Please log in to reply
13 replies to this topic

#1 Sleetil

Sleetil
  • Members
  • 140 posts

Posted 14 June 2012 - 11:23 PM

EDIT2: This issue is resolved, title states solution

Hm.. My first time back on 3rd Age for almost two years. Haha. JUS_SAURON, Ridder Geel, nice to see you both still active on the forums! Working on anything right now?

So I read up on a couple guides in the 3rd Age about using MonitorConditionUpdate to swap commandsets, so I implemented it. E.g.

Behavior = MonitorConditionUpdate ModuleTag_CommandSetAlt
WeaponSetFlags = WEAPONSET_TOGGLE_1
WeaponToggleCommandSet = AlternateCommandSet1
End

However, now I am trying to solve the dilemma of creating upgraded commandsets (through player upgrades) for both the default commandset AND the toggled commandset. Since commandsetupgrade only applies to the default commandset, I tried this code

Behavior = ModelConditionUpgrade ModuleTag_AllowAltCommandSet3
TriggeredBy = Upgrade_FireArrows Upgrade_Bow2
AddConditionFlags = WEAPONSET_TOGGLE_2
Permanent = Yes
End

Behavior = MonitorConditionUpdate ModuleTag_CommandSetAlt
WeaponSetFlags = WEAPONSET_TOGGLE_2 WEAPONSET_TOGGLE_1
WeaponToggleCommandSet = AlternateCommandSet3
End

But upon launch, the game seems to assume that the unit already has WEAPONSET_TOGGLE_2 as a flag. When I trigger WEAPONSET_TOGGLE_1 before applying any player upgrades, it uses AltCommandSet3 as opposed to AltCommandSet1. (P.s. these codes are just examples).

Just want to know if any of you have done this or something similar and gotten it to work.

Edited by Sleetil, 18 June 2012 - 06:44 PM.


#2 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 15 June 2012 - 01:20 AM

Sorry, don't think i can be of much help here, don't believe i've done this before :p
Although perhaps i can look at it when my vacation starts (got more time then)
Ridder Geel

#3 Elric

Elric

    Designer

  • Hosted
  • 2,857 posts
  • Projects:Middle-Earth Expanded
  •  Coder
  • Donated

Posted 15 June 2012 - 08:00 PM

Hey Sleetil,

Good to see you again. I am KingsRanger the last noob you helped out before leaving. haha

Now on to your problem at hand:

Did you try just doing the regular old commandset switch? Make sure that works then you can do the commandset upgrade.

I am going to assume you read this tutorial.

Now i have a few questions which are pretty easy to answer.

Question: Are you aiming to make it so that the unit starts with the commandset toggle and then at a certain level it switch the second commandset to the 3rd commandset?


If this is the case follow the same steps for the tutorial except you will want to add a 3rd commandset. But instead of WEAPONSET_TOGGLE_3 put a USER state. The Game does not have WEAPONSET_TOGGLE_3 defined. You could also make it do a fake MOUNT type deal. Do it through child objects upgrades and such. An example of such a fake MOUNT and child object is Faramir but he actually Mounts. Just make it so the unit doesnt mount but all it does is switches the command sets. I will give a proper 'demo' a little bit later.


P.s- If you want a refresher of you helping me look here.

Edited by {IP}Apollo, 15 June 2012 - 08:02 PM.


#4 Sleetil

Sleetil
  • Members
  • 140 posts

Posted 15 June 2012 - 10:35 PM

Thanks for the replies, Ridder Geel and {IP}Apollo (and nice to see you again, from the looks of your sidebar it looks like you got quite busy on Revora :p)

Did you try just doing the regular old commandset switch? Make sure that works then you can do the commandset upgrade.

I did and it did not toggle to the default commandset. Also, the issue here is that I'm trying to apply a "commandsetupgrade" to the toggled commandset, but that particular code only functions for the default commandset, thus the attempt to find a workaround

Question: Are you aiming to make it so that the unit starts with the commandset toggle and then at a certain level it switch the second commandset to the 3rd commandset?


No, the commandset upgrades in this case aren't related to experience levels or having the flag WEAPONSET_TOGGLE_1 on creation

Basically I am coding for two units. The first administers the player_upgrades (through commandbuttons), while the second has different commandsets based on what player_upgrades the player has chosen. I am trying to make it so that the second unit's toggled commandset will respond to these upgrades as well (and it's not something I can simplify, as there are upwards of 60 commandsets for the unit).

I see what you mean by using a ChildObject, but I think at this point I'm just trying to stay away from dealing with ChildObjects unless it's necessary :p As a sidenote question, is it possible to define new flags through code? If the game isn't acknowledging the flags I put in, then that's probably the issue.

#5 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 15 June 2012 - 11:31 PM

Nope you can't make new flag (Enumerator values is the correct name i believe). This stuff is hardcoded.
Ridder Geel

#6 Elric

Elric

    Designer

  • Hosted
  • 2,857 posts
  • Projects:Middle-Earth Expanded
  •  Coder
  • Donated

Posted 16 June 2012 - 01:42 AM

Yes, Indeed. I wish to that we could make new flags but it is hard coded. The easiest way to start you on the way to what you want is to get the default command set switch working and then switch then try and make a child object doing what you want. It wouldnt require as much trail and error plus it would be organized in the long run. I will do some foolery and see if i can start ya up.

#7 Guest_Sleetil_*

Guest_Sleetil_*
  • Guests

Posted 16 June 2012 - 02:06 AM

Eww, what a shame.

No worries about giving me a head start, I know what to do, just gotta get to actually coding it :p
And there wasn't an issue getting the default commandset toggle to work, it's just that the toggle was being overridden (order of code)

#8 Elric

Elric

    Designer

  • Hosted
  • 2,857 posts
  • Projects:Middle-Earth Expanded
  •  Coder
  • Donated

Posted 16 June 2012 - 02:48 AM

It happens. Sorry to disappoint you, There may be away from what you were doing. I may have to look in to something like that..

#9 Sleetil

Sleetil
  • Members
  • 140 posts

Posted 16 June 2012 - 03:06 AM

OH! *slaps forehead* I think I figured out the issue awhile back and forgot. It is the required flags in monitorconditionupdate:

WeaponSetFlags = WEAPONSET_TOGGLE_1 WEAPONSET_TOGGLE_2

The game reads it as WEAPONSET_TOGGLE_1 OR WEAPONSET_TOGGLE_2, so the issue is that there's no such code as "RequiresAllFlags = Yes" :'(

Edit: Sidenote - I used WEAPONSET_TOGGLE_3 as a flag for a weaponsetupgrade and it not only doesn't crash the game, but also works successfully

Edited by Sleetil, 16 June 2012 - 03:14 AM.


#10 Elric

Elric

    Designer

  • Hosted
  • 2,857 posts
  • Projects:Middle-Earth Expanded
  •  Coder
  • Donated

Posted 16 June 2012 - 03:50 AM

That is weird. When i tried using that WEAPONSET 3 it doesnt work.. I will defiantly have to try that out now.

#11 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 16 June 2012 - 04:41 PM

.I hope the unit is a hero or single unit like berserker

1. Give the unit Hero the Normal commandset switcher
2. Give the unit Hero an upgrade that allows a commandbutton to be triggered
3. Trigger a mount behavior automatically on upgrade
4. the 'New' mounted hero has a new commandset and a new toggled commandset
You need different objects ..not just childobjects .. for this to work as you don't want a commandset clash

Think aragorn with two commandsets upgrading to gimli with two new commansets

Edited by JUS_SAURON, 16 June 2012 - 05:03 PM.


#12 Elric

Elric

    Designer

  • Hosted
  • 2,857 posts
  • Projects:Middle-Earth Expanded
  •  Coder
  • Donated

Posted 16 June 2012 - 08:29 PM

Ya thats what i had in mind JUS.. I just didnt know how to explain it. :p

#13 Sleetil

Sleetil
  • Members
  • 140 posts

Posted 18 June 2012 - 06:49 PM

Thanks for the help guys!
My concern with (and reason I initially stayed away from) using an object/childobject was that I thought a new object might ignore player_upgrades that had already been purchased, therefore not being up-to-grade on its primary commandset (CommandSetUpgrade); however, quite contrarily the new objects do acknowledge upgrades attained prior to their creation

#14 zezkersar

zezkersar

    Valar of Modding

  • Project Team
  • 125 posts
  • Location:U.S.A.
  • Projects:RC Mod, FB2G, WOTV
  •  One modder to rule them all

Posted 12 February 2013 - 08:16 PM

This is definitely more complex than most coders seem to get :o






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users