Jump to content


Photo

Dwarven Riches Not Working


Best Answer Jokuc, 28 May 2017 - 07:25 PM

I tried it on an other map (One of yours actually, Chetwood Hills, very nice!)

 
Oh god no, not one of those 8 year old maps with cringeworthy grammatically flawed descriptions... Wait, people are actually playing it? I'm amazed! Gotta make some improvements to that one for the map pack I'm working on...
 
 
 
Anyway, I fixed your problem. Wanted to try it out for myself and see if it was just a mistake on your end, but I ended up spending hours trying to figure out why it was not working. If you answered (or maybe you didn't understand it?) my question about the bonus effect draw I probably would've been able to figure out a solution faster :p
 
"Also, you say you see the effect, do you see the effect of the special power only or does the power successfully trigger the bonus effect draw in elvenmallorntree.ini (the constant glow around the building)?"
 
If you had the constant glow, that would mean that the AttributeModifier was applied correctly, since the draw module is triggered by the modifier. Since you said you saw the fx, I thought the issue had something to do with the building's resource system. When I tried your code however, the power indeed showed the 3 second animation with the glow, but the glow which should stay around the building for a couple of minutes did not appear.. Meaning that the modifier didn't get applied, even though your code was correct. It's a bug in map.ini that probably occurs because certain filters are hardcoded, but there's some ways around it.

 

Replace the DwarvenRiches module in your ElvenSpellbook_Override object with this:

AddModule
	Behavior = SpecialPowerModule ModuleTag_DwarvenRiches
		SpecialPowerTemplate = SpellBookDwarvenRiches
		AttributeModifier = SpellBookDwarvenRiches
		AttributeModifierRange = DWARVENRICHES_EFFECT_RADIUS
		AttributeModifierAffects = INDUSTRY_TYPE_SPELL_OBJECT_FILTER +AIRCRAFT
		TriggerFX = FX_DwarvenRiches
		UpdateModuleStartsAttack = No
		AvailableAtStart = No
		RequirementsFilterMPSkirmish = SPELL_BOOK_REQUIREMENTS_FILTER
		RequirementsFilterStrategic = SPELL_BOOK_REQUIREMENTS_FILTER_STRATEGIC
	End
End

Then add this to the bottom:

Object ElvenMallornTree
	KindOf = +AIRCRAFT
End

You'll have to add KindOf = +AIRCRAFT to all the farms if you want it to work on other buildings than just the Mallorn Tree. 

 

Don't forget to mark the thread as answered if you're happy with the solution :)

Go to the full post


  • Please log in to reply
6 replies to this topic

#1 Zakabuzz

Zakabuzz
  • Members
  • 5 posts

Posted 16 May 2017 - 10:17 AM

Hey guys!

I've replaced the Elven spellbook tree on a map, everything works perfectly fine, but for some reason Dwarven Riches does not. I get the power, use it, I see the effect, hear the FX, power goes cooldown but the production does not increase.

It's a custom map and everything's written in map.ini, because I want these change to be present on this map only, as I like to play normally online and on other maps.

 

Small things but it drives me crazy, any help much appreciated, thanks! :)



#2 Jokuc

Jokuc

    Hardcore Procrastinator

  • Members
  • 187 posts
  • Location:Sweden
  •  Mapper

Posted 26 May 2017 - 05:43 PM

What exactly did you do? Did you edit the Dwarven Riches power or did you just put it in a 10 power slot in the elves spellbook? When you are elves, will the production change if you use it on let's say a dwarven mine? It should work vice versa (dwarves uses it on elven tree) so it seems like the game isn't reading the attribute modifier correctly.. Does the same problem occur if you give Mordor Isengard's Industry power? Also, you say you see the effect, do you see the effect of the special power only or does the power successfully trigger the bonus effect draw in elvenmallorntree.ini (the constant glow around the building)?

 

I don't see why you would, but also make sure you didn't accidentally mess with the recourse modifier's object filter.



#3 Zakabuzz

Zakabuzz
  • Members
  • 5 posts

Posted 27 May 2017 - 08:56 AM

Hey Jokuc, thanks for answering!

I did not touch the resource modifier or anything. In fact, I can only use the Dwarven Riches on resources buildings, as I should be. The radius goes white, meaning I can use it on selected building (Mallorn, Farm, Furnace...), and then when I click I see the sort of orange smoke, hear the whip or whatever that is, but the building is simply not producing anything more... I have the list of powers in my .ini, with appropriate prerequisites and number of points needed, commandset is fine too and then I have the module override, here's the one for Dwarven Riches, taken from system.ini and paste in my map.ini :

 

Spoiler


I can only use it on resource building, I think I've tried them all, always the same result, I can "use" the power but not having it effectively working. I'm gonna have a look at Industry but I think it'll be the same.


Edited by Zakabuzz, 27 May 2017 - 09:00 AM.


#4 Jokuc

Jokuc

    Hardcore Procrastinator

  • Members
  • 187 posts
  • Location:Sweden
  •  Mapper

Posted 27 May 2017 - 09:57 PM

Hey Jokuc, thanks for answering!

I did not touch the resource modifier or anything. In fact, I can only use the Dwarven Riches on resources buildings, as I should be. The radius goes white, meaning I can use it on selected building (Mallorn, Farm, Furnace...), and then when I click I see the sort of orange smoke, hear the whip or whatever that is, but the building is simply not producing anything more... I have the list of powers in my .ini, with appropriate prerequisites and number of points needed, commandset is fine too and then I have the module override, here's the one for Dwarven Riches, taken from system.ini and paste in my map.ini :

 

Spoiler


I can only use it on resource building, I think I've tried them all, always the same result, I can "use" the power but not having it effectively working. I'm gonna have a look at Industry but I think it'll be the same.

 

You don't need to have an override line name if you're just adding a module. The reason why people add _Override at the end is simply to give a module a new name. It might as well be named banana123. It's used with the ReplaceModule because existing modules can't be edited in map.ini, ReplaceModule basically does DeleteModule 123Original, then AddModule 123Edited. Since it's already there you can remove the whole "ModuleTag_DwarvenRiches_Override" line, leaving just AddModule left. Try and see if anything changes. 

 

Spoiler

 

It shouldn't though, as the game would simply just read the same effect but with a new name. Very odd. Will have to think about that one if nobody else knows the cause.


Edited by Jokuc, 27 May 2017 - 10:27 PM.


#5 Zakabuzz

Zakabuzz
  • Members
  • 5 posts

Posted 28 May 2017 - 12:55 PM

Didn't change anything unfortunately. I tried it on an other map (One of yours actually, Chetwood Hills, very nice!) to see if it was not some sort of weird conflict between the map scripts and the .ini but I was wrong once more. What can I be missing for that specific power? :/
I'm gonna list here everything that is related to that specific science in the file, if anything pops in your mind you tell me :)

Spoiler


Spoiler


Spoiler


And that's all for Dwarven Riches. The prerequesite are kind of a mess cause I simply added what I needed in the list (and only modified the powers I needed for the Elves), it works perfectly fine on that front. I made the spellbook following what SupremeGeorge did on one of his maps by the way, thanks to him, should he ever see this topic! ;)

The full map.ini, should it be needed :
Spoiler


Edited by Zakabuzz, 28 May 2017 - 12:56 PM.


#6 Jokuc

Jokuc

    Hardcore Procrastinator

  • Members
  • 187 posts
  • Location:Sweden
  •  Mapper

Posted 28 May 2017 - 07:25 PM   Best Answer

I tried it on an other map (One of yours actually, Chetwood Hills, very nice!)

 
Oh god no, not one of those 8 year old maps with cringeworthy grammatically flawed descriptions... Wait, people are actually playing it? I'm amazed! Gotta make some improvements to that one for the map pack I'm working on...
 
 
 
Anyway, I fixed your problem. Wanted to try it out for myself and see if it was just a mistake on your end, but I ended up spending hours trying to figure out why it was not working. If you answered (or maybe you didn't understand it?) my question about the bonus effect draw I probably would've been able to figure out a solution faster :p
 
"Also, you say you see the effect, do you see the effect of the special power only or does the power successfully trigger the bonus effect draw in elvenmallorntree.ini (the constant glow around the building)?"
 
If you had the constant glow, that would mean that the AttributeModifier was applied correctly, since the draw module is triggered by the modifier. Since you said you saw the fx, I thought the issue had something to do with the building's resource system. When I tried your code however, the power indeed showed the 3 second animation with the glow, but the glow which should stay around the building for a couple of minutes did not appear.. Meaning that the modifier didn't get applied, even though your code was correct. It's a bug in map.ini that probably occurs because certain filters are hardcoded, but there's some ways around it.

 

Replace the DwarvenRiches module in your ElvenSpellbook_Override object with this:

AddModule
	Behavior = SpecialPowerModule ModuleTag_DwarvenRiches
		SpecialPowerTemplate = SpellBookDwarvenRiches
		AttributeModifier = SpellBookDwarvenRiches
		AttributeModifierRange = DWARVENRICHES_EFFECT_RADIUS
		AttributeModifierAffects = INDUSTRY_TYPE_SPELL_OBJECT_FILTER +AIRCRAFT
		TriggerFX = FX_DwarvenRiches
		UpdateModuleStartsAttack = No
		AvailableAtStart = No
		RequirementsFilterMPSkirmish = SPELL_BOOK_REQUIREMENTS_FILTER
		RequirementsFilterStrategic = SPELL_BOOK_REQUIREMENTS_FILTER_STRATEGIC
	End
End

Then add this to the bottom:

Object ElvenMallornTree
	KindOf = +AIRCRAFT
End

You'll have to add KindOf = +AIRCRAFT to all the farms if you want it to work on other buildings than just the Mallorn Tree. 

 

Don't forget to mark the thread as answered if you're happy with the solution :)


Edited by Jokuc, 28 May 2017 - 07:57 PM.


#7 Zakabuzz

Zakabuzz
  • Members
  • 5 posts

Posted 28 May 2017 - 10:50 PM

The description's fine, and the terrain is more worked than a whole lot of maps I've seen so nothing to be ashamed of, quite the contrary actually, it's pretty good! I'll look for your map pack for sure ;)

--

That is really clever. I've spent countless hours trying to figure out what was happening and I would have probably never thought of adding a filter, given the fact that I hadn't modified anything else and thinking the code was right. I'm truly sorry I kinda missed your question. I thought I answered it but clearly I didn't, apologies for the misunderstanding that followed. Great job finding the weakness in my code and thank you very much! I'm really happy with the solution, of course, as I will not end up insane because of this small malfunction! Thanks again, Jokuc, you saved the (my) day! \o/






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users