question for singleunit wml

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
joeysnecrodude
Posts: 35
Joined: September 9th, 2007, 8:57 pm
Location: South Florida USA

question for singleunit wml

Post by joeysnecrodude »

i see on the single unit page of the create section of this site that u can have an ai special guardian so would it be...

[event]
name=prestart
[unit]
type=Giant Spider
ai_special=guardian
x,y=8,12
side=1
[/unit]
[/event]

i can't get this one to work
i just want this unit to NOT be able to move so if there is a different way plz tell me

also it would be a big help if u could tell me how to make a leader unable to move too
august 31, 2008 Venezula is completely flat - mercs 2
User avatar
A Guy
Posts: 790
Joined: May 24th, 2008, 1:55 am

Re: question for singleunit wml

Post by A Guy »

Non-moving leader:

Code: Select all

[side]
   [ai]
      passive_leader=yes
   [/ai]
[/side]
You have to give a unit an object if you don't want it to move.
I'm just... a guy...
I'm back for now, I might get started on some work again.
User avatar
joeysnecrodude
Posts: 35
Joined: September 9th, 2007, 8:57 pm
Location: South Florida USA

Re: question for singleunit wml

Post by joeysnecrodude »

soooo can u put it more detailed because its not working this is wat i put and it doesn't work

[side]
[ai]
passive_leader=yes
[/ai]
side=1
type=Giant Spider
allow_player=false
canrecruit=no
village_gold=2
team_name=bandits
gold=25
[/side]
august 31, 2008 Venezula is completely flat - mercs 2
User avatar
DEATH_is_undead
Posts: 960
Joined: March 4th, 2007, 3:00 pm
Location: Northern United States

Re: question for singleunit wml

Post by DEATH_is_undead »

Put that in a [unit] tag, and put the unit tag in a start [event].
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
AI
Developer
Posts: 2394
Joined: January 31st, 2008, 8:38 pm

Re: question for singleunit wml

Post by AI »

passive_leader only applies to units that have canrecruit=yes (aka, the leader). There are several ways to make a unit not move:
-Make a side_turn event that sets the unit's moves to 0. (you may need to give the unit a role to distinguish it from all other units)
-Give the unit an object that sets their max movement points to 0
-Give it an object that sets their movecost to 99 or something
-(1.5 only)give it a formula that doesn't allow it to move
Jozrael
Posts: 1034
Joined: June 2nd, 2006, 1:39 pm
Location: NJ, USA.

Re: question for singleunit wml

Post by Jozrael »

The guardian ai special just means it'll only attack units in its range, it won't move more than that to get nearer.

Yea, u either need to set its max moves to zero by redefining its type, or if its not unique, do one of the above strategies.
User avatar
joeysnecrodude
Posts: 35
Joined: September 9th, 2007, 8:57 pm
Location: South Florida USA

Re: question for singleunit wml

Post by joeysnecrodude »

k i got this down no need to post n e more
august 31, 2008 Venezula is completely flat - mercs 2
Post Reply