Campaign won't start
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.
Re: Campaign won't start
So like this:Ceres wrote:No.
You want anattacker hits
event.
Code: Select all
[event]
name=attacker hits
first_time_only=no
[filter]
id=Sir_Miles
[/filter]
[set_variable]
name=Mlance
add=-2
[/set_variable]
[/event]
Err... where would you put theCeres wrote:You have to modify the unit itself every time it hits, not only the variable.
Code: Select all
increase_damage=$Mlance

Re: Campaign won't start
Move the whole [object] to the event (without the [modifications]).
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
Re: Campaign won't start
Code: Select all
[event]
name=attacker hits
first_time_only=no
[filter]
id=Sir_Miles
[/filter]
[set_variable]
name=Mlance
add=-2
[/set_variable]
[object]
[effect]
apply_to=attack
type=pierce
increase_damage=$Mlance
[/effect]
[/object]
[/event]
Re: Campaign won't start
Basically you don't need a variable at all (unless you want to change the amount the attack value decreases).
Code: Select all
[event]
name=attacker hits
first_time_only=no
[filter]
id=Sir_Miles
[/filter]
[object]
[effect]
apply_to=attack
type=pierce
increase_damage=-2
[/effect]
[/object]
[/event]
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
Re: Campaign won't start
O.K. but I was thinking that the player could like go back to his tent and get another lance ie. that the attack damage goes back to its original level when you go back to your starting position.
Re: Campaign won't start
Then remove this attack and give him a new one (see EffectWML).
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
Re: Campaign won't start
Some thing like this?
Code: Select all
[event]
name=attacker hits
first_time_only=no
[filter]
id=Sir_Miles
[/filter]
[object]
[effect]
apply_to=new_attack
name=lance
description=_"lance"
type=pierce
[specials]
{WEAPON_SPECIAL_CHARGE}
[/specials]
range=melee
damage=$Mlance
number=2
[/effect]
[/object]
[set_variable]
name=Mlance
add=-2
[/set_variable]
[/event]
Re: Campaign won't start
You mixed up both events.
for the attack decreasing.
For the restoring,
(caution: untested)
This
For the restoring,
this.
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
Re: Campaign won't start
Umm, right I tested it and two things came up.
1) When you have a successful attack, a blank text box appears See picture, highlighted in red 2) When you go back to starting position, the lance attack goes loopy See picture, again highlighted in red
1) When you have a successful attack, a blank text box appears See picture, highlighted in red 2) When you go back to starting position, the lance attack goes loopy See picture, again highlighted in red
Last edited by matsjoyce on July 15th, 2011, 2:23 pm, edited 1 time in total.
Re: Campaign won't start
For the first one, add silent=yes to all [object]s.
The second... well, that doesn't look nice. No idea about what caused this.
Delete+Repost:
Ok, then try a workaround:
In the start event, put this after the [store_unit]:
And then replace the whole code in the moveto event (except the filter) with this:
(If there's the possibility that Sir Miles may level up, create a post advance event with exactly the same code as in the start event)
The second... well, that doesn't look nice. No idea about what caused this.
Delete+Repost:
Ok, then try a workaround:
In the start event, put this after the [store_unit]:
Code: Select all
[set_variable]
name=initial_damage
value=$stored_sir_miles.attack[1].damage
[/set_variable]
Code: Select all
[store_unit]
[filter]
id=Sir_Miles
[/filter]
variable=stored_sir_miles
mode=replace
[/store_unit]
[set_variable]
name=stored_sir_miles.attack[1].damage
value=$initial_damage
[/set_variable]
[unstore_unit]
variable=stored_sir_miles
find_vacant=no
[/unstore_unit]
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
Re: Campaign won't start
Right, I was mucking around a bit and I came up with some code I think I'll stick with.
I made some code in which the players lance will randomly snap when they are attacking and then I made an object that will replace the lance. I had one problem though. The lance attack attacks two times, so when the lance snaps on the first charge it attacks again and then seemingly snaps again. Is there any code that will stop the attack the first time it snaps and not let you attack again? 


Re: Campaign won't start
Make an attacker hits event with the right conditions, and then store and unstore Sir Miles. That will stop the attack.
(fyi, [store_unit] , [unstore_unit])
(fyi, [store_unit] , [unstore_unit])
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
Re: Campaign won't start
Thanks, that works fine now. When the lance is snapped on the first attack, the second time he attacks with the sword
.

Re: Campaign won't start
Oh, and another question, would the AI know how to use this?
Re: Campaign won't start
Depends on what you mean by "know how to use". The ai doesn't know that there's the possibility the lance may break when attacking. It will use the lance as always. And if it breaks, ai will have to fight with the sword.
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons