EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > XML Modification Help & Info

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 08-24-2010, 10:04 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default Executing commands with quotes

I've been trying to figure this one out for a while. I've been wanting to make my click to cast buttons support quotes without having to relog, but to no avail.

I'm not really sure where the code interpreter is screwing up though.
Think about this happening during runtime, not in code before the game is excuted, because that's not where the problems happen.

Method 1:
An input field is filled out and saved to a variable:
useability Lucan's Pact
So.... Abilities.cmd1 = useability Lucan's Pact

Now I want to take that command and stick it on a button so it can execute the command. So I make a physical button that when pressed pulls the correct code and puts it in another button and then presses that (so it can run the command). So inside Button1:
Parent.Button2.onpress = Parent.Abilities.cmd1
Parent.Button2.press = true


Press the button in-game, nothing happens.....
Change it to an ability WITHOUT an apostrophe and it works fine.

Method 2:
Okay, lets change the original text to Abilities.cmd1 = Lucan's Pact (so there's no more command in front of it)
And lets changed Button1 to:
useability Parent.Abilities.cmd1


Okay, that works perectly... But why can't method 1 work?!
Where is it failing to execute properly?

It should be reading: Button2.onpress="useability Lucan's Pact" within the game, but it's apparently not

Does anyone have any ideas?
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #2  
Unread 08-24-2010, 10:49 PM
valesai valesai is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Apr 2005
Server: Crushbone
Posts: 174
Default

Oooh that is frustrating. I'm going to have to think on that a minute.
__________________

C R A - B R I G A D E 3 - R A I D L E A D E R - [DoV Kill List] | [App To Join]

EliteUI


Don't forget to add me to your favorite Mod's list!
Reply With Quote
  #3  
Unread 08-25-2010, 04:42 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

Are you sure that Abilities.cmd1 = useability Lucan's Pact does actually get executed like that in your m1? Try to change the command in method 1 to a beginchatinput (or say) to see if that works at all (and if the part after the apostrophe is included).
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
  #4  
Unread 08-25-2010, 04:48 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

That was the other strange part, I actually use the say command to debug a lot, too.

I tried doing a:
say Parent.Abilities.cmd1
And:
say Parent.Button2.onpress
Both wit the same results, showing the full string with the apostrophe.
Drumstixx says, "useability Lucan's Pact"

When the button fails, I get nothing ingame. Usually if the spell is incorrectly typed, it would just say "This ability does not exist" but I don't even get that.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #5  
Unread 08-25-2010, 04:56 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

Yeah but what I meant was try to change the usability to a say and see what happens then. Although you might not see what's happening, might be some encoding issue with the usability code choking on the Apostrophe and the parser not interpreting it right when loaded into a variable along with the command. You could also try to set

var1 = usability
var2 = Lucan's Pact
OnPress = var1 ## var2

and see what happens then.
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.

Last edited by gm9 : 08-25-2010 at 04:59 AM. Reason: added most of the post ;)
Reply With Quote
  #6  
Unread 08-25-2010, 05:08 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

Method 1 is what I currently use in my UI now btw.
I went and tried what you said.

Without an apostrophe it'll do a say command perfectly.

Soon as I add the apostrophe in, I get nothing. No text, no say, and no error/feedback.

I can populate the tooltip just fine with the apostrophe, which boggles me further.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #7  
Unread 08-25-2010, 05:28 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

Just one of the bugs with the parser then, at least I don't have an idea around it (except the other part of my previous post but that's no real solution I guess even if it works).

edit: maybe you could try to add an extraneous single quote at the end of the command ## " &apos;", dunno if that executes then even if it does get parsed correctly (which I don't know either).
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.

Last edited by gm9 : 08-25-2010 at 05:33 AM.
Reply With Quote
  #8  
Unread 08-25-2010, 06:04 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

Yeah, if I change the text from:
useability Lucan's Pact

To:
Lucan's Pact

And then in button 1 just put:
useability Parent.Abilities.cmd1

It works...
But the point of the mod was to have complete control over the commands without having to do things step by step.
It just seems like a parser error to me too

Everything works otherwise, multiple lines, multiple commands. It's just the single apostrophes that kill it. I can wrap things like an exclamation point in single quotes '!' and it works fine.

*edit* Adding a random quote to the end of the Useability command will think it's part of the spell name and spit back the "Ability not found". Though I didn't try it within the code yet, so we'll see. I have my doubts.

And adding a random quote at the end of my normal edit window just makes it show up as:
Drumstixx says, "Lucans Pact"
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>

Last edited by Drumstix42 : 08-25-2010 at 06:10 AM.
Reply With Quote
  #9  
Unread 08-25-2010, 06:14 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

haha, I figured out a solution. But it's gotta be done during runtime in that "editing text" step.

I tried wrapping the single quote in double quotes, but that made a space.
So I tried putting the second double quote at the end of the command and that works fine.

But it also works fine if I just put the quote after the slash command portion.
So the text editing part ultimately becomes:

useability "Lucan's Pact"

And since it's saving that to an element, it doesn't read the double quotes on executed (which would normally break the slash command functionality)

WOOT

This is a better solution than having to relog to fix single quotes!

Nice thing about that is I can just recommend to wrap everything in double quotes and players won't have to worry about special characters like exclamation points and apostrophes in their messages.
say "drum's testing! special# characters?"
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>

Last edited by Drumstix42 : 08-25-2010 at 06:21 AM.
Reply With Quote
  #10  
Unread 08-25-2010, 07:39 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

Quote:
Originally Posted by Drumstix42 View Post
Nice thing about that is I can just recommend to wrap everything in double quotes and players won't have to worry about special characters like exclamation points and apostrophes in their messages.
say "drum's testing! special# characters?"
just tell them to not use double quotes now
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
  #11  
Unread 08-25-2010, 07:46 AM
Landiin Landiin is offline
Slayer of clock cycles
This person is a EQ2Map developer.
Featured
 
Join Date: Nov 2004
Server: Oasis
Posts: 3,464
Default

lol tell them not to use "? People read?
__________________
Landiin's EQ2MAP Updater Discussion Download
Reply With Quote
  #12  
Unread 08-25-2010, 08:07 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

Quote:
Originally Posted by Landiin View Post
lol tell them not to use "? People read?
you got me there
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:52 AM.


Our Network
EQInterface | EQ2Interface | WoWInterface | LoTROInterface | ESOUI | MMOUI