|
jackwest Novice
Joined: 01 Jan 2009 Posts: 35
|
Posted: Sat Jan 10, 2009 8:31 pm
help with a simple variable assignment |
so i trigger on
Code: |
Spell: '&spell_name'&spell_desription for &%dspell_duration hours |
and then execute
Code: |
#if (%class(/spells/@spell_name)= 1) {#var spell_timer @spell_duration /spells/@spell_name} {#class /spells/@spell_namel 1 {disable};#var spell_timer @spell_duration /spells/@spell_name} |
so if the %class is true then it should create a variable spell_timer in the relevant #class, however it's not. i've tested the #if statement and it's working, so I think something is wrong with
Code: |
#var spell_timer @spell_duration /spells/@spell_name |
and i've tried every syntax variation i can think of.
i'm doing it this way because it seems like i cant seem to designate class in the actual triggering statement, ie
Code: |
Spell: &/spells/spell_name'&desription for &%dspell_duration hours |
doesnt seem to work
jack. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Sat Jan 10, 2009 8:43 pm |
#VAR spell_timer {@spell_duration} _nodef {spells}
so long as the variable already exists, there is no need for the full form definition (unless you have multiples instances of the #VAR in different classes), it will just reassign the value
so make the variable, then the original simplified trigger should work |
|
_________________ Discord: Shalimarwildcat |
|
|
|
jackwest Novice
Joined: 01 Jan 2009 Posts: 35
|
Posted: Sat Jan 10, 2009 8:49 pm |
i'm trying to create the variable off a triggered event, so i need to define the class where i'm putting it. in fact it's looped, and i create 20ish variables, each in their own class...
however you showed me where my syntax was bad...
Code: |
#VAR spell_timer {@spell_duration} _nodef {/spells/@spell_name} |
worked, thanks heaps.
Jack |
|
|
|
|
|