Stupid Questions (see last post)

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.
User avatar
Ravana
Moderator
Posts: 1998
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Stupid Questions (see last post)

Post by Ravana » March 14th, 2019, 3:56 pm

No. Those are used for unit_type.

User avatar
TrashMan
Posts: 552
Joined: April 30th, 2008, 8:04 pm
Contact:

Re: Stupid Questions (see last post)

Post by TrashMan » March 15th, 2019, 9:05 am

I'm not sure I follow.

Basically I want for my campaign to have a bit finer control over how many traits a race has and what traits are available.

So for example - only humans and orcs can get the brawler trait, elves get 3 traits and only they can get reflexes.


Another problem is trait limited to specific types of units- let's say a trait only mage types should get. Is there a way to do it without overriding every stock mage unit?
Light travels much faster than sound, that's why some people seem bright until you hear them speak.

>>> MY LITTLE LAB! <<<

User avatar
beetlenaut
Developer
Posts: 2296
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Stupid Questions (see last post)

Post by beetlenaut » March 15th, 2019, 10:38 am

TrashMan wrote:
March 14th, 2019, 10:09 am
Would that require setting for every unit individually?
If you meant for every unit type, then yes. You are changing the types after all.
TrashMan wrote:
March 15th, 2019, 9:05 am
Is there a way to do it without overriding every stock mage unit?
You could write a macro with a recruit event and put it in all your scenarios. The event would remove all the traits of each new unit of a type that you want to control, then pick some random numbers and add traits based on the numbers. It would use [if] statements or a [switch] statement to see what unit type you are dealing with and act accordingly. You'd be rewriting the trait generation code basically. That's probably the way I would do it.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide

User avatar
TrashMan
Posts: 552
Joined: April 30th, 2008, 8:04 pm
Contact:

Re: Stupid Questions (see last post)

Post by TrashMan » March 18th, 2019, 11:57 am

I think I'll just overwrite the units...

One more question:
Can my main file have both a [campaign] and a [modification] tag? Can I put the code that would normally go into the [modification] and put it under [campaign]?
Light travels much faster than sound, that's why some people seem bright until you hear them speak.

>>> MY LITTLE LAB! <<<

User avatar
TrashMan
Posts: 552
Joined: April 30th, 2008, 8:04 pm
Contact:

Re: Stupid Questions (see last post)

Post by TrashMan » March 19th, 2019, 9:53 am

More stupid questions. I used {IS_HERO} on my main characters, which is no longer necessary and messes up the elipses.

Now, it's an easy fix for a New Game, but how do I fix it in a running game?
Would a simply modify_unit with a new elipse path work? If so, what exactly is the new path? Where is the new elipse graphics?
Light travels much faster than sound, that's why some people seem bright until you hear them speak.

>>> MY LITTLE LAB! <<<

User avatar
josteph
Developer
Posts: 330
Joined: August 19th, 2017, 6:58 pm

Re: Stupid Questions (see last post)

Post by josteph » Yesterday, 2:45 pm

IS_HERO is defined here: https://github.com/wesnoth/wesnoth/blob ... fg#L18-L22

To undo its effect I think you simply need to set those two keys to the empty string.
Fund my work on wesnoth, including but not limited to my add-ons: Invisible Enemies | Random Recruits

Post Reply