ObjSetName forces capitals?

Need help with using DizzyAGE then look here
Post Reply
Queex
Hard Boiled Egg
Posts: 124
Joined: Thu Oct 22, 2009 5:04 pm

ObjSetName forces capitals?

Post by Queex » Tue Dec 07, 2010 7:32 pm

Does ObjSetName() force the name input into upper case?

Because despite setting the name in lower case, by the time it's pulled out in the inventory dialog it's back in capital letters.

Is there any way to put this right without some tedious strexplode strsub strlow strimplode manipulation in DialogInventory()?
- Lost Temple Dizzy -
- Iron Tower Dizzy -

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Post by delta » Tue Dec 07, 2010 8:01 pm

hmmmmm as far as I can tell, it must either store the name (using ObjSetName) as all uppercase, or retrieve it (using ObjGetName) as uppercase.

of course it could be that it simply can't tell the difference, and whether you use Z or z it will find the same square on the font tile. *shrugs*

as for an easier workaround..... hmmmm one or two ideas spring to mind (such as writing your own equivalent of the ObjSetName/ObjGetName code and using that instead), but nothing obviously easy I'm afraid.
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Post by delta » Tue Dec 07, 2010 8:12 pm

OK, how about this:

in function DialogInventory in menus.gs, replace this line:

Code: Select all

	text += ObjGetName(idx);
with this line:

Code: Select all

	text += FindObjName(idx);
then write a new function, as so:

Code: Select all

func FindObjName(idx)
{
	if(ObjGet(idx,O_ID)==1000) return "A Bucket";
	if(ObjGet(idx,O_ID)==1001) return "A Large Sponge";
	if(ObjGet(idx,O_ID)==1002) return "A Heavy Filing Cabinet";
	// etc etc...

	return "";
}
with the above code, you'd have no further use for the ObjSetName() function (I think...)

I can't help feeling however, that this solution is too simple, and that I may have missed something...
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Post by delta » Tue Dec 07, 2010 8:20 pm

Right, I've just modified the above code, which now works (and returns lower case text too). :)

That was easier than I thought!
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Post by delta » Tue Dec 07, 2010 9:14 pm

of course, there are a few limitations to that code.

- you can't rename an item in the normal way. (you'd have to set up some kind of 'if' statement for the item in question)
- ermmm...
- ummm.

I may think of more in time, but atm that's the only one I can think of
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

Queex
Hard Boiled Egg
Posts: 124
Joined: Thu Oct 22, 2009 5:04 pm

Post by Queex » Tue Dec 07, 2010 11:18 pm

I've ended up doing something similar, as the only alternative would seem to be waiting for a fix in the engine, which will not be swift in coming. I just wanted to make sure I wasn't missing something somewhere. Cheers!
- Lost Temple Dizzy -
- Iron Tower Dizzy -

Queex
Hard Boiled Egg
Posts: 124
Joined: Thu Oct 22, 2009 5:04 pm

Post by Queex » Wed Dec 08, 2010 11:25 am

I've noticed a similar feature with room names.
- Lost Temple Dizzy -
- Iron Tower Dizzy -

xelanoimis
Team Yolkfolk
Team Yolkfolk
Posts: 1014
Joined: Sun Jan 21, 2007 6:34 pm
Contact:

Post by xelanoimis » Tue Dec 28, 2010 7:20 am

Yes, both the objects and the rooms have upper case names. This happens internally in the "set" functions. Don't know why I did so. If you people want, I can change it to store the names the way they are given.

An alternative hack would be to store the names with a special symbol before the upper chars, like "*THE *STONE", and when retrieved for display the name would be converted into "The Stone" with a scripted function. But I don't recommend such hacks.

Just let me know, and I'll update the engine if you wish.

Queex
Hard Boiled Egg
Posts: 124
Joined: Thu Oct 22, 2009 5:04 pm

Post by Queex » Tue Jan 04, 2011 2:00 pm

It sounds like a simple update to make, so it would be cool- although probably in a way that preserves the old behaviour to avoid too many annoying conversion issues when updating old games to a newer engine.

If the set functions set the names verbatim, perhaps add a G_ variable to indicate whether item and room names should be fully capitalised when returned by the get functions. That way, the new template can set the variable early on, but older games will leave it unset and preserve the old behaviour.

For the editor, I guess it doesn't really matter if the capitalisation is a little off when converting.
- Lost Temple Dizzy -
- Iron Tower Dizzy -

Post Reply