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
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Mon Jun 09, 2003 9:20 pm   

Auto Dragging
 
In my mud you can drag someone but everytime you must type something like "drag betsy south". I want to make a trigger that will turn its state on when I type drag betsy. It will save betsy into a varible called DragName. Then from then on when i go in a direction N|S|E|W|North|South|East|West|Go door|Out|Go bridge it will automatically parse to drag betsy north, etc.

I have it layed out what I need for it to do just don't have a clue yet how to do it. Also, is there anyway to make this work with the numpad movement. The only thing I can come up with is when I type drag betsy, the name goes to variable. Then it turns the state of the drag trigger on. While it is on it will check for me to type N|S|E|W|North|South|East|West|Go door|Out|Go bridge
and when it finds it will change it to drag betsy N, etc. When I type drag stop then it will flip the trigger to the off state and dragging will stop.

I am thinking this is pretty simple but it has been so long since I have actually used ZMud coding and I know my code might not be very fast if I attempt it. Please let me know. Thank you
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Mon Jun 09, 2003 9:33 pm   
 
would this work....

I will have a trigger that will detect when I type drag name

#TRIGGER {drag %w} {<CHANGE THE STATE OF THE DRAG TRIGGER TO ON. NOT SURE HOW TO DO THIS I FORGET>}

When the state is on it just does this...
#TRIGGER {({N|S|E|W|North|South|East|West|Go bridge|Go door|OUT})} {Drag @DragName %1}
#TRIGGER {Drag off} {<TURN STATE BACK TO OFF>}


Is my thinking right on this
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Mon Jun 09, 2003 9:33 pm   
 
would this work....

I will have a trigger that will detect when I type drag name

#TRIGGER {drag %w} {<CHANGE THE STATE OF THE DRAG TRIGGER TO ON. NOT SURE HOW TO DO THIS I FORGET>}

When the state is on it just does this...
#TRIGGER {({N|S|E|W|North|South|East|West|Go bridge|Go door|OUT})} {Drag @DragName %1}
#TRIGGER {Drag off} {<TURN STATE BACK TO OFF>}


Is my thinking right on this
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Mon Jun 09, 2003 9:33 pm   
 
Sorry about the double post. My computer hates me
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Jun 10, 2003 12:22 am   
 
Are drag (character) and drag stop MUD commands or something local to you (ie, an alias)? If it's the former, you can just trigger on those commands or the text they likely generate. This trigger will set a variable = 1 (to start dragging) and 0 (to stop dragging. You can then modify the existing keypad directions to check this variable. If true (1), it does the drag command in that direction; if false (0), it just sends the direction.

EDIT: if it's an alias or something on your side, you'll have to set the variables there.

li'l shmoe of Dragon's Gate MUD
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Tue Jun 10, 2003 12:24 am   
 
Its not a real command. Just something I was going to send to it. Drag <name> <direction> is in the game thuogh
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Jun 10, 2003 12:52 am   
 
quote:

Its not a real command. Just something I was going to send to it. Drag <name> <direction> is in the game thuogh



The principle would be the same:

#alias drag {#if (!%null(%1)) {#if (%ismember(%1,"start|stop")) {#noop this is an alias option;#case %ismember(%1,"start|stop") {Drag.state = 1} {Drag.state = 0}} {#noop this is the target to drag;Drag.target = %1;Drag.state = 1}} {#mess "Uhh, dude, you want me to drag nothing?"}

That alias will turn on dragging if you specify a target, after which you are free to use drag stop to pause dragging and drag start to resume. It does not make you do the drag action, though.

Here's an example of the macros (may need to remove the curly braces from around the key value (ie, KEY7)):

#KEY {KEY7} {#if (@Drag.state) {~drag @Drag.target nw} {nw}}

li'l shmoe of Dragon's Gate MUD
Reply with quote
galldron
Novice


Joined: 08 Nov 2002
Posts: 34
Location: Elanthia

PostPosted: Fri Jun 13, 2003 4:22 am   
 
If anyone happens to get this fully functional I would be grateful to see it in the finished scripts forum

My typing skills are second lowest only to my coding skills!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Jun 13, 2003 5:08 am   
 
i play a mus with similar dragging issues.... my solution was to rewrite the the default movement buttons to be '@style n' for example.. then all i have to do is type in
style = drag person
and i automatically drag with the keypad, you still have to manually drag through non standard exits

Shalimar

AIM: shalimarwildcat
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Fri Jun 13, 2003 5:03 pm   
 
Question about this. I have been working on it at home and I think I almost got it but how do i detect something I type in and not received from the mud?
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Fri Jun 13, 2003 5:52 pm   
 
This may not be the briefest way, but it certainly works well:
quote:

#CLASS {Drag}
#ALIAS d {drag @DragName down}
#ALIAS down {drag @DragName down}
#ALIAS e {drag @DragName e}
#ALIAS n {drag @DragName n}
#ALIAS ne {drag @DragName ne}
#ALIAS nw {drag @DragName nw}
#ALIAS o {drag @DragName out}
#ALIAS out {drag @DragName out}
#ALIAS s {drag @DragName s}
#ALIAS se {drag @DragName se}
#ALIAS sw {drag @DragName sw}
#ALIAS u {drag @DragName up}
#ALIAS up {drag @DragName up}
#ALIAS w {drag @DragName w}
#ALIAS go {drag @DragName %-1}
#ALIAS g {drag @DragName %-1}
#ALIAS climb {drag @DragName %-1}
#CLASS 0
#ALIAS DragIt {#IF (@DragName="") {#VAR DragName %1;#T+ Drag;} {#VAR DragName "";#T- Drag}}



Type "dragit betsy" and move around normally. Type "dragit" to stop dragging.
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Fri Jun 13, 2003 6:25 pm   
 
Using what you told me I came up with this and it works great...


This is the starting trigger
#TRIGGER {drag on (%w)} {dragname = %1 #T+ dragging}

This is the stopping trigger
#TRIGGER {drag off} {#T- dragging}

This is the class
#CLASS {dragging}
#ALIAS d {drag @dragname down}
#ALIAS down {drag @dragname down}
#ALIAS e {drag @dragname e}
#ALIAS n {drag @dragname n}
#ALIAS ne {drag @dragname ne}
#ALIAS nw {drag @dragname nw}
#ALIAS o {drag @dragname out}
#ALIAS out {drag @dragname out}
#ALIAS s {drag @dragname s}
#ALIAS se {drag @dragname se}
#ALIAS sw {drag @dragname sw}
#ALIAS u {drag @dragname up}
#ALIAS up {drag @dragname up}
#ALIAS w {drag @dragname w}
#CLASS 0
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