Creating a(nother) Dot_, and in need of help.
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: 984
- Joined: February 21st, 2006, 11:02 pm
- Location: 0x466C616D65
Creating a(nother) Dot_, and in need of help.
Well, as the title says, I am making a Dot_, and I tried coding the shops myself instead of stealing them from another one. I thought it would be an excercise in coding, help me learn WML better. Probably a bad idea. They don't even show up when the character moves to the shop location! Here's the code(I started out simple enough):
Basically, when the character moves to the specified location, say 9,10, nothing happens. So what am I doing wrong?
[/code]
Code: Select all
#######SHOPS#######
#define SHOP X Y
[event]
name=moveto
[filter]
canrecruit=1
x={X}
y={Y}
[/filter]
[message]
description=Shopkeeper
message= _ "What would you like to do?"
[option]
message= _ "Strength Training: 120g +2 melee damage"
[command]
[gold]
amount=-120
side=$side_number
[/gold]
[object]
silent=yes
[effect]
apply_to=attack
range=melee
increase_damage=2
[/effect]
[/object]
[/command]
[/option]
[option]
message= _ "Ranged Training: 140g +2 ranged damage"
[command]
[gold]
amount=-140
side=$side_number
[/gold]
[object]
silent=yes
[effect]
apply_to=attack
range=ranged
increase_damage=2
[/effect]
[/object]
[/command]
[/option]
[/message]
[/event]
#enddef
{SHOP 9 10} {SHOP 11 9} {SHOP 13 8}
{SHOP 19 25} {SHOP 21 24} {SHOP 23 23}
#######END SHOPS#######
[/code]
-
- Posts: 984
- Joined: February 21st, 2006, 11:02 pm
- Location: 0x466C616D65
-
- Posts: 984
- Joined: February 21st, 2006, 11:02 pm
- Location: 0x466C616D65
Ok, thanks for the replies. I got the shop to work and a fully working hero upgrade system thingy, but now creep upgrades do not work! I suppose I could just steal them from another MP scenario, but I wanted to try it myself. Again, bad idea. Fate must never have intended me to write WML. Here's the creep creation code:
Creeps are created all around a single trapdoor, one is created each time a turn starts, any and every side's turn, so that by Turn 2 there's 6 of them clustered around each trapdoor. Creep upgrades buyable in the shop do not show up on the creeps.
Code: Select all
###Creep Creation
[event]
name=side turn
side_number=7
first_time_only=no
[unit]
x=12,15
y=13,12
type=Peasant
side=7
[modifications]
[object]
silent=yes
[effect]
apply_to=attack
range=melee
increase_damage=$creep_melee_dmg_7
[/effect]
[effect]
apply_to=attack
range=melee
increase_damage=$creep_melee_strikes_7
[/effect]
[effect]
apply_to=attack
range=ranged
increase_damage=$creep_ranged_dmg_7
[/effect]
[effect]
apply_to=attack
range=ranged
increase_damage=$creep_ranged_strikes_7
[/effect]
[effect]
apply_to=hitpoints
increase_total=$creep_hp_7
heal_full=yes
[/effect]
[/object]
[/modifications]
[/unit]
[/event]
[event]
name=side turn
side_number=8
first_time_only=no
[unit]
x=17,20
y=21,19
type=Peasant
side=8
[modifications]
[object]
silent=yes
[effect]
apply_to=attack
range=melee
increase_damage=$creep_melee_dmg_8
[/effect]
[effect]
apply_to=attack
range=melee
increase_damage=$creep_melee_strikes_8
[/effect]
[effect]
apply_to=attack
range=ranged
increase_damage=$creep_ranged_dmg_8
[/effect]
[effect]
apply_to=attack
range=ranged
increase_damage=$creep_ranged_strikes_8
[/effect]
[effect]
apply_to=hitpoints
increase_total=$creep_hp_8
heal_full=yes
[/effect]
[/object]
[/modifications]
[/unit]
[/event]
Coordinates are messed up. You can't trigger a side turn event only on some side's turn. You have to use an [if] to find out the value of $side_number and branch the logic from there.Flametrooper wrote:Code: Select all
[event] name=side turn side_number=7 first_time_only=no [unit] x=12,15 y=13,12
The same of course applies to the other event, too.