RPG-MP-Scenerio "Wrath of the Son"

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.
Post Reply
User avatar
Luroch_Delkar
Posts: 44
Joined: August 11th, 2010, 11:15 pm
Location: Some people are in homes, some are in cars, I am in-sane.

RPG-MP-Scenerio "Wrath of the Son"

Post by Luroch_Delkar »

I am moving my previous topic about WML bloating to here where I will post all of the future questions I have while making this scenario. I will start it off with this question.

I am having difficulties with making my own unit. The goal is not to make a completely new unit, but rather modify an old unit to have new movement values, Aka it has 1 movement and all terrain cost's more than 1 movement.

In my _main.cfg I have the code

Code: Select all

{~add-ons/Jailbreak/units/units.cfg}
Jailbreak is the folder my _main.cfg is in.
In my units.cfg I attempted to specify a new movement type with

Code: Select all

#textdomain wesnoth
[+units]
	{~add-ons/Jailbreak/units/IronGuard.cfg}
    [movetype]
        name=stoneguard
        [movement_costs]
            shallow_water=9 
            reef=9 
            swamp_water=9 
            flat=9 
            sand=9 
            forest=9 
            hills=9 
            village=9 
            castle=9 
            cave=9 
            frozen=9 
            fungus=9 
        [/movement_costs]

        [defense]
            shallow_water=90
            reef=80
            swamp_water=90
            flat=70
            sand=80
            forest=60
            hills=60
            village=60
            castle=50
            cave=60
            frozen=80
            fungus=60
        [/defense]

        [resistance]
            blade=110
            pierce=110
            impact=110
            fire=110
            cold=110
            arcane=110
        [/resistance]
    [/movetype]
[/units]
That is all of the code within this file. I have tried it without the #textdomain wesnoth.
I originally had made a unit file IronGuard.cfg from scratch, but since that didn't work I have since attempted to copy the entire Heavy Infantryman.cfg from the core files and then change the file name to IronGuard.cfg as well as change:

Code: Select all

id=Heavy Infantryman
name="Heavy Infantryman"
to

Code: Select all

id=Iron Guard
name="Iron Guard"
Whenever I run the game and attempt to place the unit Iron Guard
Spoiler:
it keeps saying "Unknown Unit" then proceeds to crash the game.
Any help will be appreciated.
"The Enforcer knows only one way to preserve peace. So mind your neighbors else it will descend upon you." Sword of the Stars Forever
HAPPINESS=Moderation, Variety, and Love
Current Projects: Jailbreak (RPG)(3/4 completed) , Dungeonmaster Era
User avatar
Reepurr
Posts: 1088
Joined: August 29th, 2010, 5:38 pm

Re: RPG-MP-Scenerio "Wrath of the Son"

Post by Reepurr »

:roll:
There's a much easier way of doing a unit based on a mainline one. Make a .cfg in your units folder and call it IronGuard. Then put in the .cfg:

Code: Select all

[unit_type]
id=Iron Guard
name= _ "Iron Guard"
[base_unit]
id=Heavy Infantryman
[/base_unit]
        [movement_costs]
            shallow_water=9
            reef=9
            swamp_water=9
            flat=9
            sand=9
            forest=9
            hills=9
            village=9
            castle=9
            cave=9
            frozen=9
            fungus=9
        [/movement_costs]

        [defense]
            shallow_water=90
            reef=80
            swamp_water=90
            flat=70
            sand=80
            forest=60
            hills=60
            village=60
            castle=50
            cave=60
            frozen=80
            fungus=60
        [/defense]

        [resistance]
            blade=110
            pierce=110
            impact=110
            fire=110
            cold=110
            arcane=110
        [/resistance]
    [/movetype]
[/unit_type]
Then, put in your _main.cfg:

Code: Select all

#ifdef MULTIPLAYER
...
[+units]
    {~add-ons/Jailbreak/units/}
[/units]
#endif
That should do the trick.
"What do you mean, "a dwarvish dragonguard with marksman is overpowered"?"

Story of a Drake Outcast | The Nonsense Era
Played HttT-Underground Channels? Thought it was rubbish? Help us develop it here!
User avatar
Luroch_Delkar
Posts: 44
Joined: August 11th, 2010, 11:15 pm
Location: Some people are in homes, some are in cars, I am in-sane.

Re: RPG-MP-Scenerio "Wrath of the Son"

Post by Luroch_Delkar »

Thanks, that's just what I was looking for. Better actually. Nice quote by the way.
"The Enforcer knows only one way to preserve peace. So mind your neighbors else it will descend upon you." Sword of the Stars Forever
HAPPINESS=Moderation, Variety, and Love
Current Projects: Jailbreak (RPG)(3/4 completed) , Dungeonmaster Era
User avatar
Luroch_Delkar
Posts: 44
Joined: August 11th, 2010, 11:15 pm
Location: Some people are in homes, some are in cars, I am in-sane.

Re: RPG-MP-Scenerio "Wrath of the Son"

Post by Luroch_Delkar »

Hmm, I am still having problems.

In my _main.cfg I have the code:

Code: Select all

[multiplayer]
  	# Game Data
	id=Jailbreak
	name= _ "Jailbreak"   
	map_data="{~add-ons/Jailbreak/map/Jailbreak_Map}"
	turns=-1   players=4   experience_modifier=80   description= _ "Use Bob's RPG Era." 
	# Macro Data
 	{~add-ons/Bobs_RPG_Era/files/misc_macros.cfg} 	
 	{~add-ons/Bobs_RPG_Era/files/scenario_macros.cfg}
 	{~add-ons/Bobs_RPG_Era/files/shops.cfg}
 	{~add-ons/Jailbreak/macros/misc.cfg}
 	{~add-ons/Jailbreak/macros/abilities.cfg}
	{~add-ons/Jailbreak/macros/item_placing.cfg}
	{~add-ons/Jailbreak/macros/potion_drinking.cfg}
[+units]
	{~add-ons/Jailbreak/units}
[/units]
in add-ons/Jailbreak/units I have the file IronGuard.cfg which contains the code:

Code: Select all

[unit_type]
	id=Iron Guard
	name= _ "Iron Guard"
  [base_unit]
	id="Heavy Infantryman"
  [/base_unit]
	[movement_costs]
		shallow_water=9 
            reef=9 
            swamp_water=9 
            flat=9 
            sand=9 
            forest=9 
            hills=9 
            village=9 
            castle=9 
            cave=9 
            frozen=9 
            fungus=9 
       [/movement_costs]

       [defense]
            shallow_water=90
            reef=80
            swamp_water=90
            flat=70
            sand=80
            forest=60
            hills=60
            village=60
            castle=50
            cave=60
            frozen=80
            fungus=60
       [/defense]

       [resistance]
            blade=110
            pierce=110
            impact=110
            fire=110
            cold=110
            arcane=110
       [/resistance]

	hitpoints=1
	movement=1
	experience=9999
	level=1
	alignment=neutral
	advances_to=null
	num_traits=1
	description="Those elite guards that are placed to guard an area from intruders."
	do_not_list=yes
[/unit_type]
Later in my _main.cfg I evoke the unit with:

Code: Select all

	[unit]
		x=20
		y=58
		side=3
		type="Iron Guard"
		id="guard2"
		name= _ "Guard Lieutenant First Class"	
		role=heavy_infantryman
		hitpoints=50
		facing=sw
		ai_special=guardian
	[modifications]
		{TRAIT_LOYAL}
	[/modifications]	
	[/unit]
I still get an unknown unit error.
"The Enforcer knows only one way to preserve peace. So mind your neighbors else it will descend upon you." Sword of the Stars Forever
HAPPINESS=Moderation, Variety, and Love
Current Projects: Jailbreak (RPG)(3/4 completed) , Dungeonmaster Era
User avatar
Reepurr
Posts: 1088
Joined: August 29th, 2010, 5:38 pm

Re: RPG-MP-Scenerio "Wrath of the Son"

Post by Reepurr »

I wrote:Then, put in your _main.cfg:

Code: Select all

#ifdef MULTIPLAYER
...
[+units]
    {~add-ons/Jailbreak/units/}
[/units]
#endif
That should do the trick.
The ifdef is probably the needed bit.
"What do you mean, "a dwarvish dragonguard with marksman is overpowered"?"

Story of a Drake Outcast | The Nonsense Era
Played HttT-Underground Channels? Thought it was rubbish? Help us develop it here!
User avatar
Luroch_Delkar
Posts: 44
Joined: August 11th, 2010, 11:15 pm
Location: Some people are in homes, some are in cars, I am in-sane.

Re: RPG-MP-Scenerio "Wrath of the Son"

Post by Luroch_Delkar »

Yep, that worked. Thanks again.
"The Enforcer knows only one way to preserve peace. So mind your neighbors else it will descend upon you." Sword of the Stars Forever
HAPPINESS=Moderation, Variety, and Love
Current Projects: Jailbreak (RPG)(3/4 completed) , Dungeonmaster Era
Post Reply