 |
metalsteig Newbie
Joined: 23 Dec 2009 Posts: 3
|
Posted: Wed Dec 23, 2009 2:54 am
beating the maze |
HI!
I need help on how to make a script that will walk me through a maze.
The room names and exits are all identical ( Void [exits: north, south, east and west] )
the problem is that the rooms has a 25% chance of changing direction every 30sec which makes it very hard to navigate through (note that its 25-30 rooms I have to navigate through).
the rooms are marked with gold or a rift, there are 4rifts in the maze with "A multicolored rift" being the starting position and "A white rift" being the goal ( the rest of the rooms are as follow: A single golden coin, 2 gold coins., 3-4 gold coins., A red rift, 5-8 gold coins., A green rift,9-22 gold coins., and finnaly A green rift )
please help. |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Dec 23, 2009 3:30 am |
1)can you describe the direction change more specifically? For example, do the exits only change among specific rooms (think along the lines of a revolving door) or can they connect to any of the 24-29 other rooms?
2)do you have an ability to peer into other rooms?
3)are the rooms positioned relative to each other? For example, if we're in a room with 9 coins and moved to a room with 22 coins does that mean we moved closer to the target?
4)are the rifts/coins permanent? For example, do they fade away or can people pick up the coins?
The simplest thing is to make a multistate trigger that matches your room info and whatever item you want to key on, and if the item is not "A white rift" to pick a random direction to move. To make it smarter, however, you'll have to figure out more rules of the maze (it's not always possible, however).
Code: |
#trigger {Void ~[exits: north, south, east and west~]} {}
#condition {({A single golden coin|A %w rift|%d gold coins}).} {
#if (%1 != "A white rift") {#send %item("north|south|east|west",%random(1,4))} {command to leave maze}
}
|
|
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
metalsteig Newbie
Joined: 23 Dec 2009 Posts: 3
|
Posted: Wed Dec 23, 2009 2:27 pm |
all rooms in the maze has a 25% chance of changing direction every 30sec-1min and the rooms is only connected to 2rooms, - 1that will take me closer to the white rift and 1 that will take me to a random room below the # I were in.
I forgot a realy important thing about the maze,- only 1 direction in each room will take me to next room. the other direction will either do nothing or send me back to a random room below the room I was in before (say that I'm in room with 11coins and walk east which in this case is the wrong direction so, instead of getting to the room with 12coins I'll end up in the room w/ either A multicolored rift, 1-10coins or A red rift.)
I do not have an ability.
the coins are permanent |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Dec 23, 2009 8:46 pm |
Code: |
#variable ItemsInMaze {A multicolored rift|...|A white rift}
#trigger {Void ~[exits: ([%s,northsueawd])~]} {}
#condition {({@ItemsInMaze}).} {
//have I been here before?
#if (%db(@CorrectPath,%1)) {
//yes, I have, continue moving
$direction = %db(@CorrectPath,%1)
} {
//nope, record direction then pick a new direction to move
#addkey CorrectPath {%1} @lastroom.dir
$direction = %item(%replace(%replace(%t1,", ","|")," and ","|"),%random(1,2))
}
//record movement
Lastroom.item = %1
Lastroom.dir = $direction
//do movement
#send $direction
}
#alarm {-30} {
#forall @ItemsInMaze {
#addkey CorrectPath {%i} ""
}
}
|
The above is not tested at all. |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
|
|
|
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
|
|