EQ2Interface.com
Search Downloads


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

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 08-04-2010, 10:41 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default Possible to reference Objects with spaces in name?

Has anyone found a way to reference an object that has a space in the name?

I'm trying to work out a project using Item names, but with all of the spaces, I'm finding it impossible to reference them in any manner.
Am I screwed?

Solved below
in reply #4
__________________
"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-04-2010 at 11:56 AM.
Reply With Quote
  #2  
Unread 08-04-2010, 11:10 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

If you can reference it on the lhs you can use quotes:
'Path.Object Name With Spaces.attribute' = value
__________________
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
  #3  
Unread 08-04-2010, 11:39 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

I half have working what I want...

I managed to get it to work if I reference the object directly by name, but if I try to use a variable and concatenate them I can't seem to get the desired result. And I would need to do this for my idea to work.
I have an object named Test Object with the text element set to: Testing 123

sTest=('Parent.Test Object.text')
say sTest

The above returns the proper string echoed into chat.

However the following I cannot seem to find a proper method for.

sName=('Long Item Name')
sTest=('Parent.') ## sName ## ('.text')
say sTest

The above returns: Parent.Long Item Name.text
Have tried a few different alterations with how I concatenate them, but with no luck.

I tried setting it to another variable again like: sTest2=('sTest')
... but that did nothing new.
__________________
"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-04-2010 at 11:41 AM.
Reply With Quote
  #4  
Unread 08-04-2010, 11:52 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

Okay in response to myself, I think I answered my own question. Seems when trying to explain what you're doing helps yourself figure out the solution

Basically I just had to get creative with it. I knew I had to do it in 2 steps, but my brain wasn't quite grasping the method at first.

Setup separate objects with the string broken up.

code1's object: sTestObj=('Parent.
code2's object: .text')

Then do this:
sString=('Long Item Name')
Parent.DoCommand.onpress=(code1 ## sString ## code2)
Parent.DoCommand.press=true

However the problem I don't think I can solve.... Items with apostrophes in their names
__________________
"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-04-2010 at 12:20 PM.
Reply With Quote
  #5  
Unread 08-04-2010, 01:01 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

Well despite apostrophes (they might have been manageable), I found out that the Map system doesn't support names with spaces.

You can add a POI with spaces, but you cannot delete it via slash command. I tried using quotes to no avail. I even managed to add a category name with a space using quotes, but still wasn't able to delete it.
One problem solved, blocked by another!

This would have been so much easier if I could just access item IDs from the Examine window, Lol.
__________________
"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
  #6  
Unread 08-09-2010, 05:16 AM
Zonx's Avatar
Zonx Zonx is offline
A Green Troll
This person is a EQ2Map developer.
Featured
 
Join Date: Dec 2004
Server: Blackburrow
Posts: 2,221
Default

slash commands that take an input value can often be executed two ways...

/do_something_with foo
or
do_something_with='foo'

You might be able to use the later with a variable containing the concatenation.

foo='something' ## 'somethingelsewithspaces'

do_something_with=foo
Reply With Quote
  #7  
Unread 08-09-2010, 08:34 AM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

Here's the PM I sent to Rothgar. It explains more in detail about the problem I ran into.

Quote:
Hey Rothgar,

I know you're super busy most of the time. I just wanted to bring up a question about a command used for adding a POI to the map in-game.
/map2_add_poi

It's possible to use this to add a POI and save information via UI scripting. For example:
/map2_custom_poi_filename customdata.xml
/map2_add_poi TestCategory 0 0 0

This will make a section in the file with the name TestCategory. I found out if you wrap the first parameter in quotes "Test Category", and then you can successfully add a section with a space in the name and it will work great.

However, the problem is in the second command:
/map2_delete_poi

This command requires the specific POI name, followed by the Section name.
/map2_delete_poi MyPOIname TestCategory

The real problem I'm getting at is it's possible to add a POI with a space in the category name, or even the POI name, but it's impossible to delete it via command.

I was wondering if there was an easy way to change the delete command to support quotes in the POI name and/or category name.

The POI name itself can have spaces cause the window allows it that pops up. But this is also impossible to delete via slash command.

Thanks for your time and any possible response to this.
I did /bug it in game cause it seemed like a bug to me at least
I can try to wrap quotes around the delete command parameter(s), but I haven't gotten it to work no matter how I twist it. Weird that the add command supports the quotes, but the delete doesn't (in both parameters).
__________________
"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
  #8  
Unread 08-23-2010, 07:00 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

So we tackled the map system. The delete command supports pipes:
/map2_delete_poi |Poi Name With Lots of Spaces| CategoryName
The above works great. Getting the vertical lines | in the code was annoying, but wrapping them in single quotes worked in the end, it was just combing the code altogether that was a PITA.

So my next question...
Anyone manage to access an element that has both spaces in the name AND an apostrophe?

You can see where this would lead to trouble:
'Parent.Parent.Lord's Amulet.attribute' = blah
__________________
"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-23-2010 at 07:07 PM.
Reply With Quote
  #9  
Unread 08-23-2010, 07:08 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

LOL... almost every time I ask a question I usually manage to figure it out.

Wrapping it in double quotes worked!

"Parent.Lord's Amulet.attribute" = blah
__________________
"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
  #10  
Unread 08-23-2010, 07:12 PM
Brushfire Brushfire is offline
A Forest Scavenger
Interface Author - Click to view interfaces
 
Join Date: Dec 2007
Server: Antonia Bayle
Posts: 17
Default

Code:
'Parent.Parent.Lord&apos;s Amulet.attribute' = blah
try that
Reply With Quote
  #11  
Unread 08-23-2010, 07:17 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

hehe I posted the solution above. The reason I needed to do it the way I posted, is because I'm referencing Item names from the in-game examine window.

They have apostrophe's in their name, and there's no way to edit the apostrophe out via scripting.
__________________
"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
  #12  
Unread 08-23-2010, 07:18 PM
Brushfire Brushfire is offline
A Forest Scavenger
Interface Author - Click to view interfaces
 
Join Date: Dec 2007
Server: Antonia Bayle
Posts: 17
Default

Quote:
Originally Posted by Drumstix42 View Post
hehe I posted the solution above. The reason I needed to do it the way I posted, is because I'm referencing Item names from the in-game examine window.

They have apostrophe's in their name, and there's no way to edit the apostrophe out via scripting.
Yeah saw that after I posted it, but might be useful in other circumstances.
Reply With Quote
  #13  
Unread 08-24-2010, 04:25 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 Brushfire View Post
Code:
'Parent.Parent.Lord&apos;s Amulet.attribute' = blah
try that
Does that work now? I remember that you needed to wrap single quotes in doubles and the other way around because the parser would decode all entities (like &apos;) before trying to make sense of it.
__________________
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
  #14  
Unread 08-24-2010, 06:27 AM
Brushfire Brushfire is offline
A Forest Scavenger
Interface Author - Click to view interfaces
 
Join Date: Dec 2007
Server: Antonia Bayle
Posts: 17
Default

Yeah you're probably right on that. I do know the parser only makes one pass to for escaped characters though. It won't recursively check until they are all resolved.
Reply With Quote
  #15  
Unread 08-24-2010, 02:06 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

I usually work in the UIBuilder, so I'm not sure what my above code would look like in XML saved, I'd have to look. Shouldn't really matter though. Long as I go things working, I am happy
__________________
"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
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 07:37 AM.


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