Events Such as Unit Recruitment - Middle Ages v0.35

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.
KingJohnVI
Posts: 30
Joined: July 18th, 2011, 2:02 am

Re: Creating Events Such as Unit Recruitment - Middle Ages v

Post by KingJohnVI »

Attached above. And thanks again for everyone's help. Feel free to let me know what you think of the era so far, but keep in mind it is still VERY early in development, with just the one faction so far.
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: Creating Events Such as Unit Recruitment - Middle Ages v

Post by Crendgrim »

There is no image with name units/MA_Woodsman.png.


Crend
UMC Story Images — Story images for your campaign!
KingJohnVI
Posts: 30
Joined: July 18th, 2011, 2:02 am

Re: Creating Events Such as Unit Recruitment-MiddleAgesv0.34

Post by KingJohnVI »

Ahhh, I see the location path had to be completed. What was:

Code: Select all

message={MENU_IMG_TXT "MA_Axeman.png~RC(magenta>$recruiter.colour)" ("Axeman - 9 Gold")}
Should have been:

Code: Select all

message={MENU_IMG_TXT "units/MA_Axeman.png~RC(magenta>$recruiter.colour)" ("Axeman - 9 Gold")}
with the units/.

and what was:

Code: Select all

message={MENU_IMG_TXT "woodsman.png~RC(magenta>$recruiter.colour)" ("Woodsman - 10 Gold")}
should have been:

Code: Select all

message={MENU_IMG_TXT "units/human-peasants/woodsman.png~RC(magenta>$recruiter.colour)" ("Woodsman - 10 Gold")}
becuase it is located in the core directory.

Thanks again.
blueknight1758
Posts: 252
Joined: March 30th, 2011, 8:38 pm
Location: The UK

Re: Creating Events Such as Unit Recruitment - Middle Ages v

Post by blueknight1758 »

Soo does it work now? If so great for you!
KingJohnVI
Posts: 30
Joined: July 18th, 2011, 2:02 am

Re: Events Such as Unit Recruitment - Middle Ages v0.34

Post by KingJohnVI »

blueknight1758 wrote:Soo does it work now? If so great for you!
Yes it does! I will post an updated version on the add-on server soon. I am also now working on mercenaries, balancing, and other maps, and eventually I'll have another faction too! :D
Last edited by KingJohnVI on September 29th, 2011, 6:45 pm, edited 1 time in total.
KingJohnVI
Posts: 30
Joined: July 18th, 2011, 2:02 am

Re: Events Such as Unit Recruitment - Middle Ages v0.35

Post by KingJohnVI »

The era has been updated to version .35 and added to the server! I also slightly buffed the level 0 units becuase they were too weak and expensive, especially considering they have upkeep.
KingJohnVI
Posts: 30
Joined: July 18th, 2011, 2:02 am

Re: Events Such as Unit Recruitment - Middle Ages v0.35

Post by KingJohnVI »

Within a unit, I would like to have an attack effective only on attack, that is, I do not want the unit to use it for a counter-attack. Currently, I am using:

Code: Select all

    [attack]
        name=ram
        description=_"ram"
        icon=attacks/warblade-red.png
        type=impact
        range=melee
        damage=35
        number=1
        [specials]
	active_on=offense
        [/specials]
    [attack]
but it doesn't seem to be working. Does anyone have any idea why this isn't working, and how it should be done?

Also, I would like to make the attack only effective against certain unit types, for example, only damage mechanical. Is there any way to do that?
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: Events Such as Unit Recruitment - Middle Ages v0.35

Post by Sapient »

You have a [specials] block, but you did not put any correct contents inside it.
The [specials] tag goes inside the [attack] tag. It can contain the following tags:
[damage]: modifies the damage of a weapon
[attacks]: modifies the number of attacks of a weapon
...
http://wiki.wesnoth.org/AbilitiesWML

I think you can achieve the desired results by modifying the number of attacks to 0 on defense and increasing damage when attacking race=mechanical opponents.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
KingJohnVI
Posts: 30
Joined: July 18th, 2011, 2:02 am

Re: Events Such as Unit Recruitment - Middle Ages v0.35

Post by KingJohnVI »

Sapient wrote:You have a [specials] block, but you did not put any correct contents inside it.
The [specials] tag goes inside the [attack] tag. It can contain the following tags:
[damage]: modifies the damage of a weapon
[attacks]: modifies the number of attacks of a weapon
...
http://wiki.wesnoth.org/AbilitiesWML

I think you can achieve the desired results by modifying the number of attacks to 0 on defense and increasing damage when attacking race=mechanical opponents.
Ok thanks, unfortunatly I am still having trouble. What I think I want to do is the following: If enemy unit type != MA_Ship Then Chance to hit modified by 0. If enemy unit type = MA_Ship AND IFthis unit is attacking then chace to hit = 0. The WML is confusing me at the moment, and doesn't seem to work no matter what code I put in...

So a specials tag goes inside the attack tag, and the chance to hit tag goes inside the specials tag. So I came up with what I thought was something close but it doesn't work:

Code: Select all

#define WEAPON_SPECIAL_ATTACK_SHIPS_ONLY_OFFENSE
	[chance_to_hit]
		id=attack_ships_only_offense
		name= _ "attack only, ships only"
		description= _ "Attack only:
This weapon is not available on defence, and can only hit ships.  CURRENTLY NOT WORKING"
		value=0
		cumulative=no
		apply_to=self
		[filter_defender]
			type=MA_Ship
		[/filter_defender]
		active_on=offense
		value=40
		cumulative=no
	[/chance_to_hit]
#enddef
Where have I gone wrong? Also, can I use "If" statements inside of the special definitions?
Post Reply