Modifing Default Monsters?
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.
- Ryuuzaki52
- Posts: 34
- Joined: November 25th, 2010, 8:24 pm
Modifing Default Monsters?
I'm looking to set a "Special ability" on a few random monsters on my map. I know how to PLACE the monsters, but if I were to say, want to put Ambush on a Giant Spider, how would I put it in this script?
Note: That isn't the script. I haven't written it yet. But it'd look almost exactly like that.
EDIT: I'm pretty sure it'd go in here or something
But not sure of the terms to use x.x
Code: Select all
#textdomain wesnoth-multiplayer
#define MPWILD_UNIT X Y TYPE
[unit]
type={TYPE}
side=5
x={X}
y={Y}
random_traits=no
[/unit]
#enddef
#define MPWILD_WALKING_CORPSE X Y VARIATION_NAME
[unit]
type=Walking Corpse
side=5
x={X}
y={Y}
variation={VARIATION_NAME}
#random_traits=no
[/unit]
#enddef
#define MPWILD_SOULLESS X Y VARIATION_NAME
[unit]
type=Soulless
side=5
x={X}
y={Y}
variation={VARIATION_NAME}
#random_traits=no
[/unit]
#enddef
[multiplayer]
id=multiplayer_The_Autumn_Void
name= _ "5p — The Autumn Void"
description= _ "A visit to the multicolored plains of the Autumn Void."
map_data="{~add-ons/maps/The_Autumn_Void}"
{DEFAULT_SCHEDULE}
{DEFAULT_MUSIC_PLAYLIST}
[side]
[ai]
villages_per_scout=16
[/ai]
side=1
canrecruit=yes
controller=human
village_gold=2
fog=yes
[/side]
[side]
[ai]
villages_per_scout=16
[/ai]
side=2
canrecruit=yes
controller=human
village_gold=2
fog=yes
[/side]
[side]
[ai]
villages_per_scout=16
[/ai]
side=3
canrecruit=yes
controller=human
village_gold=2
fog=yes
[/side]
[side]
[ai]
villages_per_scout=16
[/ai]
side=4
canrecruit=yes
controller=human
village_gold=2
fog=yes
[/side]
[side]
[ai]
villages_value=0
[/ai]
side=5
canrecruit=yes
controller=human
village_gold=2
fog=yes
[/side]
[event]
name=prestart
[if]
[have_unit]
side=5
[/have_unit]
[then]
[kill]
animate=no
fire_event=no
side=5
[/kill]
{MPWILD_UNIT 4 100 (Yeti)}
{MPWILD_UNIT 36 97 (Yeti)}
{MPWILD_UNIT 50 50 (Skeletal Dragon)}
{MPWILD_UNIT 97 1 (Skeletal Dragon)}
{MPWILD_UNIT 98 100 (Giant Spider)}
{MPWILD_UNIT 26 72 (Giant Spider)}
{MPWILD_UNIT 35 67 (Giant Spider)}
{MPWILD_UNIT 47 47 (Giant Spider)}
{MPWILD_UNIT 95 60 (Giant Spider)}
{MPWILD_UNIT 74 94 (Giant Spider)}
{MPWILD_UNIT 67 85 (Giant Spider)}
{MPWILD_UNIT 70 8 (Giant Scorpion)}
{MPWILD_UNIT 79 15 (Giant Scorpion)}
{MPWILD_UNIT 46 15 (Giant Scorpion)}
{MPWILD_UNIT 42 30 (Giant Scorpion)}
{MPWILD_UNIT 59 84 (Cuttle Fish)}
{MPWILD_UNIT 76 51 (Cuttle Fish)}
{MPWILD_UNIT 96 31 (Cuttle Fish)}
{MPWILD_UNIT 42 5 (Cuttle Fish)}
{MPWILD_UNIT 68 73 (Cuttle Fish)}
{MPWILD_UNIT 5 32 (Cuttle Fish)}
{MPWILD_UNIT 3 1 (Cuttle Fish)}
{MPWILD_UNIT 39 1 (Tentacle of the Deep)}
{MPWILD_UNIT 38 1 (Tentacle of the Deep)}
{MPWILD_UNIT 44 2 (Tentacle of the Deep)}
{MPWILD_UNIT 19 26 (Tentacle of the Deep)}
{MPWILD_UNIT 4 37 (Tentacle of the Deep)}
{MPWILD_UNIT 5 38 (Tentacle of the Deep)}
{MPWILD_UNIT 4 38 (Tentacle of the Deep)}
{MPWILD_UNIT 4 33 (Tentacle of the Deep)}
{MPWILD_UNIT 6 42 (Tentacle of the Deep)}
{MPWILD_UNIT 7 50 (Tentacle of the Deep)}
{MPWILD_UNIT 8 59 (Tentacle of the Deep)}
{MPWILD_UNIT 7 59 (Tentacle of the Deep)}
{MPWILD_UNIT 8 58 (Tentacle of the Deep)}
{MPWILD_UNIT 9 59 (Tentacle of the Deep)}
{MPWILD_UNIT 14 55 (Tentacle of the Deep)}
{MPWILD_UNIT 60 56 (Tentacle of the Deep)}
{MPWILD_UNIT 83 58 (Tentacle of the Deep)}
{MPWILD_UNIT 60 87 (Tentacle of the Deep)}
{MPWILD_UNIT 42 92 (Tentacle of the Deep)}
{MPWILD_UNIT 41 92 (Tentacle of the Deep)}
{MPWILD_UNIT 66 94 (Tentacle of the Deep)}
{MPWILD_WALKING_CORPSE 68 19 saurian}
{MPWILD_WALKING_CORPSE 68 18 saurian}
{MPWILD_SOULLESS 67 19 saurian}
{MPWILD_WALKING_CORPSE 67 18 saurian}
{MPWILD_WALKING_CORPSE 69 20 saurian}
{MPWILD_WALKING_CORPSE 21 20 saurian}
{MPWILD_WALKING_CORPSE 21 21 saurian}
{MPWILD_SOULLESS 25 21 saurian}
{MPWILD_WALKING_CORPSE 29 22 saurian}
{MPWILD_WALKING_CORPSE 91 39 saurian}
{MPWILD_WALKING_CORPSE 91 32 saurian}
{MPWILD_WALKING_CORPSE 35 42 saurian}
{MPWILD_WALKING_CORPSE 34 42 saurian}
{MPWILD_WALKING_CORPSE 95 68 saurian}
{MPWILD_SOULLESS 96 68 saurian}
{MPWILD_WALKING_CORPSE 97 68 saurian}
{MPWILD_WALKING_CORPSE 9 55 swimmer}
{MPWILD_SOULLESS 3 56 swimmer}
{MPWILD_WALKING_CORPSE 7 62 swimmer}
{MPWILD_WALKING_CORPSE 29 61 swimmer}
{MPWILD_WALKING_CORPSE 44 77 swimmer}
{MPWILD_WALKING_CORPSE 62 88 swimmer}
[set_recruit]
side=5
recruit=""
[/set_recruit]
{MODIFY_UNIT x,y=50,50 canrecruit yes}
[/then]
[/if]
[/event]
[event]
name=die
first_time_only=no
[filter]
canrecruit=yes
side=5
[/filter]
[store_unit]
[filter]
side=5
canrecruit=no
[/filter]
variable=newleader
kill=no
[/store_unit]
[if]
[variable]
name=newleader.length
greater_than=0
[/variable]
[then]
{VARIABLE newleader.canrecruit yes}
[unstore_unit]
variable=newleader
[/unstore_unit]
[/then]
[/if]
[/event]
[/multiplayer]
#undef MPWILD_UNIT
#undef MPWILD_WALKING_CORPSE
#undef MPWILD_SOULLESS
EDIT: I'm pretty sure it'd go in here or something
Code: Select all
[unit]
type=Soulless
side=5
x={X}
y={Y}
variation={VARIATION_NAME}
#random_traits=no
[/unit]
- Alarantalara
- Art Contributor
- Posts: 786
- Joined: April 23rd, 2010, 8:17 pm
- Location: Canada
Re: Modifing Default Monsters?
Add a [modifications] tag to the unit. Inside that tag, add any traits or abilities you like.
An example of a spider with ambush:
For other abilities or traits, I recommend the WML reference guide.
An example of a spider with ambush:
Code: Select all
[unit]
type=Giant Spider
x,y=10,10
side=2
[modifications]
[object]
[effect]
apply_to=new_ability
[abilities]
{ABILITY_AMBUSH}
[/abilities]
[/effect]
[/object]
[/modifications]
[/unit]
Re: Modifing Default Monsters?
You could do that for other effects (hp and such I suppose), but for this specific case this would be less wieldy IMO. (Has been tested and works.)Alarantalara wrote:Add a [modifications] tag to the unit. Inside that tag, add any traits or abilities you like.
Code: Select all
[unit]
type=Giant Spider
x,y=10,10
side=2
[abilities]
{ABILITY_AMBUSH}
[/abilities]
[/unit]
- Ryuuzaki52
- Posts: 34
- Joined: November 25th, 2010, 8:24 pm
Re: Modifing Default Monsters?
Where exactly would I put that? I'm trying to shove it in it's own
Type thing o.o Is that wrong?
Code: Select all
[unit]
type=Soulless
side=5
x={X}
y={Y}
variation={VARIATION_NAME}
#random_traits=no
[/unit]
Re: Modifing Default Monsters?
This has not been tested, but I believe that [abilities] can be left empty for no extra abilities. I'd test it first, though.
If the unit has an ability - {MP_WILD_UNIT Spearman 45 23 ({ABILITY_AMBUSH})}
If the unit does NOT have an ability - {MP_WILD_UNIT Spearman 45 23 ()}
Code: Select all
#define MP_WILD_UNIT TYPE X Y ABILITIES
[unit]
type={TYPE}
side=5
x={X}
y={Y}
[abilities]
{ABILITIES}
[/abilities]
[/unit]
#enddef
If the unit does NOT have an ability - {MP_WILD_UNIT Spearman 45 23 ()}
- Ryuuzaki52
- Posts: 34
- Joined: November 25th, 2010, 8:24 pm
Re: Modifing Default Monsters?
This is what I have but it's giving me an "Expects 3 arguments but sees 4" error. Sorry, I'm really new to this scripting x.x
Code: Select all
#textdomain wesnoth-multiplayer
#define MPABILITY_UNIT X Y TYPE
[unit]
type={TYPE}
side=5
x={X}
y={Y}
[abilities]
{ABILITIES}
[/abilities]
[/unit]
#enddef
#define MPWILD_UNIT X Y TYPE
[unit]
type={TYPE}
side=5
x={X}
y={Y}
random_traits=no
[/unit]
#enddef
#define MPWILD_WALKING_CORPSE X Y VARIATION_NAME
[unit]
type=Walking Corpse
side=5
x={X}
y={Y}
variation={VARIATION_NAME}
#random_traits=no
[/unit]
#enddef
#define MPWILD_SOULLESS X Y VARIATION_NAME
[unit]
type=Soulless
side=5
x={X}
y={Y}
variation={VARIATION_NAME}
#random_traits=no
[/unit]
#enddef
[multiplayer]
id=multiplayer_Wetlands
name= _ "5p — Wetlands"
description= _ "Dangerous Marshes Fill This Realm"
map_data="{~add-ons/DRPRyuu/maps/Wetlands}"
{DEFAULT_SCHEDULE}
{DEFAULT_MUSIC_PLAYLIST}
[side]
[ai]
villages_per_scout=16
[/ai]
side=1
canrecruit=yes
controller=human
village_gold=2
fog=yes
[/side]
[side]
[ai]
villages_per_scout=16
[/ai]
side=2
canrecruit=yes
controller=human
village_gold=2
fog=yes
[/side]
[side]
[ai]
villages_per_scout=16
[/ai]
side=3
canrecruit=yes
controller=human
village_gold=2
fog=yes
[/side]
[side]
[ai]
villages_per_scout=16
[/ai]
side=4
canrecruit=yes
controller=human
village_gold=2
fog=yes
[/side]
[side]
[ai]
villages_value=0
[/ai]
side=5
canrecruit=yes
controller=human
village_gold=2
fog=yes
[/side]
[event]
name=prestart
[if]
[have_unit]
side=5
[/have_unit]
[then]
[kill]
animate=no
fire_event=no
side=5
[/kill]
{MPWILD_UNIT 20 20 (Skeletal Dragon)}
{MPABILITY_UNIT 38 45 (Giant Spider)({ABILITY_AMBUSH})}
{MPWILD_SOULLESS 22 1 saurian}
{MPWILD_WALKING_CORPSE 22 2 saurian}
{MPWILD_WALKING_CORPSE 22 3 saurian}
{MPWILD_WALKING_CORPSE 22 4 saurian}
{MPWILD_WALKING_CORPSE 22 5 saurian}
{MPWILD_SOULLESS 12 22 swimmer}
{MPWILD_WALKING_CORPSE 12 23 swimmer}
[set_recruit]
side=5
recruit=""
[/set_recruit]
{MODIFY_UNIT x,y=50,50 canrecruit yes}
[/then]
[/if]
[/event]
[event]
name=die
first_time_only=no
[filter]
canrecruit=yes
side=5
[/filter]
[store_unit]
[filter]
side=5
canrecruit=no
[/filter]
variable=newleader
kill=no
[/store_unit]
[if]
[variable]
name=newleader.length
greater_than=0
[/variable]
[then]
{VARIABLE newleader.canrecruit yes}
[unstore_unit]
variable=newleader
[/unstore_unit]
[/then]
[/if]
[/event]
[/multiplayer]
#undef MPWILD_UNIT
#undef MPWILD_WALKING_CORPSE
#undef MPWILD_SOULLESS
#undef MPABILITY_UNIT
Re: Modifing Default Monsters?
This should be changed to:Ryuuzaki52 wrote:#define MPABILITY_UNIT X Y TYPE
Code: Select all
#define MPABILITY_UNIT X Y TYPE ABILITY
- Ryuuzaki52
- Posts: 34
- Joined: November 25th, 2010, 8:24 pm
Re: Modifing Default Monsters?
Ah, alright. My bad. I got that in there and now it's informing me that it can't find an abilities folder in my standard "Scenario-Map" area...(There ISN'T one)
Re: Modifing Default Monsters?
See my reply to your PM.