|
mordalphus Newbie
Joined: 15 Oct 2007 Posts: 9
|
Posted: Tue Mar 30, 2010 5:48 am
Ok, seriously... whats going on |
Ok, i have this script, should be simple enough... It basically checks for 4 different NPCs in a room, if there are none of them, it proceeds in the next room.
so its #trigger {You do not see that here} {#if {@enemynum >= 5} {#var enemynum 1;@movedir;exa %item(@enemy,@enemynum)};#if {@enemynum < 5} {#add enemynum 1;exa %item(@enemy,@enemynum)}
@enemynum is basically just a default 1
@enemy is a string array farmer|visitor|brother|novice|blank
all it does is examine @enemynum 1 and 2 and moves to the next room, its pissing me off so much, i might just go back to zmud
Can anyone help me? |
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Tue Mar 30, 2010 7:02 am |
Sort of off, I always use () with #IF
In any case. I'm presuming that's what is wrong is that is examine the first two enemy string and then moves to the next room, but it's supposed to check them all?
Pattern: You do not see that here
Code: |
_enemy_num = @_enemy_num + 1
#IF (@_enemy_num <= 5)
{
#send "kill"%item(@enemy, @_enemy_num)
}
{
#send @movedir
_enemy_num = 1
#send "kill"%item(@enemy, @_enemy_num)
}
|
I would have something in battle reset the _enemy_num (perhaps the kill message?) |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Tue Mar 30, 2010 7:15 am |
The correct syntax for #IF is #IF (expression), not #IF {expression}. That was something that never should have been allowed in zMUD, honestly. Also, you cannot, with the new changes, use a variable or a function by itself. It must be preceded with a command such as #SEND. Other than that, your script should work fine otherwise.
Charneus |
|
|
|
|
|
|
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
|
|