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


Joined: 23 Aug 2013
Posts: 175

PostPosted: Thu Jun 21, 2018 1:11 am   

Help with array functions
 
%arrget(carn1, @stepnum);stepnum = @stepnum + 1;#IF
(@stepnum > %arrhigh(carn1)) {%arrget(carn2,
@stepnum);stepnum=@stepnum +1;#IF (@stepnum >
%arrhigh(carn2)) {stop}}


it pulls from the first portion but uses stepnum's values after first portion being canceled to 0, so doesnt fire forerectly, and uses the last if's 'stop'

how do i write this to first run through the first array carn1, then when at end of array to jump to second array carn2?

thanks in advance
Reply with quote
shalimar
GURU


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

PostPosted: Thu Jun 21, 2018 1:28 am   
 
Can't say i have used those functions myself, however, %functions always return a value, which you aren't saving in this example.
It looks like the value is being sent as a command to the game?
You are also never resetting @stepnum to 0

You are also not using parenthesis to incriment you variable properly:
stepNum=(@stepNum+1)

Though from what I see, you don't even need that variable, you could just as easily do:

#FORALL @cairn1 {%i}
#FORALL @cairn2 {%i}
_________________
Discord: Shalimarwildcat
Reply with quote
chris123zugg
Apprentice


Joined: 23 Aug 2013
Posts: 175

PostPosted: Thu Jun 21, 2018 1:41 pm   
 
ok thanks shalimar.
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