Nert's Coding Questions
#21
Posted 29 June 2009 - 06:25 PM
Or try altering the wall's geometry codes.
#22
Posted 02 July 2009 - 07:48 AM
Flying units - specifically those based on the Eagle skeleton, seem to appear from the sky when they're built. While this works as a summon, it's not good for places that train birds. Anyone know how to change this so that they'll launch from a buildin't defined exit point? It doesn't look like the locomotor has anything relevant, nor anything that I can find in the ini... but it seems like such a simple change that I'm probably just missing a little thing.
I really don't do requests and my Arnor Soldier is not fit for BFME. Don't ask me for either.
#23
Posted 02 July 2009 - 11:52 PM
One possible solution: make an "egg" object, and purchase it from the building. GIve it a lifetimeupdate so it dies immediately after being purchased, and have it trigger an ocl upon death. Have that ocl spawn your unit. You add an offset to the ocl, so just set the xyz coordinates to the building's exit point. Set z to 0, for example, to have them lift off from the ground.
#24
Posted 03 July 2009 - 12:21 AM
-Gto
Click on my Sig to go to my BFME Modding site where you can download my mods.
Kings of the West Mod Leader
*Retired. PM me if you need to get a hold of me as I'll get an email notification and should reply within a day or so*
#25
Posted 03 July 2009 - 05:34 PM
edit- worked nicely, thanks! now i have to solve the rest of the bugs with the unit
Edited by Nertea, 03 July 2009 - 06:49 PM.
I really don't do requests and my Arnor Soldier is not fit for BFME. Don't ask me for either.
#26
Posted 09 July 2009 - 07:08 PM
I really don't do requests and my Arnor Soldier is not fit for BFME. Don't ask me for either.
#27
Posted 09 July 2009 - 07:27 PM
-Gto
Click on my Sig to go to my BFME Modding site where you can download my mods.
Kings of the West Mod Leader
*Retired. PM me if you need to get a hold of me as I'll get an email notification and should reply within a day or so*
#29
Posted 09 July 2009 - 10:59 PM
I really don't do requests and my Arnor Soldier is not fit for BFME. Don't ask me for either.
#31
Posted 11 July 2009 - 04:46 AM
This is how I would do it
First you have the building to set an upgrade once it is built then you have the unit need that upgrade to build in the Command Button
Options = NEED_UPGRADE NeededUpgrade = Upgrade_Whatever
Edited by Radspakr, 11 July 2009 - 04:51 AM.
Break dancing into the hearts of millions
#32
Posted 13 July 2009 - 03:22 PM
Ok, a new and more complex question. I have a unit which I'm trying to make use a series of "orders" that you purchase at a unique (only one constructable) building. Essentially you'd be able to purchase an upgrade from that building that would affect all of the units on the map - easy enough with a player type upgrade. However, here's the catch - the upgrades should be exclusive and replaceable. At the structure, I want to be able to purchase Orders Type 1, then be able to, from there, purchase Orders Type 2... which would make purchasing orders Type 1 possible again. So basically, there's
Upgrade 1 OR Upgrade 2 OR Upgrade 3, with only one active at a time.
After screwing with wall upgrades for a long time, I'm pretty sure I know how to grant and remove upgrades using an ObjectCreationUpgrade. This seems to work... I can kill my speed upgrade with some code like this (on purchasing a sight range upgrade):
Behavior = ObjectCreationUpgrade TheSightUpgrade TriggeredBy = Upgrade_RavenSight Delay = RAVEN_PURCHASE_DELAY RemoveUpgrade = Upgrade_RavenSpeed Upgrade_RavenStealth EndI haven't extensively tested this mind you, because there's a larger problem - though this seems to remove the PLAYER upgrade from play, it doesn't refresh the commandset, so the RavenSpeed upgrade can't be repurchased. So, am I missing something? I have a hunch that I may need to find a different way to code this, but the only other way I can think of of doing this (objcet upgrade unpausing a speed, sight or stealth leadership upgrade) is messy.
I really don't do requests and my Arnor Soldier is not fit for BFME. Don't ask me for either.
#33
Posted 13 July 2009 - 04:34 PM
You then have the 'upgrade' trigger the formation toggle using CommandTrigger = Command_RavenToggleStealth.
Where Command_RavenToggleStealth is a hidden command, so it appears in the raven commandset file, but not in the palentir.
And the upgrade is not actually an upgrade, just a fake button.
No idea if the toggle would work though on a global basis.
#34
Posted 13 July 2009 - 06:39 PM
So you'd end up with something like:
Behavior = ObjectCreationUpgrade TheSightUpgrade TriggeredBy = Upgrade_RavenSight Delay = RAVEN_PURCHASE_DELAY RemoveUpgrade = Upgrade_RavenSpeed Upgrade_RavenStealth End Behavior = CommandSetUpgrade ModuleTag_something TriggeredBy = Upgrade_RavenSight CommandSet = RavenSightCommandSet End
Wouldn't that 'refresh' the commandset so that you could then purchase the other options?
Edit: then you'd just copy that twice for the other two states. So you'd end up with 6 behaviors and 3 commandsets implementing the toggle.
-Gto
Edited by GothmogtheOrc, 13 July 2009 - 06:41 PM.
Click on my Sig to go to my BFME Modding site where you can download my mods.
Kings of the West Mod Leader
*Retired. PM me if you need to get a hold of me as I'll get an email notification and should reply within a day or so*
#35
Posted 13 July 2009 - 06:54 PM
Behavior = CommandSetUpgrade ModuleTag_RemoveAllSight TriggeredBy = Upgrade_DwarfRavenSight ; Triggered by the sight upgrade RemovesUpgrades = Upgrade_DwarfRavenStealth Upgrade_DwarfRavenSpeed; disables the speed and stealth upgrades CommandSet = DwarfRookeryCommandSetSightOn ; change to the speed is on commandset End Behavior = AttributeModifierAuraUpdate ModuleTag_UpgradeSight TriggeredBy = Upgrade_DwarfRavenSight ConflictsWith = Upgrade_DwarfRavenSpeed Upgrade_DwarfRavenStealth StartsActive = No BonusName = RavenSightBonus RefreshDelay = 1000 Range = 100000 ObjectFilter = NONE +DwarfRaven End
-edit: Ok, solved this I think in a rather awkward way. Now when you purchase an upgrade, I do this:
Behavior = ObjectCreationUpgrade StealthUpgrade02 TriggeredBy = Upgrade_DwarfRavenStealth Delay = 0.1 GrantUpgrade = Upgrade_DwarfRavenStealth DestroyWhenSold = Yes EndWhich forces the thing to reuupgrade 0.1 seconds after you purchase an upgrade. So far it works, I'll let people know if there are any issues.
A pair of other questions have popped up though:
1) MaxSimultaneous of type doesn't seem to work on plot buildings. Anyone have any ideas for this? (Beyond a commandset upgrade when the building is built, because with all my upgrade hacks I fear the upgrade limit doth approach. Not to mention that I'm not sure how to remove such an upgrade when the building dies or is sold)
2) I'm 90% sure I'm going to hit the limit anyways; what kind of upgrades can be removed from the stock code to free up some slots?
Edited by Nertea, 13 July 2009 - 07:37 PM.
I really don't do requests and my Arnor Soldier is not fit for BFME. Don't ask me for either.
#36
Posted 13 July 2009 - 09:17 PM
;---------GOOD LVL 1--------;
Upgrade Upgrade_GoodHeroLV1Ability
Type = OBJECT
End
;---------GOOD LVL 2--------;
Upgrade Upgrade_GoodHeroLV2Ability
Type = OBJECT
End
;---------GOOD LVL 3--------;
Upgrade Upgrade_GoodHeroLV3Ability
Type = OBJECT
End
;---------GOOD LVL 4--------;
Upgrade Upgrade_GoodHeroLV4Ability
Type = OBJECT
End
;---------GOOD LVL 5--------;
Upgrade Upgrade_GoodHeroLV5Ability
Type = OBJECT
End
;---------GOOD LVL 6--------;
Upgrade Upgrade_GoodHeroLV6Ability
Type = OBJECT
End
;---------GOOD LVL 7--------;
Upgrade Upgrade_GoodHeroLV7Ability
Type = OBJECT
End
;---------GOOD LVL 8--------;
Upgrade Upgrade_GoodHeroLV8Ability
Type = OBJECT
End
;---------GOOD LVL 9--------;
Upgrade Upgrade_GoodHeroLV9Ability
Type = OBJECT
End
;---------GOOD LVL 10--------;
Upgrade Upgrade_GoodHeroLV10Ability
Type = OBJECT
End
;---------EVIL LVL 1--------;
Upgrade Upgrade_EvilHeroLV1Ability
Type = OBJECT
End
;---------EVIL LVL 2--------;
Upgrade Upgrade_EvilHeroLV2Ability
Type = OBJECT
End
;---------EVIL LVL 3--------;
Upgrade Upgrade_EvilHeroLV3Ability
Type = OBJECT
End
;---------EVIL LVL 4--------;
Upgrade Upgrade_EvilHeroLV4Ability
Type = OBJECT
End
;---------EVIL LVL 5--------;
Upgrade Upgrade_EvilHeroLV5Ability
Type = OBJECT
End
;---------EVIL LVL 6--------;
Upgrade Upgrade_EvilHeroLV6Ability
Type = OBJECT
End
;---------EVIL LVL 7--------;
Upgrade Upgrade_EvilHeroLV7Ability
Type = OBJECT
End
;---------EVIL LVL 8--------;
Upgrade Upgrade_EvilHeroLV8Ability
Type = OBJECT
End
;---------EVIL LVL 9--------;
Upgrade Upgrade_EvilHeroLV9Ability
Type = OBJECT
End
;---------EVIL LVL 10--------;
Upgrade Upgrade_EvilHeroLV10Ability
Type = OBJECT
End
This will let you get rid of all hero power related upgrades. That will save you plenty of spots.
If you need more you can do this:
Upgrade Upgrade_One
Type = OBJECT
End
Upgrade Upgrade_Two
Type = OBJECT
End
Upgrade Upgrade_Three
Type = OBJECT
End
Upgrade Upgrade_Four
Type = OBJECT
End
Upgrade Upgrade_Five
Type = OBJECT
End
Upgrade Upgrade_Six
Type = OBJECT
End
Upgrade Upgrade_Seven
Type = OBJECT
End
Upgrade Upgrade_Eight
Type = OBJECT
End
Upgrade Upgrade_Nine
Type = OBJECT
End
Upgrade Upgrade_Ten
Type = OBJECT
End
That way, any specific OBJECT upgrades can be easily replaced. And they can be used in as many different units, heroes, and buildings as you need... they won't override each other or anything.
Now, I understand that your problem is that you are using PLAYER upgrades. But I'm willing to bet that you could do the same sort of thing. If you create 10 or more generic upgrades and make them all player then you can use them for the different factions and that should cut down on the number of upgrades you need. Or to make them clearer you could name them something like: TechnologyBasicTraining which would be used by all factions in place of their unique banner carrier PLAYER upgrades. Or maybe you could do two, one for good and one for evil since they seem to use audio clips. But you get the idea.
The max number of upgrades you can have is somewhere between 189 (currently working for me) and 197 (caused error). But you should be able to use generic upgrades and cut the number needed down a lot.
-Gto
Edited by GothmogtheOrc, 13 July 2009 - 09:19 PM.
Click on my Sig to go to my BFME Modding site where you can download my mods.
Kings of the West Mod Leader
*Retired. PM me if you need to get a hold of me as I'll get an email notification and should reply within a day or so*
#37
Posted 13 July 2009 - 10:17 PM
No idea on limiting the number of buildings of a type to one?
I really don't do requests and my Arnor Soldier is not fit for BFME. Don't ask me for either.
#38
Posted 13 July 2009 - 11:43 PM
-Gto
Click on my Sig to go to my BFME Modding site where you can download my mods.
Kings of the West Mod Leader
*Retired. PM me if you need to get a hold of me as I'll get an email notification and should reply within a day or so*
#39
Posted 14 July 2009 - 03:26 AM
1) Granting a PLAYER upgrade (Upgrade_DwarfRookeryExists) when the building is constructed
2) The plot foundation has a commandset upgrade behaviour that swaps the commandset for one with a dummy button for the building that cannot be built, and removes Upgrade_DwarfRookeryDoesNotExist
3) On destruction of the building, it spawns an object that grants another PLAYER upgrade (Upgrade_DwarfRookeryDoesNotExist), then dies quickly
4) The plot foundation has a second commandset upgrade that swaps the commandset back to the original and theoretically removes the Upgrade_DwarfRookeryExists
That should work in theory; but it only works once. The upgrades don't get removed, and therefore if the building gets killed once you can rebuild an infinite amount of them. Not ideal. I can't find any occasion in the vanilla inis where a PLAYER upgrade is removed either, so this method is probably a no-go.
Thoughts?
I really don't do requests and my Arnor Soldier is not fit for BFME. Don't ask me for either.
#40
Posted 14 July 2009 - 09:21 AM
IF
Local Player has instances of DwarfRookery equal to 1
THEN
Local Player cannot build DwarfRookery
Have the script re-evaluate constantly.
So not a solution that could be used for a while. No guarantees it would work either, I don't know how much AI is used when the team is user-controlled.