![](templates/Classic/images/spacer.gif) |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Nov 05, 2009 5:15 am
Windowname:command and aliases in MXP send tags |
If I want to send a game command, ie, aardwolf's recall, to the main game window, I can use windowname:command. This doesn't work for commands (ie, #RECALL) or when I want to execute an alias in a different window than the one containing the clickable link. How do I execute commands and aliases as part of the send tag execution?
|
|
_________________ EDIT: I didn't like my old signature |
|
|
![](templates/Classic/images/spacer.gif) |
charneus Wizard
![](images/avatars/51564989746d852114da6d.jpg)
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Thu Nov 05, 2009 2:04 pm |
The : notation has actually been enhanced with the #EXECWIN command. Try using that instead of :.
Syntax would be:
#EXECWIN Window {commands here}
Charneus |
|
|
![](templates/Classic/images/spacer.gif) |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Nov 05, 2009 8:11 pm |
Ok, consider this one abandoned. I tried this with my recall alias, and while the recall game command goes off properly there's nothing I can do to make CMud execute the #RECALL command so that the location gets updated when the game moves me. The other half, my runto alias, works fine if it doesn't have any arguments and while that's pretty useless it does execute properly; if I pass arguments to it, it gets treated like #RECALL.
I suppose it's just a scoping issue, but it's getting ridiculous trying to jump through that hoop. |
|
_________________ EDIT: I didn't like my old signature |
|
|
![](templates/Classic/images/spacer.gif) |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Nov 06, 2009 12:25 am |
What version is this, Matt?
|
|
|
![](templates/Classic/images/spacer.gif) |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Nov 06, 2009 3:38 am |
I'm in 3.10, but I figured it wasn't exactly a beta issue (ie, a basic thing that we are supposed to go asking in the General forums about). If it is, I guess I'll go move it.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
![](templates/Classic/images/spacer.gif) |
Zugg MASTER
![](images/avatars/164475849040f41c23b22fe.gif)
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Nov 06, 2009 5:16 pm |
Matt: It's possible that the 3.x mapper does not handle scoping for the map window (since that was never an issue in the past when there could only be a single global map window).
All the #RECALL command does is set the location marker for the map. You can try the #TELEPORT command to update the map position, or try the #LOC command to just change the value of the currently tracked location. |
|
|
![](templates/Classic/images/spacer.gif) |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Nov 06, 2009 7:58 pm |
That explains the runto alias not working when passing an argument, but working when no argument is present. #WALK is no doubt on the same plane as #RECALL and therefore will suffer the same problem, and if #EXECWIN can't affect scoping behavior so that #WALK works then it's a pointless exercise trying to get recall working. Even if got recall working, there's no similar bypass for #WALK.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
![](templates/Classic/images/spacer.gif) |
Zugg MASTER
![](images/avatars/164475849040f41c23b22fe.gif)
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Nov 09, 2009 5:51 pm |
You might try moving the Location Object into a Shared Module.
The #LOC command determines which map location is used for scripting within a specific window. So if you have a shared Location (called "MyLoc") and then did
#LOC MyLoc
in your secondary window to set this as your current scripting location, then #WALK, etc should all work.
I'll look into making this work properly with #EXECWIN if I can. I'm not actually sure why it's not properly using the location object in the window you are specifying for EXECWIN in the first place.
Maybe you can move this to the Beta Forum and then give me some XML for some test scripts for this. |
|
|
![](templates/Classic/images/spacer.gif) |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Nov 10, 2009 1:17 am |
Ok, I'll move the post and try moving the location object. And then I'll try to redo the link part (first as it was when I posted so I can give you that too, and then with the moved location).
EDIT: moving the location object doesn't produce any change in behavior of the issue described. #RECALL still doesn't get processed, and the area name use of the RUNTO alias (that is supposed to execute a #WALK) still doesn't do anything.
As for the XML, here goes.
Aardmap package file: http://symphaena.com/AardMap.pkg (runto alias, area datarecords, recall alias, everything else related to map scripting)
Aardwolf map file: http://symphaena.com/Aardwolf.mdb (mapfile with vnums used in the AardMap.pkg scripts)
Quests package file: http://symphaena.com/Quests.pkg (the quest tracking system with the send link problem)
The RUNTO alias (usage: RUNTO the full name of any area in aardwolf, as given by Aardwolf (ie, "the aylorian academy" instead of "aylorian academy")). It handles misspellings (tells you it's not a valid area in aardwolf) and lack of arguments (tells you that you need to supply an area name). It does not handle shortnames, and at the moment there is nothing in the package for handling entrance to vidblain (that project's not completed, and is giving me fits with regards to timing issues).
Code: |
<alias name="Runto" autoappend="true" id="645">
<value>$area = %replace(%params(1)," ","_")
#switch ($area = "") {#say %concat(%cr,%ansi(yellow),"RUNTO: There are too many areas in Aardwolf to list, you need to specify which one to go to!",%ansi(default))}
(%defined($area)) {
//extract the area exits
$entrance = %db(@{$area},entrance)
#if (%numitems($entrance) > 1) {$entrance = %item($entrance,%random(1,%numitems($entrance)))}
//go to the area
#if ($entrance) {
#if ($area = "vidblain, the ever dark") {}
#walk $entrance
} {#say %concat(%cr,%ansi(yellow),"RUNTO: Travel aborted! ",%ansi(brown),%replace($area,"_"," "),%ansi(yellow)," has not been visited before.",%ansi(default))}
}
(1) {#say %concat(%cr,%ansi(yellow),"RUNTO: ",%ansi(brown),%replace($area,"_"," "),%ansi(yellow)," is not a valid area!",%ansi(default))}</value>
</alias>
|
An example of the area datarecords that RUNTO references (with the possible exception of some of the higher-level places with duplicate area names, there's one for each area). Some areas (like Cloud City of Gnomalin), have multiple entrances, which is demonstrated by the stringlist of vnums contained in the Entrances field. RUNTO simply picks one at random, so I don't really have to care about the specific spot to go.
Code: |
<var name="Cloud_City_of_Gnomalin" type="Record" id="692">type|min_level|max_level|lock_level|has_aq|has_portal|portal_name|continent|has_goal|contains|portal_entrance|entrance="2682|2683|2684"</var>
|
|
|
_________________ EDIT: I didn't like my old signature |
|
|
![](templates/Classic/images/spacer.gif) |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Dec 12, 2009 8:37 am |
Code: |
<trigger type="Command Input" priority="3450" id="345">
<pattern>^runto{ |}(*)$</pattern>
<value>#if (%1 != "") {
$zone = %find(%replace(%1,"+","'"),all,name)
#if (%numitems($zone) > 1) {
#print $zone contains more than one area
} {
$zone = %dbget($zone)
#print %concat(%ansi(red,bold),"MAP (runto):",%ansi(yellow),"Commencing speedwalk to ",%ansi(brown),$zone.name,%ansi(yellow),".")
#walk %item($zone.entrance_vnums,%random(1,%numitems($zone.entrance_vnums)))
}
} {
#print %concat(%ansi(red,bold),"MAP (runto):",%ansi(yellow),"You did not specify an area to travel to!")
}</value>
</trigger>
|
More info, I think.
1)oninput triggers don't have the original problem with #EXECWIN from a child window returning null values for #WALK vnum
a)the oninput trigger I use to handle the Aardwolf recall command works perfectly, the mapper is aware of and acts upon the #recall command when used in an oninput trigger.
b)the oninput trigger used to handle the Aardwolf runto command, it executes everything in the trigger but the mapper is not updating the location. ![Question](images/smiles/icon_question.gif) |
|
_________________ EDIT: I didn't like my old signature |
|
|
![](templates/Classic/images/spacer.gif) |
|
|
|
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
|
|