ChaosRider’s WML questions

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: ChaosRider’s WML questions

Post by Dugi »

You're writing about a non-existent problem.
1. If an event has an id, it will never be duplicated.
2. An era's events are loaded into all scenarios using that era, not only the first one.
3. No matter how much are you going to expand world conquest, it can always be done without an era. Just place all the events you need next to the generic world conquest events (ideally next to the turn refresh,prerecruit,prerecall,post advance event). Any extra units you want to use have to be loaded, but they don't need to be a part of an era.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: ChaosRider’s WML questions

Post by ChaosRider »

Spoiler:
In this code you got events for leadership abilities of plauge,magical,marksman... ...magical(and many other, they are not much important for this moment), but also for fury ability (which is giving 2 mp back and let unit to attack again enemy unit, ofcourse after killing one of enemy units). This ability in first scenario where im using era which start this code higher posted and scenario also do this gave unit after killing enemy unit 4 mp back and 2 able attacks, i think problem is exist (in next scenarios of this campaign abilities works well, so i think this isnt loaded by a game:
Spoiler:
)
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: ChaosRider’s WML questions

Post by Dugi »

[taking a spiked mace and dashing towards Poland with murder in eyes] I have just written that events with an id don't get duplicated, and only ONE event in that chunk of code has an id assigned. It is not surprising at all that it will appear that all of them got duplicated!
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: ChaosRider’s WML questions

Post by ChaosRider »

Ok :D, btw how can i force ai to recruit in each turn as many units as he can, to dont let him save gold?
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: ChaosRider’s WML questions

Post by Dugi »

I am probably not the best person to reply to this question, but I doubt that somebody else is still willing to help you.
I think that the AI always recruits everything it can, never saving money for new turns. I am not quite sure, but I think that if it doesn't have enough gold for level 2 units, but has enough gold for level 1 units, it will still recruit something it can afford (if it is not like this, you can always remove the level 2 units from its recruit list when its gold drops so that it cannot afford level 2 units).
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: ChaosRider’s WML questions

Post by ChaosRider »

Cyricist wrote:So I just read through a significant portion of this thread, in the hopes of finding an answer to the problem I'm experiencing when trying to play ChaosRider's Modified World Conquest add-on. Alas, I did not find an answer, but I was pretty thoroughly amused by Dugi's interactions with our dear ChaosRider. Dugi, you are a very patient man.

That all said, I'm going to link to my question in the Technical Support forum, in the hopes that the actual modmaker may see it here. http://forums.wesnoth.org/viewtopic.php ... 28#p558328

So, ChaosRider (or anybody else)... what's going on here? I really like the add-on. World Conquest is cool, but MWC really ramps it up a notch. Just not sure what the problem is. I mean, I can clearly see that there's a problem, but I have no experiencing with any coding language, so I'm a bit out of my depth here. Thanks.



MWC v0.4.8.2 wont have that long advancing to next scenario cause this bug will be fixed, now i can say where was the bug, it wasnt in victory event, but thx this bug victory events didnt work well. First we need to learn to look from numbers to words and from words to numbers, there were we set leaders and recruit lists, also we got units which can be found in bonus places, added to our recruit list, or spawned as hero at scenario start, but in wc in each faction there is 8 such a recruits, question is why ? Cause someone who made wc wish to works it for 8 units in each faction in tags [recruit][/recruit]:
Spoiler:
here we had them more, but we dont have to know everything, most important is that number "8", in my scenario most recruits got loyalists ("17"), i've changed 8 for 17 and now it works...
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: ChaosRider’s WML questions

Post by ChaosRider »

New question about ability "warp" which is let unit with this ability and each adjected to this one (which is not enemy) teleport between two villages (all on map - which is a bit too op). I wish to change it, make it works as a normal teleport, teleport units between two villages but between villages from side of unit which is teleported.
Spoiler:
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: ChaosRider’s WML questions

Post by ChaosRider »

Warp question is still not fixed :D but i have also other one, im trying to do event code for ability which will give some bonuses for adjected units, picked by random values.

Below you got image to understand better my idea :D (im using here switches)
tree.png
Points on image:

0 - its a first switch, in game it will be 1/3 or even smaller like a 1/6, but now i have here 100% to go on (cause we are checking is it works)

1 - here we start our picking bonus for adjected unit to this one with this ability (bonuses: hp/resistances/movements/strikes/damage/new weapon)

2 - its for hp (5 avaible options, from 1 hp more to 5 hp more (which have lowest chance)

3 - here we got resistances, first 5 lines below this of the left are bonuses for one resistance dmg (thats why they have also next 6 avaible lines/options), from next for are res bonuses to imp/pie/bla (+1/+1/+1, +2/+2/+2) or col/fir/arc (+1/+1/+1, +2/+2/+2)

4 - here we got movement bonus (+1/+2)

5 - unit strike increased melee/ranged thats why 2 avaible options

6 - unit damage bonus, +1/+2 for melee/ranged thats why 4 options

7 - here we have picking new weapons for our adjected units (4 avaible diffrent dmg/number weapons (4-6/6-4/8-3/12-2) and each with diffrent range (melee/ranged) and dmg type (blade/impact/pierce/arcane/cold/fire).

As for me something is wrong with first filter when i want to store units, or with last filters where I filter unit which will get some bonus.

Ability code:
Spoiler:
And here is my event code (yeah i know quite big - its too big to paste it here, so i have to upload it :D):
event.cfg
(88.08 KiB) Downloaded 125 times
When i changed in [store_unit][/store_unit] "kill=no" for "kill=yes" they shouldnt be killed? After this change they are still alive (this adjected units).
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: ChaosRider’s WML questions

Post by Dugi »

I think that a unit that constantly adds new abilities to nearby units is overpowered, but if balanced properly, it might be quite interesting to play with.

I have noticed that your WML looks much better than before, with all the indenting, readable variable names and such.

I think that the problem is that you are unstoring the units after giving them [object]s. The units are stored, and then each of them is modified (the one in the scenario, not the one that is stored), and then the unmodified one is unstored (replacing the one that was given the object, thus undoing the change). I don't know if it's the only error, but it certainly causes the objects to have no effect.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: ChaosRider’s WML questions

Post by ChaosRider »

Ok i cut biggest part and try with small, and no effect :P.
Spoiler:
If small part will works then bigger should also works.

edit 1: Found bug - unstore is problem, i changed it for clear variable after next i (i dont clear each part of this variable, but when its not needed i clear full variable, and now works - atleast this smaller part).

edit 2: Here is uploaded working event code (about interesting abilities, when you have 168 items you have to search and think hard to create another one :D)
Spoiler:
Fixed event:
event 2.cfg
(88.03 KiB) Downloaded 114 times
Last edited by ChaosRider on November 18th, 2013, 11:36 am, edited 1 time in total.
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: ChaosRider’s WML questions

Post by Dugi »

Wait, haven't I told you in the previous post that the unstore_unit is the problem and should be removed? Well, anyway, you're learning to fix your errors and that's good.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: ChaosRider’s WML questions

Post by ChaosRider »

Here are chances for each bonus of this new ability, with first switch set for 1/10:
Spoiler:
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: ChaosRider’s WML questions

Post by ChaosRider »

How to change unit side by wml :D ? Without making oos in multiplayer game, cause i want make ability which will steal enemy units and make them join to your side if they will be close your unit at turn start (i will check this units by units id, it will works for 0 lvls as goblins, young orcs, and unit able to join them to own side will be 4 lvl orcish emperor).
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
iceiceice
Posts: 1056
Joined: August 23rd, 2013, 2:10 am

Re: ChaosRider’s WML questions

Post by iceiceice »

You can use [modify_unit] in a straightforward manner for this. For example, to change unit at $X, $Y to side $new_side, use

Code: Select all

[modify_unit]
    [filter]
        x = $X
        y = $Y
    [/filter]
    side = $new_side
[/modify_unit]
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: ChaosRider’s WML questions

Post by ChaosRider »

I tried my self but this dont work xD... im sure i made somewhere some mistakes :P...
Spoiler:
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
Post Reply