PresetAdvancement Default Era

It's not easy creating an entire faction or era. Post your work and collaborate in this forum.

Moderator: Forum Moderators

tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

PresetAdvancement Default Era

Post by tsr »

Hi, this is a concept era to show how I imagine that we could get around the problem of units advancing when it's not your turn and they randomly advance to the worst option ;)

The era is already uploaded to the add-ons server for wesnoth 1.7.0.

I think it could be made prettier (but I can't seem to manage to toss variables and units around between lua and wml efficiently enough) with images of the options each unit has. If someone wants to dive into that, I have an idea on how to come close ;)

/tsr

ps. for past discussions about this see the last post by Turuk in http://www.wesnoth.org/forum/viewtopic.php?f=15&t=26019
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: PresetAdvancement Default Era

Post by zookeeper »

I was thinking about exactly an era like this after seeing that latest thread, glad to see someone actually made one.
tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

Re: PresetAdvancement Default Era

Post by tsr »

Well. let's just say that your LessLuck mod was a useful skeleton. Without it I doubt I'd even try ;)

/tsr
Blarumyrran
Art Contributor
Posts: 1700
Joined: December 7th, 2006, 8:08 pm

Re: PresetAdvancement Default Era

Post by Blarumyrran »

Its broken.

First i set a shaman to level to druid; enemy attacks the shaman & gets killed, shaman does level to druid. But druid has only shamans advancement options (image 1)

I set my new _druid_(lvl2) to level to _sorceress_(lvl2), which does happen. The twice-advanced sorceress also has only shamans advancement options (image 2)

Bugs aside, the whole thing looks hackish, & frankly i dont see how could it be nonhackishlooking even if it was supported by code itself.
User avatar
A Guy
Posts: 793
Joined: May 24th, 2008, 1:55 am

Re: PresetAdvancement Default Era

Post by A Guy »

I can implement an era that will make units advance only on their turn.
I'm just... a guy...
I'm back for now, I might get started on some work again.
User avatar
PsychoticKittens
Posts: 573
Joined: May 29th, 2006, 8:49 pm

Re: PresetAdvancement Default Era

Post by PsychoticKittens »

then you could kill a unit that just advanced, before it advances (i.e. a unit has low hp and 1xp needed, and it levels the first attack, but you force it not to level so it stays the same and dies, losing you that unit.)
Creator of: Mercenaries Era; Modern Combat
Future Projects: Faunima: Land of Monsters
Temporarily Dropped Projects: Zombie Horde
User avatar
melinath
Posts: 1298
Joined: May 20th, 2009, 7:42 am

Re: PresetAdvancement Default Era

Post by melinath »

I've never even noticed the feature, but the idea intrigued me, so I made a version for 1.6. It's on the add-on server.
screenshot.jpg
EDIT:: Oddly, I can't seem to activate the feature. When I start a local game + level an opponent's unit, the dialog box comes up asking what branch to take. Oh, well. It was fun to code anyway.
tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

Re: PresetAdvancement Default Era

Post by tsr »

Ok, there is a new version up on the 1.7.1 server that is not broken and is a bit prettier. This version seems to work on 1.6 (there is a small glitch: so that if you don't preset you advancement option you must make your choice twice ;)) - but I'll let melinath handle that upload.

A special thanks to Syntax_Error that found the 'I-didn't-get-a-clean-start-after-advancing-into-a-single-path-unit'-bug

Thanks to melinath, that showed me (by exammple) the set_variables-split trick (bye, bye Lua: hope to see you soon), I've set you up as co-author on this version as I've used a lot of code from your 1.6-version.

/tsr
User avatar
melinath
Posts: 1298
Joined: May 20th, 2009, 7:42 am

Re: PresetAdvancement Default Era

Post by melinath »

tsr wrote:Ok, there is a new version up on the 1.7.1 server that is not broken and is a bit prettier. This version seems to work on 1.6 (there is a small glitch: so that if you don't preset you advancement option you must make your choice twice ;)) - but I'll let melinath handle that upload.

A special thanks to Syntax_Error that found the 'I-didn't-get-a-clean-start-after-advancing-into-a-single-path-unit'-bug

Thanks to melinath, that showed me (by exammple) the set_variables-split trick (bye, bye Lua: hope to see you soon), I've set you up as co-author on this version as I've used a lot of code from your 1.6-version.

/tsr
My pleasure. Out of curiosity, is the glitch you mentioned also present in my version? If so, could you explain what it is? I don't quite understand the problem, so I wouldn't know how to fix it.
tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

Re: PresetAdvancement Default Era

Post by tsr »

Hi melinath, no the glitch is not present in your version. I think the reason it's present in my version is that I rely on an advance event to clean things up (so that the menu is only there if your unit has multiple paths to advance into) while your version just shows one or no options if it hasn't many. I'll try one more thing to see if I can get rid of the 'advance' event otherwise I think I'll just leave it as is: since I think my version is prettier :)

[edit]
Ok, now I've tried the last ting I could think of and it worked :D

So new fresh version n the 1.7 server for you to download and upload on the 1.6 server (if you want to have 'no-action'-image I suggest finding a nicer one, and also if you want to maintain the 1.6 version feel free to get mantainership over the 1.7 as well - since it feels pretty dumd that we both try and maintain one single add-on ;))
[/edit]

/tsr
User avatar
melinath
Posts: 1298
Joined: May 20th, 2009, 7:42 am

Re: PresetAdvancement Default Era

Post by melinath »

@tsr:
I think we have some aesthetic differences. :-) I don't mind giving the player the option of setting the path even if there's just one path to set. I like the simplicity of the code.
On the graphical level - I actually really like the cancel image I've got... I don't know why you think it's not nice. I would hazard a guess that it's bothering you because it doesn't match the rest of the images. Personally, I'd tend more toward adjusting the die to also be on an attack bg. But I don't really care. I would suggest a nicer image for the menu, though. ;-) I really loathe the amla_tough image + like the star a lot better. Again, aesthetic differences.
I don't want to maintain the 1.7 version. I don't have as much of an attachment to it. I would maintain the 1.6 version I've made, but if you'd rather have the same add-on both places, I can take mine down.
tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

Re: PresetAdvancement Default Era

Post by tsr »

@melinath: well, I think it's easier if there is only one version that works the same, and since it now does - with your help - I think it's better if one of us maintains both the 1.6 and the 1.7 version (with the other as co-author ofc).

I've uploaded a new version: no amla-tough-heart and 2 new tc-d icons for cancel and random, check them out ;)

@rest: so? So far only Syntax_Error has expressed aby opinions on the system, anyone else care to join in?

/tsr
User avatar
melinath
Posts: 1298
Joined: May 20th, 2009, 7:42 am

Re: PresetAdvancement Default Era

Post by melinath »

You have won me with your superior team-coloring. :shock: And the multipather thing really is cleverly done, so...
I've uploaded this version to 1.6 and will PM you the password. I changed a couple minor things:
-In the binary path, changed add-ons to campaigns. I guess 1.7 uses a different directory tree.
-In the menu, changed "Preset units advancement" to "Preset Advancement". The other option was "Preset unit's advancement", but I find that less appealing.
User avatar
Nobun
Code Contributor
Posts: 129
Joined: May 4th, 2009, 9:28 pm
Location: Italy

Re: PresetAdvancement Default Era

Post by Nobun »

I've made a test (I downloaded yesterday the era from addons on 1.6).
I discovered a bug:

EDIT: I discovered better the bug.
If a unit advance to level_x with PresetAdvancement options then bug.

Example1: I have a mage, I click PresetAdvancemenent and I choose Red Mage. Mage is upgraded to Red Mage as I decided. But then the PresetAdvancement menu will let you to choose again from White Mage and Red Mage (so lv2 red mage can be upgraded to lv2 White mage)

Example2: I have a horseman and I choose Knight on PresetAdvancement. Then the presetAdvancement menu will let you to upgrade lv2 Knight to lv2 Knight or lv2 lancer.

----

If instead you advanced a lv2 unit normally (you didn't choose anything in PresetAdvancement) than NO bug.

Example: I have a mage and I upgrade it in my own turn and I never used PresetAdvancement in that unit. So I can choose the Advance like normal from menu and I choose Red Mage.
In this case, unlike before, I can correctly choose from Silver Mage and Red mage lv3 (I never remember the right name :P)

I hope this report can help you to isolate the bug and fix it
tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

Re: PresetAdvancement Default Era

Post by tsr »

Hi, thanks for your report. A new version has been uploaded to the 1.6 server that fixes the bug (I forgot to clear a variable).

/tsr

ps. I will upload this change to the 1.7 server too, but that might have more bugs since wml is known to change from time to time...
Locked