Hrm..learnign the ropes, help me out a bit
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.
Hrm..learnign the ropes, help me out a bit
I got a few questions for you scripting wizzards.
1. Will this work:
2. To explain what I'm after here - the map has fog. Once a player unit approaches within viewing distance of a specific hex, two units should be generated - one belonging to the enemy and one belonging to an ally (no leader) so they fight.
If you save the unit it joins you.
And obviously I'll need a different trigger that turn 3.. something like unit_moved if there is one.. Still haven't memorized all commands and macros and stuff
1. Will this work:
Code: Select all
#define TRAIT_DETERMINED
# A DETERMINED unit gets a +1 bonus to damage (melee and ranged), +10% resistance to fire, cold and arcane, but get a max XP increase of 25%.
[trait]
id=agile
male_name= _ "agile"
female_name= _ "female^agile"
[effect]
apply_to=attack
range=ranged
increase_damage=1
[/effect]
[effect]
apply_to=attack
range=melee
increase_damage=1
[/effect]
[effect]
apply_to=max_experience
increase=25%
[/effect]
[effect]
[resistance]
value=10
max_value=100
apply_to=fire,cold,arcane
[/resistance]
[/effect]
[/trait]
#enddef
2. To explain what I'm after here - the map has fog. Once a player unit approaches within viewing distance of a specific hex, two units should be generated - one belonging to the enemy and one belonging to an ally (no leader) so they fight.
If you save the unit it joins you.
And obviously I'll need a different trigger that turn 3.. something like unit_moved if there is one.. Still haven't memorized all commands and macros and stuff
Code: Select all
[event]
name= turn3
[store_locations]
[filter]
side=1
[/filter]
x=24
y=50
range=8
variable=units_in_range
[/store_locations]
[if]
[variable]
name=units_in_range.length
greater=0
[/variable]
[then]
#create units code goes here
[/then]
[/if]
[/event]
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
Re: Hrm..learnign the ropes, help me out a bit
The first one looks alright, as to the second one: Use the moveto event and filter for the locations that are in view of the particular units. If you don't want the event to trigger before turn 3, you can also use nested events.
Re: Hrm..learnign the ropes, help me out a bit
moveto requires a X and Y coordinate IIRC.
I can use complex conditions within a filter? Hrm..I'm a bit slow today...soo
Is that it? Can I use range within a filter like that, or is there a better way to check if the hex is in the visual radius of a unit?
I can use complex conditions within a filter? Hrm..I'm a bit slow today...soo
Code: Select all
[event]
name= moveto
[filter]
side=1
x=24
y=50
range=8
[/filter]
[/event]
Last edited by TrashMan on December 22nd, 2008, 9:28 pm, edited 1 time in total.
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
Re: Hrm..learnign the ropes, help me out a bit
About the first one, take a better look at [effect], you can't just throw [resistance] in like that.
Re: Hrm..learnign the ropes, help me out a bit
AI wrote:About the first one, take a better look at [effect], you can't just throw [resistance] in like that.
???? now I'm confused...# resistance: Sets percent damage taken from combat
* replace: If set to "true", any new values replace the old ones. Otherwise, new values are added to old values (negative values allowed).
* [resistance]: a subtag that describes the new resistance just like in UnitWML for describing a unit type
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
Re: Hrm..learnign the ropes, help me out a bit
The contents of your [resistance] are wrong.
Also you're still insisting on using a key called range= which doesn't exist.
Also you're still insisting on using a key called range= which doesn't exist.
Re: Hrm..learnign the ropes, help me out a bit
I could swear I saw it inside one of Northern Rebiths scenarios.
Radius then?
Thanks for telling me what's wrong..
Now could one of you gents show me the right way to do it?
Radius then?
Thanks for telling me what's wrong..
Now could one of you gents show me the right way to do it?
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
Re: Hrm..learnign the ropes, help me out a bit
In order to use radius, you need a standard location filter, i.e. [filter_location] (i think you put it inside [filter], atleast that's what the wiki says, but I'm not sure)
The easiest approach is to use x,y ranges in the unit filter, e.g. x=20-28;y=45-55
Note that, in order for the unit to take less damage, you need to apply negative values, since [resistance] describes the amount of damage taken, see UnitsWML.
The easiest approach is to use x,y ranges in the unit filter, e.g. x=20-28;y=45-55
Read what UnitWML says about the [resistance] tag, it's rather something like# resistance: Sets percent damage taken from combat
* replace: If set to "true", any new values replace the old ones. Otherwise, new values are added to old values (negative values allowed).
* [resistance]: a subtag that describes the new resistance just like in UnitWML for describing a unit type
Code: Select all
apply_to=resistance
replace=false
[resistance]
fire=-10
cold=-10
[/resistance]
Re: Hrm..learnign the ropes, help me out a bit
Thank you very much.
I wish the sighted event worked with hexes, and not only units - it would be simpler.
But I think I got it. Sight range in fog is..what? 8 hexes?
So, I'd be basicely checking if a unit moved into any hex withing 8 range of the X,Y coordiantes of my hex.
so, if the hex is 26, 42 I should basecly jsut use a simple event like this:
I wish the sighted event worked with hexes, and not only units - it would be simpler.
But I think I got it. Sight range in fog is..what? 8 hexes?
So, I'd be basicely checking if a unit moved into any hex withing 8 range of the X,Y coordiantes of my hex.
so, if the hex is 26, 42 I should basecly jsut use a simple event like this:
Code: Select all
[event]
name=moveto
[filter]
side=1
x=18-34
y=34-50
[/filter]
#spawn units
[event
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
Re: Hrm..learnign the ropes, help me out a bit
The sight is the unit's movement, so you should usually go for around 6 hexes.
Re: Hrm..learnign the ropes, help me out a bit
Thank you very much...now that that's over with..MORE questions
Would something like this work?
This doesn't do double damage to undead..yet (if at all. Can healing be used with a negative value anyway?)
I suppose for it to do that I'd have to add another heal event with a filter that screens for undead. (by looking for undead ability? or should I just list undead units?)
Would something like this work?
Code: Select all
#define ABILITY_RETRIBUTION_AURA
[heals]
value=2
id=healing
affect_allies=no
affect_self=no
affect_enemies=yes
name= _ "Holy Aura"
description= _ "bruning aura:
enemy units nearby recive damage each turn. Double damage against undead"
[affect_adjacent]
adjacent=n,ne,se,s,sw,nw
[/affect_adjacent]
[/heals]
#enddef
I suppose for it to do that I'd have to add another heal event with a filter that screens for undead. (by looking for undead ability? or should I just list undead units?)
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
Re: Hrm..learnign the ropes, help me out a bit
Negative healing works fine, you'll have to actually use a negative number though.
You can add another instance that filters on undead in [affect_adjacent], be sure to use a different id though, otherwise it won't stack.
You can add another instance that filters on undead in [affect_adjacent], be sure to use a different id though, otherwise it won't stack.
Re: Hrm..learnign the ropes, help me out a bit
Ahh...so in this case the id is arbitary..I started confusing it with name of events..lol
just one question AI - how would you filter for undead?
Am I right to assume this would be it:
Is there a simpler way to filter for undead. And, does another [heal] effect need another description??
just one question AI - how would you filter for undead?
Am I right to assume this would be it:
Code: Select all
[heals]
value=2
id=undeadsmiting
affect_allies=no
affect_self=no
affect_enemies=yes
name= _ "Holy Aura"
description= _ "bruning aura:
enemy units nearby recive damage each turn. Double damage against undead"
[affect_adjacent]
adjacent=n,ne,se,s,sw,nw
[filter]
type=Skeleton Archer,Soulless, (and others)
[/filter]
[/affect_adjacent]
[/heals]
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<
Re: Hrm..learnign the ropes, help me out a bit
race=undead should work
Re: Hrm..learnign the ropes, help me out a bit
F'course..such a simple solution...I should have guessed. Thanks again
Oh, can I remove the double name and description lines? They are optional, right?
Oh, can I remove the double name and description lines? They are optional, right?
Light travels much faster than sound, that's why some people seem bright until you hear them speak.
>>> MY LITTLE LAB! <<<
>>> MY LITTLE LAB! <<<