Stupid Questions (see last post)
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.
Re: Stupid Questions (see last post)
No. Those are used for unit_type.
Re: Stupid Questions (see last post)
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?
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! <<<
>>> MY LITTLE LAB! <<<
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Stupid Questions (see last post)
If you meant for every unit type, then yes. You are changing the types after all.
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
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: Stupid Questions (see last post)
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]?
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! <<<
>>> MY LITTLE LAB! <<<
Re: Stupid Questions (see last post)
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?
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! <<<
>>> MY LITTLE LAB! <<<
Re: Stupid Questions (see last post)
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. (edit: CelMin says {UNMAKE_HERO} will do this.)
To undo its effect I think you simply need to set those two keys to the empty string. (edit: CelMin says {UNMAKE_HERO} will do this.)
Re: Stupid Questions (see last post)
Very Important Question(s):
1) Can a campaign (I mean the _main.cgf file) have both a [campaign]block and a [modification] block?
I'm asking because my modifications aren't triggering - and I have the code outside and inside the [modification] block.
2) Also, can I add AMLAs to an unit in an event? Last time I tried they all gt instantly applied instead of added as options on levelup
3) Why is the game ignoring my units in favor of core ones? Shouldn't an active add-on/campaign override? For a simple test I had a Elvish Lady unit with an attack. In game she's doesn't have any.
1) Can a campaign (I mean the _main.cgf file) have both a [campaign]block and a [modification] block?
I'm asking because my modifications aren't triggering - and I have the code outside and inside the [modification] block.
2) Also, can I add AMLAs to an unit in an event? Last time I tried they all gt instantly applied instead of added as options on levelup
3) Why is the game ignoring my units in favor of core ones? Shouldn't an active add-on/campaign override? For a simple test I had a Elvish Lady unit with an attack. In game she's doesn't have any.
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
Re: Stupid Questions (see last post)
1) Yes. But it might not do what you expect it to do.
3) Unit types cannot be changed after they have been created. Either define new unit type or add attack during game.
3) Unit types cannot be changed after they have been created. Either define new unit type or add attack during game.
Re: Stupid Questions (see last post)
Explain
I didn't add the unit half-way trough. I started a new campaign after purging the cache, the campaign is still using core units.3) Unit types cannot be changed after they have been created. Either define new unit type or add attack during game.
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Stupid Questions (see last post)
It sounds like you haven't realized that each tag has a very specific list of tags and keys that it can contain, and it can't contain anything else. Maybe you should just post your _main.cfg.
Core units are loaded first, then your campaign units are added when you start the campaign. It sounds like you used the same type ID's as the core units. Ravana is saying that your units will be ignored because units with those ID's already exist. You need to use different ID's on your units.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: Stupid Questions (see last post)
1) When you put [modification] and [campaign] as top level tags to _main.cfg, it is almost as if they were separate addons, they do not affect each other.
Re: Stupid Questions (see last post)
So what you're saying that I NEED new ID's and a copy of every single unit I want to tweak?beetlenaut wrote: ↑March 21st, 2019, 11:41 pm Core units are loaded first, then your campaign units are added when you start the campaign. It sounds like you used the same type ID's as the core units. Ravana is saying that your units will be ignored because units with those ID's already exist. You need to use different ID's on your units.
There is no way to tell the game to take my files over the core ones (for this campaign only)?
That seems incredibly impractical and requires re-writing every single scenario, changing every unit placed on maps and all recruitment lists. Compared to many other games I modded, this feels backwards.
I guess I could do it as a modification that alters units on recruitment/recall/placement/levelup, but that's a whole lot of WML code that just slows everything needlesly.
So in other words, campaign will be loaded, but modification will be ignored/not loaded?Ravana wrote: 1) When you put [modification] and [campaign] as top level tags to _main.cfg, it is almost as if they were separate addons, they do not affect each other.
Would it work if I moved the code/events inside the campaign tags?
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
Re: Stupid Questions (see last post)
You need to understand how the system works. When wesnoth starts it parses a certain set of WML files with certain macros predefined. Whenever wesnoth sees a [campaign] or [modification] tag at the top level it parses a campaign or a modification and makes them available in the respective dialogs. So, yes, if you put a [modification] tag after the [campaign] tag, the mod would be parsed, but it would be independent of the campaign, just like it would be if they'd been defined in different files.TrashMan wrote: ↑March 22nd, 2019, 9:55 amSo in other words, campaign will be loaded, but modification will be ignored/not loaded?Ravana wrote: 1) When you put [modification] and [campaign] as top level tags to _main.cfg, it is almost as if they were separate addons, they do not affect each other.
Partly. You can see on https://wiki.wesnoth.org/CampaignWML and https://wiki.wesnoth.org/ModificationWML that not all tags recognized under [modification] are also recognized under [campaign]: for example, [event] tags do but [lua] tags do not.
Re: Stupid Questions (see last post)
This is wrong, the wiki is probably just missing iformation here. The code that adds the [campaign] content to each [scenario] is exactly the same that handles [modification], see https://github.com/wesnoth/wesnoth/blob ... e.cpp#L366josteph wrote: ↑March 22nd, 2019, 11:48 am Partly. You can see on https://wiki.wesnoth.org/CampaignWML and https://wiki.wesnoth.org/ModificationWML that not all tags recognized under [modification] are also recognized under [campaign]: for example, [event] tags do but [lua] tags do not.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: Stupid Questions (see last post)
All the code is just on recruitment/recall/placement events anyway that adds abilities or attacks to units.josteph wrote: ↑March 22nd, 2019, 11:48 amPartly. You can see on https://wiki.wesnoth.org/CampaignWML and https://wiki.wesnoth.org/ModificationWML that not all tags recognized under [modification] are also recognized under [campaign]: for example, [event] tags do but [lua] tags do not.
So basically, if I just put all the code at the bottom, just before [/campaign], it should work?
Off, because I started a new campaign after clearing cache and it didn't work.
And just to re-cap - for every CORE unit I want to tweak in my campaign, I basically have to make completely new units with new ID's, OR trough WML to modify units at runtime?
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<