EarthCake's problems

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
EarthCake
Posts: 377
Joined: March 29th, 2019, 1:57 pm
Location: The Wall

Re: EarthCake's problems

Post by EarthCake »

When I changed what josteph said about unmounting.type, now units appears, but there is again lua error.

@josteph, thanks a lot, I will try your idea.

Also, great thanks to everyone who ever helped me in this topic (for before, now and always).
Last edited by EarthCake on May 10th, 2019, 7:41 pm, edited 1 time in total.
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: EarthCake's problems

Post by josteph »

Divide and conquer. First make it so when a unit is reduced to 0HP, it doesn't die. Then make it so when a unit dies it changes to some other unit type, but hardcode which type that is. When that works, see about making different units transform to different types.
User avatar
EarthCake
Posts: 377
Joined: March 29th, 2019, 1:57 pm
Location: The Wall

Re: EarthCake's problems

Post by EarthCake »

When horseman dies, is there any way that spearman be spawned on the same tile where horseman died?
User avatar
EarthCake
Posts: 377
Joined: March 29th, 2019, 1:57 pm
Location: The Wall

Re: EarthCake's problems

Post by EarthCake »

Also, when scenario finishes, and spearman that was horseman survived, how do I make him back to be horseman and have back his xp in next scenario?
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: EarthCake's problems

Post by octalot »

EarthCake wrote: May 11th, 2019, 7:57 am When horseman dies, is there any way that spearman be spawned on the same tile where horseman died?
How far have you got with Joseph's suggestion to divide and conquer? What's working and what's not?

Doing another change at the end of the scenario could be similar code, but it's a separate problem. First get the transformation in one direction working, then you'll have an already-working example for the transformation in the other direction.
User avatar
EarthCake
Posts: 377
Joined: March 29th, 2019, 1:57 pm
Location: The Wall

Re: EarthCake's problems

Post by EarthCake »

Is there any way to make that one side has two leaders, which in the previous scenario were two heroes on one side, but that one leader can only recruit units, and another one can only recall units from previous scenarios. In next scenario they should be again on the same side, that one leader can both recruit and recall units from previous scenario(s).
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: EarthCake's problems

Post by octalot »

Legend of Wesmere does that and more - in single player mode you have three leaders, of whom Kalenz and Landar can recruit and recall the non-fairy elves, and Cleodil does the woses and fairies.

There's a single recall list, using per-character [filter_recall], and the recruitment is handled by per-character extra_recruit lists.

Cleodil joins in scenario 4. The per-character defines are in utils/characters.cfg and the definitions of ELVES_STEEL and ELVES_NON_STEEL are in utils/low-macros.cfg.
User avatar
EarthCake
Posts: 377
Joined: March 29th, 2019, 1:57 pm
Location: The Wall

Re: EarthCake's problems

Post by EarthCake »

What is this about?

Code: Select all

The following add-on had errors and could not be loaded:
   ~/.config/wesnoth-1.14/data/add-ons/Under_a_Single_Banner/_main.cfg

Please report this to the author or maintainer of this add-on.

Details:

    Found filename containing whitespace: '06_The_ Elvish_Capital.cfg' in included directory '~/.config/wesnoth-1.14/data/add-ons/Under_a_Single_Banner/scenarios'.
    The included symbol probably looks similar to '/add-ons/Under_a_Single_Banner/scenarios'
    at ~add-ons/Under_a_Single_Banner/_main.cfg:-1
User avatar
Ravana
Forum Moderator
Posts: 3002
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: EarthCake's problems

Post by Ravana »

Whitespace is not allowed in file path.
User avatar
EarthCake
Posts: 377
Joined: March 29th, 2019, 1:57 pm
Location: The Wall

Re: EarthCake's problems

Post by EarthCake »

Ah, thanks, I didn't notice that in file name.
User avatar
EarthCake
Posts: 377
Joined: March 29th, 2019, 1:57 pm
Location: The Wall

Re: EarthCake's problems

Post by EarthCake »

Code: Select all

#define HELP_EVENTS
    	[event]
        	name=help_walkthroughs_check
        	first_time_only=no
        	[message]
            		speaker=narrator
            		message=_"<span color='red'>SPOILER WARNING: Better read this only if you get stuck.</span>
Do you want to read this anyway?"
            		side_for=$side_number
            		image="wesnoth-icon.png"
            		[option]
                		label=_"No."
                		[command]
                		[/command]
            		[/option]
            		[option]
                		label=_"Yes."
                		[command]
                    			[fire_event]
                        			name=help_walkthroughs
                    			[/fire_event]
                		[/command]
            		[/option]
        	[/message]
    	[/event]
    	[event]
        	name=help_walkthroughs
        	first_time_only=no
        	[message]
            		speaker=narrator
            		message= _ "For which scenario do you need help?"
            		side_for=$side_number
            		image="wesnoth-icon.png"
            		[option]
                		label=_"Prologue"
                		[command]
                    			[message]
                        			speaker=narrator
                        			message= _ "This is just a prologue scenario. The only thing you need to do is to reach the signpost in south. The undead will try to catch you, but if you move the hero all the time towards the village in south, the undead will not be able to catch you."
                        			side_for=$side_number
                        			image="wesnoth-icon.png"
                    			[/message]
                    			[fire_event]
                        			name=help_walkthroughs
                    			[/fire_event]
                		[/command]
            		[/option]
            		[option]
                		label= _ "Scenario 1 (Defense of Elensefar)"
                		[command]
                    			[message]
                        			speaker=narrator
                        			message= _ "This isn't implemented yet."
                        			side_for=$side_number
                        			image="wesnoth-icon.png"
                    			[/message]
                    			[fire_event]
                        			name=help_walkthroughs
                    			[/fire_event]
                		[/command]
            		[/option]
			[option]
				label= _ "Exit"
				[command]
				[/command]
			[/option]
		[/message]
	[/event]
#enddef
Why this doesn't work if I put into a scenario {HELP_EVENTS}
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: EarthCake's problems

Post by Pentarctagon »

Is there something firing the help_walkthroughs_check event?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
EarthCake
Posts: 377
Joined: March 29th, 2019, 1:57 pm
Location: The Wall

Re: EarthCake's problems

Post by EarthCake »

No.
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: EarthCake's problems

Post by Pentarctagon »

That would be your problem then.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
EarthCake
Posts: 377
Joined: March 29th, 2019, 1:57 pm
Location: The Wall

Re: EarthCake's problems

Post by EarthCake »

@Pentarctagon, thanks, I created this:

Code: Select all

#define GLOBAL_EVENTS
	[event]
		name=start
        	[set_menu_item]
			# Please don't ask what is this for.
            		id=9help
            		description=_"Walkthroughs"
            		[command]
                            	[fire_event]
                                	name=help_walkthroughs_check
                            	[/fire_event]
			[/command]
		[/set_menu_item]
	[/event]
#enddef [code]
and put {GLOBAL_EVENTS} in scenario, but now it doesn't fire event help_walkthroughs_check.
Post Reply