Random Recruit mod
Moderator: Forum Moderators
- Atreides
- Posts: 1090
- Joined: March 30th, 2019, 10:38 pm
- Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off
Random Recruit mod
Well I can't seem to find an extant thread so I'll start one just so I can rave: This is more fun than a box full of kittens! ^-^
P.S. Found a little problem with it.
Seems that for no reason I can think of it is limited to level 1 recruits only. Even default has L0 recruits and of course many addons have L2 recruits. I have not tried it with Age of Heroes but I suppose that would have the same recruits as default.
The thing is written 100% in lua but fortunately I was able to edit it anyways to simply remove the limit and when tested it works fine giving me L0 and L2 recruits also.
Here is my fix for anyone who wants it:
I merely commented out the and unit_type.level == 1 which was simple enough since how to comment out things is the first bit of lua I've learned. : )
Oh yeah this is in the main.lua file.
P.S. Found a little problem with it.
Seems that for no reason I can think of it is limited to level 1 recruits only. Even default has L0 recruits and of course many addons have L2 recruits. I have not tried it with Age of Heroes but I suppose that would have the same recruits as default.
The thing is written 100% in lua but fortunately I was able to edit it anyways to simply remove the limit and when tested it works fine giving me L0 and L2 recruits also.
Here is my fix for anyone who wants it:
Code: Select all
local function init_era()
if wesnoth.scenario.era then
for multiplayer_side in helper.child_range(wesnoth.scenario.era, "multiplayer_side") do
local units = multiplayer_side.recruit or multiplayer_side.leader or ""
for _, unit in ipairs(split_comma(units)) do
local unit_type = wesnoth.unit_types[unit]
if era_set[unit] == nil and unit_type
-- and unit_type.level == 1
then
era_set[unit] = true
era_array[#era_array + 1] = unit
end
end
end
era_set = nil -- free up memory
else
era_array = {
"Cavalryman", "Horseman", "Spearman", "Fencer", "Heavy Infantryman", "Bowman", "Mage",
"Merman Fighter", "Elvish Fighter", "Elvish Archer", "Elvish Shaman", "Elvish Scout", "Wose",
"Merman Hunter", "Orcish Grunt", "Troll Whelp", "Wolf Rider", "Orcish Archer",
"Orcish Assassin", "Naga Fighter", "Skeleton", "Skeleton Archer", "Ghost", "Dark Adept",
"Ghoul", "Dwarvish Guardsman", "Dwarvish Fighter", "Dwarvish Ulfserker", "Dwarvish Thunderer",
"Thief", "Poacher", "Footpad", "Gryphon Rider", "Drake Burner", "Drake Clasher",
"Drake Glider", "Drake Fighter", "Saurian Skirmisher", "Saurian Augur"
}
end
end
Oh yeah this is in the main.lua file.
-
- Posts: 67
- Joined: November 17th, 2023, 7:33 pm
deleted dont care about all the problems of this game anymore
deleted dont care about all the problems of this game anymore
Last edited by needmoreplayers on January 9th, 2024, 8:09 pm, edited 2 times in total.
Re: addon?
There is also this forum: viewforum.php?f=8 (most addons have a topic there)needmoreplayers wrote: ↑November 17th, 2023, 11:34 pm how do you contact any of the addon people that makes certain addons? do they have some contact page? addons: viewforum.php?f=31
or is there some central forum site they check often?
-
- Posts: 67
- Joined: November 17th, 2023, 7:33 pm
deleted dont care about all the problems of this game anymore
deleted dont care about all the problems of this game anymore
Last edited by needmoreplayers on January 9th, 2024, 8:09 pm, edited 2 times in total.
-
- Posts: 492
- Joined: August 4th, 2019, 5:27 pm
- Contact:
Re: bug?
There is such a problem when one faulty mod may break the mod selection menu. But afaik this one is not the one. Some Corpse mod (they are several) afaik was one of such faulty mods, there were others as well. The issue was reported to the devs here https://github.com/wesnoth/wesnoth/issues/6780needmoreplayers wrote: ↑November 21st, 2023, 12:28 am - had an era
- had a map
- turned this off
and it kept turning on when in game
no idea what is the cause of it
not sure if it was the map or era, or combination of both or what
if i see that problem again ill edit/update this comment/reply
no idea whos maker or makers of this one
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
Re: Random Recruit mod
Did u manage to add more units from other eras?Atreides wrote: ↑November 5th, 2023, 10:17 pm Well I can't seem to find an extant thread so I'll start one just so I can rave: This is more fun than a box full of kittens! ^-^
P.S. Found a little problem with it.
Seems that for no reason I can think of it is limited to level 1 recruits only. Even default has L0 recruits and of course many addons have L2 recruits. I have not tried it with Age of Heroes but I suppose that would have the same recruits as default.
The thing is written 100% in lua but fortunately I was able to edit it anyways to simply remove the limit and when tested it works fine giving me L0 and L2 recruits also.
Here is my fix for anyone who wants it:
I merely commented out the and unit_type.level == 1 which was simple enough since how to comment out things is the first bit of lua I've learned. : )Code: Select all
local function init_era() if wesnoth.scenario.era then for multiplayer_side in helper.child_range(wesnoth.scenario.era, "multiplayer_side") do local units = multiplayer_side.recruit or multiplayer_side.leader or "" for _, unit in ipairs(split_comma(units)) do local unit_type = wesnoth.unit_types[unit] if era_set[unit] == nil and unit_type -- and unit_type.level == 1 then era_set[unit] = true era_array[#era_array + 1] = unit end end end era_set = nil -- free up memory else era_array = { "Cavalryman", "Horseman", "Spearman", "Fencer", "Heavy Infantryman", "Bowman", "Mage", "Merman Fighter", "Elvish Fighter", "Elvish Archer", "Elvish Shaman", "Elvish Scout", "Wose", "Merman Hunter", "Orcish Grunt", "Troll Whelp", "Wolf Rider", "Orcish Archer", "Orcish Assassin", "Naga Fighter", "Skeleton", "Skeleton Archer", "Ghost", "Dark Adept", "Ghoul", "Dwarvish Guardsman", "Dwarvish Fighter", "Dwarvish Ulfserker", "Dwarvish Thunderer", "Thief", "Poacher", "Footpad", "Gryphon Rider", "Drake Burner", "Drake Clasher", "Drake Glider", "Drake Fighter", "Saurian Skirmisher", "Saurian Augur" } end end
Oh yeah this is in the main.lua file.
Hier könnte Ihre Werbung stehen.
- Atreides
- Posts: 1090
- Joined: March 30th, 2019, 10:38 pm
- Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off
Re: Random Recruit mod
No adding units from other eras is not a problem. The problem was that it didn't let you recruit level 0 units (e.g. walking corpses, golbins and vampire bats from the core) for some reason. It limited selection to only level 1 recruits from whatever era you were playing. The Ageless and Neverending eras both have tons of eras inside them so the selection when playing them is huge.
I have no idea why it was designed that way but I did post a patch that will remove the (unwanted) limit.
Re: Random Recruit mod
Yeah but how did u add units from other eras? That was my Question because i want to add more Units from other eras like Archaic etcAtreides wrote: ↑December 18th, 2023, 7:08 pmNo adding units from other eras is not a problem. The problem was that it didn't let you recruit level 0 units (e.g. walking corpses, golbins and vampire bats from the core) for some reason. It limited selection to only level 1 recruits from whatever era you were playing. The Ageless and Neverending eras both have tons of eras inside them so the selection when playing them is huge.
I have no idea why it was designed that way but I did post a patch that will remove the (unwanted) limit.
Hier könnte Ihre Werbung stehen.
- Atreides
- Posts: 1090
- Joined: March 30th, 2019, 10:38 pm
- Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off
Re: Random Recruit mod
Oh I understand I think. If you want to add units from the excellent Archaic era I can recommend a addon called Custom Campaign. It lets you build your own faction with almost anything you want.Medusa117 wrote: ↑December 19th, 2023, 10:27 amYeah but how did u add units from other eras? That was my Question because i want to add more Units from other eras like Archaic etcAtreides wrote: ↑December 18th, 2023, 7:08 pmNo adding units from other eras is not a problem. The problem was that it didn't let you recruit level 0 units (e.g. walking corpses, golbins and vampire bats from the core) for some reason. It limited selection to only level 1 recruits from whatever era you were playing. The Ageless and Neverending eras both have tons of eras inside them so the selection when playing them is huge.
I have no idea why it was designed that way but I did post a patch that will remove the (unwanted) limit.
Re: Random Recruit mod
Thanks, but that mod only works for mp or local not for an campaign like i want.Atreides wrote: ↑December 19th, 2023, 4:51 pmOh I understand I think. If you want to add units from the excellent Archaic era I can recommend a addon called Custom Campaign. It lets you build your own faction with almost anything you want.Medusa117 wrote: ↑December 19th, 2023, 10:27 amYeah but how did u add units from other eras? That was my Question because i want to add more Units from other eras like Archaic etcAtreides wrote: ↑December 18th, 2023, 7:08 pmNo adding units from other eras is not a problem. The problem was that it didn't let you recruit level 0 units (e.g. walking corpses, golbins and vampire bats from the core) for some reason. It limited selection to only level 1 recruits from whatever era you were playing. The Ageless and Neverending eras both have tons of eras inside them so the selection when playing them is huge.
I have no idea why it was designed that way but I did post a patch that will remove the (unwanted) limit.
I want that with the Random Recruit mod also Units from other Eras are Recruitable. Random Recruits is as i know bound to the Era the Campaign Author has set for the campaign. I want to add more Recruits to the list.
Hier könnte Ihre Werbung stehen.
- Atreides
- Posts: 1090
- Joined: March 30th, 2019, 10:38 pm
- Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off
Re: Random Recruit mod
I believe a campaign loads units the same way as an era does. That means a campaign you devise can refer to any MP era that exists if and only if it contains a [resource] tag (as of 1.16). I just checked and the Archaic era you mentioned does not contain that so there is no way to use that era.
Re: Random Recruit mod
Nad how do i add that resource to a campaign?Atreides wrote: ↑December 19th, 2023, 10:34 pm I believe a campaign loads units the same way as an era does. That means a campaign you devise can refer to any MP era that exists if and only if it contains a [resource] tag (as of 1.16). I just checked and the Archaic era you mentioned does not contain that so there is no way to use that era.
Hier könnte Ihre Werbung stehen.
- Atreides
- Posts: 1090
- Joined: March 30th, 2019, 10:38 pm
- Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off
Re: Random Recruit mod
The answers are all here:
https://wiki.wesnoth.org/AddonsWML
https://wiki.wesnoth.org/AddonsWML