Unterstanding of naming

Freeform discussion about anything related to modding Transcendence.
Post Reply
Shaman
Commonwealth Pilot
Commonwealth Pilot
Posts: 95
Joined: Fri Sep 20, 2013 2:03 pm

Theory:
All items in cargo get an "a" or "an" if singular or the quantity, it's hardcoded.

The plural of Items is hardcoded, if you have more than one item the it gets an "s".
You can force another plural by using ().

Question:
1. Is it possible to change the "a" to something different or delete it?
2. Is it possible not only to add letters, but to replace letters or delete them?
Shaman
Commonwealth Pilot
Commonwealth Pilot
Posts: 95
Joined: Fri Sep 20, 2013 2:03 pm

I found the answer to question 2. by myself
if I use

Code: Select all

name="cannon|cucumbers"
then the item will be named cannon if it's only one and cucumber if it's more than one.

Stil lookin for question 1.

Edit:
you can also use a single ";" instead of "|".
Last edited by Shaman on Sun Dec 29, 2013 8:05 pm, edited 1 time in total.
EditorRUS
Militia Lieutenant
Militia Lieutenant
Posts: 148
Joined: Tue Oct 30, 2012 6:30 pm

I saw somewhere in code answer for 1 question.
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

A quick google reveals name flags but looking through the functionlist doesn't reveal an itmsetname :(
http://transcendence.kronosaur.com/wiki ... name_flags
http://forums.kronosaur.com/viewtopic.php?f=8&t=6136
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
User avatar
pixelfck
Militia Captain
Militia Captain
Posts: 571
Joined: Tue Aug 11, 2009 8:47 pm
Location: Travelling around in Europe

It may be nice to note that the name formatting flags as linked by RPC can be combined. If you for example would like to capitalize (bitmask: 0x001) and prefix with the number of items (or 'a' in case of a single item) (bitmask: 0x008) you would combine them into 0x009.

This method of formatting flags by setting bits is commonly used in Transcendence and known as bitmasking, which is quite handy.

Pixelfck
Image
Download the Black Market Expansion from Xelerus.de today!
My other mods at xelerus.de
Shaman
Commonwealth Pilot
Commonwealth Pilot
Posts: 95
Joined: Fri Sep 20, 2013 2:03 pm

Thanks, I could work with flags. Now I only need a proper function to work with..
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Shaman wrote:I found the answer to question 2. by myself
if I use

Code: Select all

name="cannon|cucumbers"
then the item will be named cannon if it's only one and cucumber if it's more than one.

Stil lookin for question 1.

Edit:
you can also use a single ";" instead of "|".
I definitely like this.
At the moment, it's the only way for full game translations for handling plurals.
Shaman
Commonwealth Pilot
Commonwealth Pilot
Posts: 95
Joined: Fri Sep 20, 2013 2:03 pm

As I stumbled through the code I found the following. As far as I understand, the cargo list is created here and by setting flags I could change the singular "a" to a "1" or something differend. But I don't know where to set flags. I randomly tried to set some, but only got errors. Does anyone can help, or am I totally wrong?

Code: Select all

<DockScreen UNID="&dsCargoHold;"
			name=				"Ship's Cargo Hold"
			desc=				"Interior of Ship"
			type=				"itemPicker"
			backgroundID=		"&rsItemListScreen;"
			>

		<ListOptions
			dataFrom=	"player"
			list=		"*U"
			/>

		<Panes>
			<Default
					desc=	"You are in your ship's cargo hold.">

				<OnPaneInit>
					(block (thisItem desc)
						(setq thisItem (scrGetItem gScreen))
						(switch
							(not thisItem)
								(setq gMaxCount 0)

							(itmIsInstalled thisItem)
								(setq gMaxCount 0)

							(setq gMaxCount (itmGetCount thisItem))
							)

						(if thisItem
							(block Nil
								(setq desc (cat "Unit mass: " (strMassString (itmGetMass thisItem))))
								(if (gr gMaxCount 1)
									(setq desc (cat desc " (" gMaxCount " at " (strMassString (multiply (itmGetMass thisItem) gMaxCount)) ")"))
									)
								(scrSetDesc gScreen desc)
								)
							)

						; Enable/disable actions
						(scrEnableAction gScreen 0 (gr gMaxCount 0))
						)
				</OnPaneInit>

				<Actions>
					<Action name="Jettison this Item" key="J" >
						(switch
							(gr gMaxCount 1)
								(scrShowPane gScreen "JettisonQuantity")

							(eq gMaxCount 1)
								(block (itemsToJettison)
									; Create cargo crate
									(if (not gDest)
										(setq gDest (sysCreateStation &stCargoCrate; (sysVectorPolarOffset gPlayerShip 0 0)))
										)

									; Dump items
									(setq itemsToJettison (scrRemoveItem gScreen 1))
									(intJettisonItem gDest itemsToJettison)
									(scrShowPane gScreen "Default")
									)
							)
					</Action>

					<Action name="Done" cancel="1" key="D">
						<Navigate screen="&dsShipInterior;"/>
					</Action>

				</Actions>

			</Default>
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

I'm not sure exactly what you're looking for, so I'll try to cover various cases:

1. You can't change what the list of items (in a dock screen) displays. I believe that's currently hard-coded into the engine.
2. If you are creating a new item, you can specify how to pluralize it and whether its indefinite article is "a" or "an" but you cannot control whether or not an article is used.
3. If you are outputting the name of an item (any item) you can control the output using flags on itmGetName. For example:

Code: Select all

...
; Create 2 autopilot ROMs
(setq theItem (itmCreate &itAutopilotROM; 2))

; Default is just the item name (singular)
(itmGetName theItem 0x0000) -> "autopilot ROM"

; 0x0001 capitalizes the output
(itmGetName theItem 0x0001) -> "Autopilot ROM"

; 0x0002 pluralizes (regardless of the actual count)
(itmGetName theItem 0x0002) -> "autopilot ROMs"

; 0x0004 adds an article (generally an indefinite article)
(itmGetName theItem 0x0004) -> "an autopilot ROM"

; 0x0008 adds a count OR an article depending on the number
(itmGetName theItem 0x0008) -> "2 autopilot ROMs"

; 0x0010 adds a count OR nothing if singular.
(itmGetName theItem 0x0010) -> "2 autopilot ROMs"

; 0x0020 omits modifiers (such as "damaged" or "enhanced")
(itmGetName theItem 0x0020) -> "autopilot ROM"

; 0x0040 adds "the", "this", or "these"
(itmGetName theItem 0x0040) -> "these autopilot ROMs"

; 0x0080 short form of name. E.g., instead of "segment of titanium plate", just "titanium plate"
; 0x0100 actual name (even if the item is unknown); otherwise, "unknown ..."
; 0x0200 do not fire GetName event
; 0x0400 title capitalize (i.e., capitalize all words except prepositions, conjunctions, etc.)
; 0x0800 Prefix with "installed" if item is installed

; 0x1000 always prefix with count, even for singular items (pluralization is separate)
(itmGetName theItem 0x1000) -> "2 autopilot ROM"

; Of course, you can combine these bit flags to combine the effect
; 0x0001 (capitalize) + 0x0040 ("these") = 0x0041
(itmGetName theItem 0x0041) -> "These autopilot ROMs"
Shaman
Commonwealth Pilot
Commonwealth Pilot
Posts: 95
Joined: Fri Sep 20, 2013 2:03 pm

I'm working on a translation. I make good progress, but the articles in lists are bugging me.
Adding new articles is problably too much to ask, so I want to change the quantification of items to numbers only. For example I want
"1 autopilot rom" instead of "a autopilot rom" and this I thougt I could do in the cargo hold by adding flags to the code above.
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Shaman wrote:I'm working on a translation. I make good progress, but the articles in lists are bugging me.
Adding new articles is problably too much to ask, so I want to change the quantification of items to numbers only. For example I want
"1 autopilot rom" instead of "a autopilot rom" and this I thougt I could do in the cargo hold by adding flags to the code above.
I get it now. Unfortunately, translation will be very hard because I haven't added enough support to the engine. You've just mentioned one example of engine limitations, but there are many others. Perhaps we can start a list (probably as a new thread) of engine changes required for translation.
Shaman
Commonwealth Pilot
Commonwealth Pilot
Posts: 95
Joined: Fri Sep 20, 2013 2:03 pm

I'm already working on that list. I will do my translation for 1.2 and see if I can keep it up to date. The few exceptions I found until now are rare enough to explain or understand by thinking.
It's a bit sad to think this mod could be a one-timer. I'd like to see it become a part of the community but I have to live and mod with that risk.

Do you have a rough time limit to the next update in which I should post that list? I'd like to post it before that.
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Shaman wrote:I'm already working on that list. I will do my translation for 1.2 and see if I can keep it up to date. The few exceptions I found until now are rare enough to explain or understand by thinking.
It's a bit sad to think this mod could be a one-timer. I'd like to see it become a part of the community but I have to live and mod with that risk.

Do you have a rough time limit to the next update in which I should post that list? I'd like to post it before that.
The next engine update will not be for a few months, but the sooner you post it the sooner we can plan something.
Post Reply