Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
jackwest
Novice


Joined: 01 Jan 2009
Posts: 35

PostPosted: 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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
jackwest
Novice


Joined: 01 Jan 2009
Posts: 35

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net