[unit] tag, need help. (again...)
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.
-
- Posts: 21
- Joined: November 15th, 2019, 8:54 pm
[unit] tag, need help. (again...)
Hi guys, tis' the third time i write here because it seems like you can do miracles. So i'm trying to have a unit spawn insta ntly at the beginning of the scenario. The goal is to have it in the same side or atleast allied to side1. I also want to disallow movement for this unit. It also needs an id. here is what i tried :
i get lua errors. Me having a potato level in it i have no idea how to read those, they are saying :
and
as always here is the full scenario code (wich isn't 100% done but most of necessary things should be in) :
Code: Select all
[event]
name=start
[unit]
type=Sovereign
side=1
name= _ "Gurash"
x=18
y=30
id=Gurash
[/unit]
[/event]
Code: Select all
<Lua error> lua/core.lua438: [message] not supported at scenario toplevel
stack traceback:
[C]: In function '.error'
lua/core.lua438: in function <lua/core.lua:426>
Code: Select all
<Lua error> game_error: unknown unit type : Sovereign
stack traceback:
[C]: In local 'cmd'
lua/wml-utils.lua:145: In field 'handle_event_commands'
lua/wml-flow.lua6: In function <lua/wml-flow.lua:5>
Code: Select all
[scenario]
{DEFAULT_SCHEDULE}
id=chasse_aux_loups
next_scenario=null
name= _ "Chasse aux loups"
map_data="{~add-ons/pour_la_horde/maps/chasse_aux_loups.map}"
turns=30
[event]
name=start
[message]
speaker=narrator
message= _ "A remplir"
[/message]
[objectives]
[objective]
description= _ "Éliminez l'Alpha"
condition=win
[/objective]
[objective]
description= _ "Mort d'Uldrulf"
condition=lose
[/objective]
[objective]
description= _ "Mort de Gurash"
condition=lose
[/objective]
[objective]
description= _ "Limite des tours atteinte"
condition=lose
[/objective]
[/objectives]
[/event]
[side]
side=1
controller=human
team_name="good"
user_team_name= _ "Groupe d'Uldrulf"
id="Uldrulf"
name= _ "Uldrulf"
type="Orcish Grunt"
unrenameable=yes
canrecrcuit=yes
recruit="Orcish Archer,Orcish Grunt, Wolf Rider"
gold=250
[/side]
[event]
name=start
[unit]
type=Sovereign
side=1
name= _ "Gurash"
x=18
y=30
[/unit]
[/event]
[side]
side=2
controller=ai
team_name="bad"
user_team_name= _ "Meute de loups"
id="Alpha"
name= _ "Loup Alpha"
type="Direwolf"
unrenameable=yes
canrecrcuit=yes
recruit="Great Wolf, Wolf"
gold=100
[/side]
[event]
name=die
[filter]
id=Alpha
[/filter]
[message]
speaker=Uldrulf
message= _ "Père, j'ai réussi !"
[/message]
[message]
speaker=Gurash
message= _ "Aujourd'hui tu obtiens ta première victoire, souviens toi de ce jour fils."
[/message]
[endlevel]
result=victory
[/endlevel]
[/event]
[event]
name=die
[filter]
id=Uldrulf
[/filter]
[message]
speaker=Gurash
message= _ "Mon fils est une décéption, ces hommes méritaient mieux que de mourir sous ses ordres..."
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
[event]
name=die
[filter]
id=Gurash
[/filter]
[message]
speaker=Uldrulf
message= _ "Comment cela à-t'il pu se passer ?! père !"
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
name=time over
[message]
speaker=Uldrulf
message= _ "Si nous ne rentrons pas, nous tomberons à court de vivre, allons-nous en!"
[/message]
[message]
speaker=Gurash
message= _ "Si tu n'arrives pas à éliminer quelques loups en plusieurs jours, tu ne seras jamais digne de mener la tribu..."
[/message]
[endlevel]
result=defeat
[/endlevel]
[event]
[/event]
[/scenario]
- Pentarctagon
- Project Manager
- Posts: 5565
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: [unit] tag, need help. (again...)
The first error at least is because you have:
([event] is in the wrong place)
Code: Select all
[message]
speaker=Uldrulf
message= _ "Si nous ne rentrons pas, nous tomberons à court de vivre, allons-nous en!"
[/message]
[message]
speaker=Gurash
message= _ "Si tu n'arrives pas à éliminer quelques loups en plusieurs jours, tu ne seras jamais digne de mener la tribu..."
[/message]
[endlevel]
result=defeat
[/endlevel]
[event]
[/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
take one down, patch it around
-2,147,483,648 little bugs in the code
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: [unit] tag, need help. (again...)
You probably meant
type=Orcish Sovereign
.Also, you can put [unit] tags directly in [side] to create units that start on that side.
For the lua errors, just look at the first line. It tells you what the main problem is. For example, "game_error: unknown unit type: Sovereign." That message, at least, should be pretty clear. You can ignore the rest of the lines.
Edit: fixed typo
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: [unit] tag, need help. (again...)
Actually
type=Orcish Sovereign
.-
- Posts: 21
- Joined: November 15th, 2019, 8:54 pm
Re: [unit] tag, need help. (again...)
thank you for pointing that out, i still need to focus more on what i do it would seem...Pentarctagon wrote: ↑August 9th, 2020, 1:07 am The first error at least is because you have:([event] is in the wrong place)Code: Select all
[message] speaker=Uldrulf message= _ "Si nous ne rentrons pas, nous tomberons à court de vivre, allons-nous en!" [/message] [message] speaker=Gurash message= _ "Si tu n'arrives pas à éliminer quelques loups en plusieurs jours, tu ne seras jamais digne de mener la tribu..." [/message] [endlevel] result=defeat [/endlevel] [event] [/event]
-
- Posts: 21
- Joined: November 15th, 2019, 8:54 pm
Re: [unit] tag, need help. (again...)
Yeah i read about putting it in side but didn't get it to work. Got it working now. I'm just a bit surprised that it is type=Orcish Sovereign adn not type="Orcish Soverreign" but i'll remember that, thank you for your timebeetlenaut wrote: ↑August 9th, 2020, 2:16 amYou probably meanttype=Orcish Sovereign
.
Also, you can put [unit] tags directly in [side] to create units that start on that side.For the lua errors, just look at the first line. It tells you what the main problem is. For example, "game_error: unknown unit type: Sovereign." That message, at least, should be pretty clear. You can ignore the rest of the lines.
Edit: fixed typo
Re: [unit] tag, need help. (again...)
for this u can just use max_moves like this:
Code: Select all
[unit]
id=Gurash
type=Orcish Sovereign
name= _ "Gurash"
x=18
y=30
max_moves=0
[/unit]
eh, what comes here again?
Re: [unit] tag, need help. (again...)
Both should work if you fix that typo in souvereignnexusrebirth wrote: ↑August 9th, 2020, 12:10 pm I'm just a bit surprised that it is type=Orcish Sovereign adn not type="Orcish Soverreign" but i'll remember that, thank you for your time
eh, what comes here again?
-
- Posts: 21
- Joined: November 15th, 2019, 8:54 pm
Re: [unit] tag, need help. (again...)
thank you that's perfects1m0n1nl33t wrote: ↑August 10th, 2020, 10:36 amfor this u can just use max_moves like this:That gives the unit 0 movement points -> it can't move, but do anything elseCode: Select all
[unit] id=Gurash type=Orcish Sovereign name= _ "Gurash" x=18 y=30 max_moves=0 [/unit]
-
- Posts: 21
- Joined: November 15th, 2019, 8:54 pm
Re: [unit] tag, need help. (again...)
Ooops i really need to focus more on what i write... thank yous1m0n1nl33t wrote: ↑August 10th, 2020, 10:38 amBoth should work if you fix that typo in souvereignnexusrebirth wrote: ↑August 9th, 2020, 12:10 pm I'm just a bit surprised that it is type=Orcish Sovereign adn not type="Orcish Soverreign" but i'll remember that, thank you for your time