restricting movement into village (to full mv cost)

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

Post Reply
User avatar
Gwledig
Posts: 569
Joined: March 30th, 2009, 5:10 pm
Location: UK

restricting movement into village (to full mv cost)

Post by Gwledig »

Hi the unit below can travel on land (flat) with 1 mv cost, but on trying to enter a vila I want the cost to be the full mv of the unit, so it takes their whole movement that turn, this is the "docking" idea in conquest, the new unit is land based, old conquest transports were just boats. I have set the movement cost of village=10 and a variable to try to impose this later down the wml, but can't seem to force the cost of entering villages to be 10, it seems stuck at 1 due to the flat movement cost, any ideas?

Code: Select all

[option]
message=_ "&"+"scenery/mausoleum01.png~RC(magenta>silver)~PAL(255,138,132 > 192,192,192)~SCALE(90,90)"+"="+"Eldor Pher'Na  - 4 Gold
Missiles: can deploy long range missiles with total accuracy
Transport : Can transport a land unit
HP: 78
13-5 Damage
10 Movement"
[command]
[if]
[variable]
name=gold
greater_than_equal_to=4
[/variable]
[then]
[gold]
amount=-4
side=$side_number
[/gold]

[unit]
[modifications]
{TRAIT_TRANSPORT_TANK}
[/modifications]

overlays="scenery/mausoleum01.png~RC(magenta>silver)~PAL(255,138,132 > 192,192,192)~SCALE(90,90)"
unrenamable=yes

zoc=yes
level=2
description=A Eldor citizen

type=Fog Clearer
#id=wagon
name=Eldor Pher'Na
side=$side_number
x=$x1
y=$y1
random_traits=no
upkeep=loyal
race=mechanical
flies=false
[/unit]
[object]
silent=yes
[filter]
x=$x1
y=$y1
[/filter]
[effect]
apply_to=remove_attacks
range=ranged
[/effect]
[effect]
apply_to=remove_attacks
range=melee
[/effect]
[effect]
apply_to=new_attack
range=melee
type=blade
description="blade"
icon="attacks/dagger-human.png"
damage=13
number=5
remove_Specials=backstab
remove_specials=berserk
remove_specials=charge
remove_specials=drain
remove_specials=firststrike
remove_specials=magical
remove_specials=marksman
remove_specials=plague
remove_specials=poison
remove_specials=slow
remove_specials=petrify
remove_specials=swarm

[/effect]
[effect]
apply_to=attack
[set_specials]
mode=append
{WEAPON_SPECIAL_BERSERK}
[/set_specials]
[/effect]
[effect]
apply_to=remove_ability
[abilities]
{ABILITY_EXTRA_HEAL}
{ABILITY_AMBUSH}
{ABILITY_CURES}
{ABILITY_HEALS}
{ABILITY_ILLUMINATES}
{ABILITY_LEADERSHIP_LEVEL_1}
{ABILITY_LEADERSHIP_LEVEL_2}
{ABILITY_LEADERSHIP_LEVEL_3}
{ABILITY_LEADERSHIP_LEVEL_4}
{ABILITY_LEADERSHIP_LEVEL_5}
{ABILITY_NIGHTSTALK}
{ABILITY_REGENERATES}
{ABILITY_SKIRMISHER}
{ABILITY_STEADFAST}
{ABILITY_SUBMERGE}
{ABILITY_TELEPORT}
[/abilities]
[/effect]
[effect]
apply_to=new_ability
[abilities]
{ABILITY_MISSILE}
[/abilities]
[/effect]
[effect]
apply_to=hitpoints
set_total=78
set=78
[/effect]
[effect]
apply_to=movement
set=10
[/effect]
[effect]
apply_to=resistance
replace=true
[resistance]
blade=100
[/resistance]
[/effect]
[effect]
apply_to=movement_costs
replace=yes
[movement_costs]
deep_water=100
shallow_water=4
reef=3
swamp_water=4
flat=1
sand=1
forest=3
hills=2
mountains=100
village=10
castle=1
ruin=1
cave=4
frozen=1
unwalkable=100
impassable=100
fungus=4
[/movement_costs]
[/effect]
[effect]
apply_to=defense
replace=yes
[defense]
shallow_water=80
reef=70
swamp_water=80
flat=60
sand=50
swamp=80
forest=70
hills=60
village=60
castle=60
cave=80
frozen=80
fungus=80
[/defense]
[/effect]



[effect]
apply_to=movement_costs
replace=yes
[movement_costs]
sand=1
frozen=1
[/movement_costs]
[/effect]
[effect]
apply_to=defense
replace=yes
[defense]
sand=50
frozen=60
[/defense]
[/effect]
[/object]
[store_unit]
[filter]
x=$x1
y=$y1
[/filter]
kill=yes
variable=tempstore
[/store_unit]

{VARIABLE tempstore.moves 1}
{VARIABLE tempstore.movement_costs.village 10}
{VARIABLE tempstore.defense.village 60}
{VARIABLE tempstore.alignment neutral}
{VARIABLE tempstore.max_experience 1000}
[unstore_unit]
variable=tempstore
[/unstore_unit]
{CLEAR_VARIABLE tempstore}
[/then]
[else]
[message]
side_for=$side_number
message=_ "Insufficient Funds"
speaker=narrator
[/message]
[/else]
[/if]
[/command]
[/option]
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: restricting movement into village (to full mv cost)

Post by zookeeper »

You can probably use village=-10 instead of village=10 to allow a minimum of 10 movement on any village.

EDIT: Nevermind, doesn't seem to work.
User avatar
tekelili
Posts: 1039
Joined: August 19th, 2009, 9:28 pm

Re: restricting movement into village (to full mv cost)

Post by tekelili »

I guess you can always write a variable into those units and use it as filter in a moveto event wich reduces movement to zero.

Edit: Maybe I understood bad your idea: If you want a 10mp unit be unable to enter village once he has already moved 1 hex, then you need "harder" solutions. One would be create a custom terrain type and use it as base for villages overlays. Other solution (a little dirty) would be use the moveto event to send unit back to hex from wich entered village and restore 1mp (for player it woild look like his unit rebound against an invisible forcefield surronding village)
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
Post Reply