Kalevala : The Iron Age
Moderator: Forum Moderators
- Casual User
- Posts: 475
- Joined: March 11th, 2005, 5:05 pm
Definitely WML-able. Allow me to propose a system.Jgrr wrote:For each scenario, each casualty reduces your morale by a certain number of percentage units dependent on the scenario.
($Moraleeffect/$Morale) would be the chance that morale affect the game. $Moraleeffect starts at 0 while $Morale starts at a certain value that can vary from scenario to scenario.
Code: Select all
[event]
name=die
first_time_only=no
[filter]
side=1
[/filter]
[set_variable]
name=morale
add=1
[/set_variable]
[set_variable]
name=moraleeffect
add=1
[/set_variable]
[/event]
Example:
Let us say $Morale starts at 2 (very morale-important scenario).
After 0 casualties, $Morale=2, $Moraleeffect=0, chance to be effected by morale = 0.
After 1 casualties, $Morale=3, $Moraleeffect=1, chance to be effected by morale = 1/3.
After 2 casualties, $Morale=4, $Moraleeffect=2, chance to be effected by morale = 1/2.
After 3 casualties, $Morale=5, $Moraleeffect=3, chance to be effected by morale = 3/5.
After 4 casualties, $Morale=6, $Moraleeffect=4, chance to be effected by morale = 2/3.
By setting a higher beginning $Moraleeffect, you would make morale less important in a scenario.
The simplest way I can think of is this:Jgrr wrote:This will directly affect the damage dealt by your units.
Code: Select all
[event]
name=attack
first_time_only=no
[filter]
side=1
[/filter]
[set_variable]
name=random
random=0..$Morale
[/set_variable]
[if]
[variable]
name=random
less_than=$Moraleeffect
[/variable]
[then]
[store_unit]
x,y=$x1,$y1
variable=temp
[/store_unit]
[set_variable]
name=temp.status.slowed
value=on
[/set_variable]
[unstore_unit]
variable=temp
[/unstore_unit]
[/then]
[/if]
[/event]
It wouldn't really make sense that this apply to defense as well (also, the unit would actually be slowed down then, while this only affects your battle prowess).
Against slowing units, you should think of a different system.
This is more tricky because returning an unit to the recall list is not easy.Jgrr wrote:After a certain number of casualties, each subsequent casualty will cause a certain percentage of units to desert (return to recall list). Deserted units can be "rallied" back in the battle as normal recalls. Loyal units are not affected by morale and won't desert.
Simply losing an unit would be simple:
Code: Select all
[event]
name=die
first_time_only=no
[filter]
side=1
[/filter]
[if]
[variable]
name=random
less_than=$Moraleeffect
[/variable]
[then]
[set_variable]
name=random
random=0..$Morale
[/set_variable]
[if]
[variable]
name=random
less_than=$Moraleeffect
[/variable]
[then]
[role]
role=deserter
type=(your unit types, from least experienced to most experienced)
[/role]
[message]
role=deserter
message= _ "We'll all die, I'll take my chances alone..."
[/message]
[kill]
role=deserter
[/kill]
[/then]
[/if]
[/then]
[/if]
[/event]
The unit that would desert would be the most experienced of your low-level units. You could make it so some unit types do not desert by taking them off the list (heroes and very high-level units).
What you want to do is a little more complex, as it requires storing the deserters till the scenario's end. It is feasible though.
Well, hope this helps. Let me know if you like the system.
P.S. My WML is a little rusty after three months, so the code will probably need cleaning up
Great pictures so far!
Me and my schedules... this starts to look like a typical software project. The completion of the script (in plaintext) is about 80% now. To still be able to publish something, I've now added some more units to be recruitable to the test scenario. Note the warning: they are not going to stay there, they are there just for the sake of testing.
Me and my schedules... this starts to look like a typical software project. The completion of the script (in plaintext) is about 80% now. To still be able to publish something, I've now added some more units to be recruitable to the test scenario. Note the warning: they are not going to stay there, they are there just for the sake of testing.