Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
fasad
Beginner


Joined: 07 Dec 2003
Posts: 16
Location: USA

PostPosted: Sun Dec 07, 2003 11:34 pm   

xyz coords
 
seems no matter how many times try to read the help files
I get confused

how would i put this whole line into a variable

Kashyyyk 2300 -34580 10400

the numbers being @x @y @z coords
theres an extrapolate command
that gives this info about an orbiting planet
and i want to put the planet and its xyz into a single variable when i use the command extrapolate
I also need to beable to set a trigger that sends
course @xyz

heres what happens
F:extrapolate kash
M:You calculate the planets current coordinates
----------------------------------------
|Kashyyyk 2300 -34580 10400|
----------------------------------------

f:calculate kashyyyk 2300 -34580 10100 because i have to be 300 away
M: hyperspace set
f: hyper
Reply with quote
Toetag
Magician


Joined: 10 Oct 2000
Posts: 356
Location: USA

PostPosted: Sun Dec 07, 2003 11:40 pm   
 
Same format as the other question you posted:

#VAR Kashyyyk {Kashyyyk 2300-34580 10400}
Reply with quote
Toetag
Magician


Joined: 10 Oct 2000
Posts: 356
Location: USA

PostPosted: Mon Dec 08, 2003 12:46 am   
 

#VAR x {2300}
#VAR y {34560}
#VAR z {10400}
#var tempZ
#MATH tempZ (z -300)
#VAR kashyyyk {Kashyyyk @x - @y @tmepZ)
Reply with quote
fasad
Beginner


Joined: 07 Dec 2003
Posts: 16
Location: USA

PostPosted: Mon Dec 08, 2003 11:58 pm   
 
M:You calculate the planets current coordinates
----------------------------------------
|Kashyyyk 2300 -34580 10400|
----------------------------------------
the X Y z changes so i need to put capture them into the @x @y @z variables off a trigger from [ You calculate the planets current coordinates]
Reply with quote
fasad
Beginner


Joined: 07 Dec 2003
Posts: 16
Location: USA

PostPosted: Tue Dec 09, 2003 12:04 am   
 
realy i need the triiger to work like this

You calculate the planets current coordinates
----------------------------------------
|Kashyyyk 2300 -34580 10400|
----------------------------------------
^sent from the mud
#trigger {You calculate the planets current coordinates}
capture (@planet) (@x @Y @z)
so i can

calc @planet @x @y @tempz -300
then i have another trigger that will
course @x @y @z

would i use %line1 %line2 %line3?

Thanks again I realy appriciate the help
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Dec 09, 2003 12:28 am   
 
#TRIGGER {You calculate the planets current coordinates} {}
#COND {~|(*) (%n) (%n) (%n)~|} {calc %1 %2 %3 %eval(%4-300);#TEMP AutoCourseSetter {You come out of hyperpace mud output message here} {course %1 %2 %3 %4}}

You could also make a bunch of #MENU choices for your destinations:

#MENU {"Kashyyyk"} {calc Kashyyyk 2300 -34580 10100;#TEMP AutoCourseSetter {You come out of hyperpace mud output message here} {course Kashyyyk 2300 -34580 10400}}
Reply with quote
fasad
Beginner


Joined: 07 Dec 2003
Posts: 16
Location: USA

PostPosted: Tue Dec 09, 2003 5:58 am   
 
hey Ton your thing isn't working
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Dec 09, 2003 6:48 am   
 
Code:

You calculate the planets current coordinates
----------------------------------------
|Kashyyyk 2300 -34580 10400|
----------------------------------------


I'd hazzard your paste isn't right Wink

What is the ip/port?
Reply with quote
fasad
Beginner


Joined: 07 Dec 2003
Posts: 16
Location: USA

PostPosted: Wed Dec 10, 2003 5:07 am   
 
darkwars.wolfpaw.net 4848

perhaps I could
put the @planet @x @y @z
into an alias?

#alias hjump {calc @planet @x @y @tempz}
still the problem is capturing all four variables[:(!]
Reply with quote
Toetag
Magician


Joined: 10 Oct 2000
Posts: 356
Location: USA

PostPosted: Wed Dec 10, 2003 2:37 pm   
 
can you give a few example outputs of the "You calculate the planets current coordinate" lines? So we can see the basic output and see if it's standard throughout?
Reply with quote
Toetag
Magician


Joined: 10 Oct 2000
Posts: 356
Location: USA

PostPosted: Wed Dec 10, 2003 3:02 pm   
 
This will work on it if all the spacing is as above EVERYTIME!

Trigger:
M:You calculate the planets current coordinates$(*)$~|(%w) (%d) -(%d) (%d)~|$(*)$

Value:
#VAR planet %2
#VAR xcord %3
#VAR ycord %4
#var zcord %5
#SHOW Planet: @planet X: @xcord Y: @ycord Z: @zcord


This was tested with 6.66 offline with the pattern:
M:You calculate the planets current coordinates
----------------------------------------
|Kashyyyk 2300 -34580 10400|
----------------------------------------


Resulted in the following text:
Planet: Kashyyyk X: 2300 Y: 34580 Z: 10400


On a side note, is the 2nd coordinate a negative value or is the dash a seperator? if that's a negative and not a dash, change the trigger to:

M:You calculate the planets current coordinates$(*)$~|(%w) (%d) (*) (%d)~|$(*)$

Changing the trigger with the offline testing resulted in the following text:

Planet: Kashyyyk X: 2300 Y: -34580 Z: 10400
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Dec 10, 2003 8:27 pm   
 
Things to keep in mind:
  • This is a formatted output which uses multiple spaces to put the numbers into specific columns. The spaces won't be the same every time

  • The forum doesn't display multiple spaces, but they can be seen by using the Reply with Quote http://www.zuggsoft.com/forum/icon_reply_topic.gif" border="0" /> icon. The original question does include the proper spacing

  • This is a three-axis coordinate system

  • If one coordinate can be negative, then probably any of them can be, so the better choice for numeric wildcards would be %n rather than %d

  • The length of each coordinate can vary from a minimum of four or less (shortest shown is 2300 but no reason to think it couldn't go to one digit) to a maximum of 6 or more (longest is -34580 which is 5 digits plus a sign)

  • Since the length of each coordinate can vary, the number of spaces between them can also be expected to vary, and the pattern should take this into account

  • f: stands for "fasad types this and sends it to the MUD"

  • m: stands for "the MUD sends this back to fasad"

  • Probably neither the f: nor the m: will actually be shown


  • So, here's what's apparently needed:
  • fasad types in a short command (an alias) and the destination

  • The alias sends the extrapolate command

  • The MUD returns the coordinates

  • A trigger gets the coordinates and sends back the calculate command, with the z-coord offset by 300

  • The MUD returns hyperspace set

  • A trigger sends the hyper command


  • Here's the script, paste it into your command line (the main screen, not the settings editor)
    #AL go {#T+ AutoCourse;extrapolate}
    #CLASS AutoCourse disable
    #TR {~|(*) (%n)%s(%n)%s(%n)~|} {calculate %trim( %1) %2 %3 %eval(%4 - 300)}
    #TR {hyperspace set} {#T- AutoCourse;hyper}
    #CLASS 0
    Reply with quote
    fasad
    Beginner


    Joined: 07 Dec 2003
    Posts: 16
    Location: USA

    PostPosted: Thu Dec 11, 2003 2:31 am   
     
    lightbulb,
    this script Works great on Kashyyyk but I can't get it to work on other planets

    heres 3 different extrapolate results

    You calculate the planets current coordinates
    ----------------------------------------
    |wayland 2200 -1560 14040|
    ----------------------------------------

    You calculate the planets current coordinates
    ----------------------------------------
    |Coruscant 1000 -1320 7800 |
    ----------------------------------------

    You calculate the planets current coordinates
    ----------------------------------------
    |Adari 1800 -1560 24960|
    ----------------------------------------


    once I come out of hyper space I'll need to reuse the extrapolated coords to set a course with the exact coords extrapolated without the neg 300
    Reply with quote
    LightBulb
    MASTER


    Joined: 28 Nov 2000
    Posts: 4817
    Location: USA

    PostPosted: Thu Dec 11, 2003 3:21 am   
     
    Using your sample output, I had no problems with Wayland or Adari, but Coruscant didn't work. A quick look to see what was different shows that Coruscant's coordinates finish with space between the final coordinate and the |. The fix is simple -- remove the | at the end of the pattern.

    If you want to reuse the coordinates, you'll need to add variable commands.

    Amended script:
    #AL go {#T+ AutoCourse;extrapolate}
    #CLASS AutoCourse disable
    #TR {~|(*) (%n)%s(%n)%s(%n)} {#VAR AutoCoursePlanet {%1};#VAR AutoCourseX %2;#VAR AutoCourseY %3;#VAR AutoCourseZ %4;calculate %trim( %1) %2 %3 %eval(%4 - 300)}
    #TR {hyperspace set} {#T- AutoCourse;hyper}
    #CLASS 0

    NOTE: There's nothing special about the names I pick for things. Feel free to use your own names for aliases, classes, and triggers. Just make sure you change anything that refers to those names also (the #T+ and #T- commands in this script).
    Reply with quote
    Display posts from previous:   
    Post new topic   Reply to topic     Home » Forums » zMUD 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