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
ToyMage
Apprentice


Joined: 01 Sep 2005
Posts: 120

PostPosted: Tue Jul 09, 2019 1:30 am   

multi sessions & variables
 
hi hi,

i'm normally playing multiple sessions, and i set up triggers in a shared package and variables in separate sessions.

shared
trigger "You wear armor" GotArmor=1
trigger "You remove your armor" GotArmor=0

session 1 - Variable GotArmor
session 2 - Variable GotArmor

it seems the when reading off the variable, it is reading off the wrong session?

how do i prevent this?
Reply with quote
shalimar
GURU


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

PostPosted: Tue Jul 09, 2019 11:23 am   
 
This sounds like a scoping issue.
I presume the setting trying to read is in the shared package?
You need to tell your code which one to look at by offsetting the command to the proper session.

#EXECWINDOW windowname {#SAY what is my @gotArmor}

Something like that might work
_________________
Discord: Shalimarwildcat
Reply with quote
ToyMage
Apprentice


Joined: 01 Sep 2005
Posts: 120

PostPosted: Thu Jul 11, 2019 12:15 am   
 
Hmm.. the trigger is in the shared package, I got the variable "gotarmor" set up in both session.

When I type #SHOW @GotArmor in session 1, it may show 0, but #IF shows and runs as 1 (which is 1 in session 2)
Reply with quote
shalimar
GURU


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

PostPosted: Fri Jul 12, 2019 7:50 pm   
 
Is there a copy of the variable in the shared package that could be getting in the way?
_________________
Discord: Shalimarwildcat
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