How to guarantee some damage in wesnoth 1.1.2
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.
How to guarantee some damage in wesnoth 1.1.2
Hi!
It is my idea, used it in my modified era with good effects, still - to some extent it reduces influence of random in standard eras. Not satisfactory 4 me.
It is my idea, used it in my modified era with good effects, still - to some extent it reduces influence of random in standard eras. Not satisfactory 4 me.
Code: Select all
#define halfDamageGuaranteed
[event]
name=attacker_misses
first_time_only=no
[store_unit]
[filter]
x=$x2
y=$y2
[/filter]
variable=defender
kill=no
[/store_unit]
# [message]
# speaker=narrator
# caption="attacker_misses"
#message="defender $defender.hitpoints -2
#[x,y] [$defender.x,$defender.y]"
# [/message]
[set_variable]
name=defender.hitpoints
add=-2
[/set_variable]
[if]
[variable]
name=defender.hitpoints
less_than_equal_to=0
[/variable]
[then]
[store_unit]
[filter]
x=$x2
y=$y2
[/filter]
variable=defender
kill=yes
[/store_unit]
[/then]
[/if]
[unstore_unit]
variable=defender
[/unstore_unit]
[clear_variable]
name=defender
[/clear_variable]
[/event]
[event]
name=defender_misses
first_time_only=no
[store_unit]
[filter]
x=$x1
y=$y1
[/filter]
variable=attacker
kill=no
[/store_unit]
# [message]
# speaker=narrator
# caption="defender_misses"
#message="attacker $attacker.hitpoints -2
#[x,y] [$attacker.x,$attacker.y]"
# [/message]
[set_variable]
name=attacker.hitpoints
add=-2
[/set_variable]
[if]
[variable]
name=attacker.hitpoints
less_than_equal_to=0
[/variable]
[then]
[store_unit]
[filter]
x=$x1
y=$y1
[/filter]
variable=attacker
kill=yes
[/store_unit]
[/then]
[/if]
[unstore_unit]
variable=attacker
[/unstore_unit]
[clear_variable]
name=attacker
[/clear_variable]
[/event]
#enddef
Sauron
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803
Thanx for massive feedback [:rotfl:]
Sauron
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803
IIUC, Xan's new additions make it possible to give a unit a specialty that makes it hit 100% or 0%, whichever you prefer:
However, I don't know how the engine will respond to a 100% or a 0% chance to hit...
Now, since we probably CAN give specials to units on the fly, we wouldn't need to create a bunch of duplicate unit types when using this. So it would actually be useful.
Code: Select all
#define WEAPON_SPECIAL_UBERPOWERFUL
[chance_to_hit]
id=uberpowerful
name="" #so that it doesn't display anything indicating that you have such a special
description=""
value=100
cumulative=no
[/chance_to_hit]
#enddef
Now, since we probably CAN give specials to units on the fly, we wouldn't need to create a bunch of duplicate unit types when using this. So it would actually be useful.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
IMHO MUCH MORE is needed system liketurin wrote:IIUC, Xan's new additions make it possible to give a unit a specialty that makes it hit 100% or 0%, whichever you prefer:
However, I don't know how the engine will respond to a 100% or a 0% chance to hit...
Now, since we probably CAN give specials to units on the fly, we wouldn't need to create a bunch of duplicate unit types when using this. So it would actually be useful.
dmg= SUM_i(MinDMG_per_hit(i) + rnd_hits_or_not(i)*additional_dmg_per_hit)==
== n * MinDMG_per_hit+SUM_i(rnd_hits_or_not(i)*additional_dmg_per_hit)
Sauron
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803
You appear to be setting damage to a boolean value. Maybe you should type out the formula in english or define some of your terms?
Also, if you are wondering why there is so little response: "the developers feel that randomness is a large part of the game, and that taking the randomness out of the game would be somewhat akin to taking the randomness out of most card games."
Also, if you are wondering why there is so little response: "the developers feel that randomness is a large part of the game, and that taking the randomness out of the game would be somewhat akin to taking the randomness out of most card games."
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
I think REDUCTION of randomness is solution - ELIMINATION would result in BORING GAMESapient wrote:You appear to be setting damage to a boolean value. Maybe you should type out the formula in english or define some of your terms?
Also, if you are wondering why there is so little response: "the developers feel that randomness is a large part of the game, and that taking the randomness out of the game would be somewhat akin to taking the randomness out of most card games."
Code: Select all
int
attacker_basic_dmg=getBasicDMG(attacker,defenfer,attack_type,daytime,terrain),
attacker_additional_dmg=getAdditionalDMG(attacker,defenfer,attack_type,daytime,terrain),
defender_basic_dmg=getBasicDMG(defenfer,attacker,attack_type,daytime,terrain),
defender_additional_dmg=getAdditionalDMG(defenfer,attacker,attack_type,daytime,terrain);
for(int i=0;i<attacker->getAttacks();i++)
{
defender->health-=attacker_basic_dmg+random_0_or_1(distribution_you_picked)*attacker_additional_dmg;
//conditional defender retaliation and other conditional instructions go here
//...
}
//in case defender still has some retaliations to hit - do it now
Mabye players should have some option of adjusting the split of dmg between basic and additional, as it is with gold, experience an gpv?
Exactly what I mean is
Code: Select all
int
attacker_dmg=getDMG(attacker,defenfer,attack_type,daytime,terrain),
defender_dmg=getDMG(defenfer,attacker,attack_type,daytime,terrain);
for(int i=0;i<attacker->getAttacks();i++)
{
defender->health-=floor(game->split_ratio*attacker_dmg)
+ceil((1-game->split_ratio)*random_0_or_1(distribution_you_picked)*attacker_dmg);
//conditional defender retaliation and other conditional instructions go here
//...
}
//in case defender still has some retaliations to hit - do it now
They would be able to pick deterministic/random and all possibilities in between. I think this would soon prove, what PLAYERS think of randomness. I think this modification is EXTREMELY EASY to implement and I am pretty amused it was not implemented so far taking into consideration the amount of anti-random feedback on forums.
P.S.
Yes, yes, I've read
http://www.wesnoth.org/forum/viewtopic.php?t=1158
Sauron
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803