|
mitchel456 Newbie
Joined: 05 Mar 2007 Posts: 6
|
Posted: Mon Mar 05, 2007 2:25 am
#tag name |
Okay, this seems like a simple question, but as I am a complete coding ignoramus I've been unable to figure it out, after checking all the tutorials and help files and searching the forums. In Federation II, I can't get the mapper to recognize the room name. I've been able to figure out that #trigger {pattern} {#tag name} is the way to tell the automapper what the room name is, but I can't seem to find out what "pattern" I should be using. The room name is always a short phrase with no punctuation directly beneath the prompt:
Code: |
>l
Landing bay
You are standing in a huge landing bay which is part of the Cargon spaceport complex. The bay looks as though it was built to accommodate one of the fabled State class freight liners, although there are no ships berthed here now.
The exit is north. |
I've worked with triggers and can't seem to get one to work. I tried
Code: |
#trigger {^~>*{cr%}&RoomName} {#tag name} |
hoping that would pick out text right after a carriage return following a prompt (i.e. the name of the room), but no luck, and my knowledge of proper syntax for the codes is so limited that I can't see the problem, or even really where to start. Can anybody help out? Either with this particular problem, or pointing me to somewhere I can learn more about the coding so I can do it myself? Hope that's clear.
Thanks for reading,
Ryan |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Mar 05, 2007 4:11 am |
Multi-state trigger.
#trigger {^[%w%s]$} {#tag name}
#condition {^%s*} {#tag desc}
#condition {^sThe exit is (*).} {#tag exit}
Presumably the game gives you a prompt afterwards, so this would be the next #condition:
#condition {^>} {#tag prompt} {nocr|prompt} |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Mar 05, 2007 7:57 am |
If that doesn't work you can try this. If they BOTH don't work report back.
Code: |
#trigger {^>} {#tag prompt}
#condition {^[%w%s]$} {#tag name}
#condition {^%s*} {#tag descpara}
#trigger {^exit} {#tag exit} |
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
mitchel456 Newbie
Joined: 05 Mar 2007 Posts: 6
|
Posted: Tue Mar 06, 2007 1:43 am |
Thanks for the help, guys. Those got me closer, but still not quite there. Using your triggers, Arminas, the mapper is now picking up the room name (usually), but can't seem to see the exits (also, when I try to move, the mapper creates rooms in random directions (i.e., I enter "west" and the mapper creates a room to the north of my current position). Incidentally the text I gave as an example might not have been the best example -- it had a single exit neatly listed on its own line at the bottom, and most rooms aren't like this, they're usually more like this:
Code: |
>ne
The rock walls of the huge spaceport cavern stop you from going that way.
l
>l
Spaceport
This is the southern part of the spaceport. There are landing bays to the south and the west, while the spaceport itself continues to the north.
n
>n
Spaceport
You are in Cargon City spaceport. The port's transit area is to the east of your present position, and the port continues to the south.
The colony's trading exchange is housed in a building to the northwest, and the spaceport bar is north.
|
In some unusual cases there aren't any exits listed at all. And, by the way, as you can see, Fed II doesn't display a prompt at all until you enter a command. Then it displays directly above the output.
Another weird glitch is that the mapper is giving every room the same description -- of a room in the area, so possibly the room I was in when I first ran the new triggers.
I think I've given up on trying to get it to actually recognize the ways out of the room I'm in. But it seems like it should be possible to at least map where I have in fact moved to -- i.e. the automapper may not "see" that there's a room to the west, but once I actually GO west it should map a room there and realize how I got there. Or is that assuming too much? Anyway, thanks for the help. I'll keep at it -- and of course, any advice is much appreciated.
Ryan |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Mar 09, 2007 6:45 am |
It looks to me like there are 2 key phrases to determining the possible exits. "to the direction" and "is direction.". The best way I can see to handle it is to not rely on the mapper to determine exits and also trick the mapper into imagining a prompt. The way I would do this is by starting with an #ONINPUT trigger to catch the issuance of a direction. Then enable some triggers to handle failed movements and also to capture the correct responses. Then a matter of a fair bit of parsing becomes required to actually handle all of it. A short duration alarm will provide the prompt simulation. Some quick code off the top of my head to demonstrate the concepts. For these to work you will want to reconfigure the mapper so it doesn't attempt to detect descriptions or exits, and may even have to do other tweaking as well.
#CLASS RoomCaptures
#VAR RoomCap {} {}
#VAR RoomExits {} {}
#VAR ExitDir {} {}
#ONINPUT RoomMapping {^{n|e|s|w|ne|nw|se|sw|u|d|l}$} {}
#COND {^>} {#T+ RoomCapTimeOut;#CALL %alarm(RoomCapTimeOut,500);RoomCap=""}
#COND {} {#IF (@RoomCap="") {#TAG name};RoomCap=%concat(@RoomCap,%cr,%line)} {looplines|param=50}
#TRIGGER "RoomCapTimeOut" {*5} {#STATE RoomMapping 0;#T- RoomCapTimeOut;#IF (%numwords(@RoomCap,%cr)=2) {#NODIR} {RoomCap=%remove(%concat(%cr,%word(@RoomCap,2,%cr),%cr),@RoomCap);RoomExits=%subchar(@RoomCap,%concat(%cr,"|"),"");#WHILE (%regex("((?:to the |is )(?:northeast|southeast|northwest|southwest|north|south|east|west|down|up))(?: |\.|,)",@RoomExits,ExitDir)) {RoomExits=%remove(@ExitDir,@RoomExits);#ADDITEM RoomExits {%word(@ExitDir,%numwords(@ExitDir))}};#DELNITEM RoomExits 1;#TAG prompt}} "" {disable|alarm}
#ALIAS onroomcreate {#CALL %roomdesc(,@RoomCap);#FORALL @RoomExits {#IF (%roomlink(,%i)=-1) {#CALL %roomlink(,%i,-2)}}}
#CLASS 0 |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
mitchel456 Newbie
Joined: 05 Mar 2007 Posts: 6
|
Posted: Sun Mar 11, 2007 9:35 pm |
Thanks, Vijilante -- I'll work on that a bit. I definitely appreciate the help -- and if I can't make that work I'll take it as a sign that Fed II was never meant to be automapped =)
|
|
|
|
gensubuser Newbie
Joined: 11 Sep 2006 Posts: 5
|
Posted: Mon Jun 04, 2007 3:38 pm basic mapping |
To me, the directions thing is not incredibly necessary. I would just like to be able to walk-build, which requires 1) recognizing roomnames and descriptions and 2) not moving if the blocked message is shown. I just haven't been able to configure it this way.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Jun 04, 2007 3:46 pm |
All you need to do then is set up a multistate trigger that uses #tag like Matt and Arminas suggested above. The mapper should then start matching your rooms properly. If we had some example rooms we could help you with it.
The way you avoid the mapper trying to detect a move in a certain direction when you failed to move is to create a trigger for the "you didn't move that way" message and use the #nodir command. |
|
|
|
|
|
|
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
|
|