Page 1 of 1

A question about coding

Posted: Wed Jul 10, 2013 9:35 pm
by CLgaming
I am renaming messages and other shit for Half-Life: Resonance Cascade. I just got to the Use914 function and I want to know if I have to replace the item names with the ones from Items.bb if I don't want the game to crash.

Re: A question about coding

Posted: Wed Jul 10, 2013 9:55 pm
by juanjp600
I remember when I faced this problem making the language mod (discontinued). I didn't touch the item names, instead I used a script that changed the name displayed in the inventory.

Add the following code at the end of the Main.bb file (this is the safest way to know it will work):

Code: Select all

Function InvName$(inputStr$)

;The "Case" string is the original item's name
;The "Return" is the changed name

Select inputStr$
	Case "Something"
		Return "Whatever you want to call it"
	Default
		Return inputStr
End Select

End Function
You need to copy the "Case" and "Return" before the "Default" as many times you need. You don't need to add the names you won't be changing (in fact, you shouldn't do that)

Then, find this in the Main.bb file:

Code: Select all

Text(x + width / 2, y + height + spacing - 15, Inventory(n)\itemtemplate\name, True)
And change it to:

Code: Select all

Text(x + width / 2, y + height + spacing - 15, InvName(Inventory(n)\itemtemplate\name), True)
This should run the script, changing the name you see in the inventory.

Re: A question about coding

Posted: Thu Jul 11, 2013 1:40 am
by mrpeanut188
Another way to could do it is open all the all the .BB files pertaining to objects, then replace the name with the new name, in all documents.