• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Omg...

Evan

A splendid one to behold
Senator
Premium User
Joined
May 6, 2009
Messages
7,019
Solutions
1
Reaction score
1,029
Location
United States
I just suck at scripting today, it's not even funny.
Something is wrong with my stupid brain...

Here's another one of my flops

In an npc.xml file I have this:
PHP:
<parameter key="shop_buyable" value="molotov cocktail, 2009, 3"/>

Error:
Code:
[Warning - Merchant] NpcSystem:
SubType missing for parameter item:
molotov cocktail, 2009, 3

So, I guess it's missing a fluid subtype since it says "flask of void", so I changed it to:
PHP:
<parameter key="shop_buyable" value="molotov cocktail, 2009, 11, 3"/>

Oil is ID 11.
No errors; flask says it's filled with oil, but in the shop, it's costing me 11 GP, I want it to be 3, anyone know how to exactly do it?
 
Omg... look at the error.
The item does exist, it's a green flask (2009), but the error says it's missing a subType, which is some kind of fluid like oil, blood, water and so on, so I added a , 11 which is the ID of oil.
The shop gives me the correct thing, green flask of oil, but it's charging me 11 gold instead of 3 like I wanted it to cost.
 
Ahh okay that's right, now...

Code:
[Warning - Merchant] NpcSystem:
ShopModule.onBuy - Item not found on shopItems list

@up, look in my first post
 
Still having the same error:
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Merchant" script="default.lua" walkinterval="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="128" head="97" body="56" legs="68" feet="116" addons="2"/>
	<parameters>
		<parameter key="module_shop" value="1"/>
		<parameter key="shop_buyable" value="molotov cocktail, 2009, 3, 11"/>
	</parameters>
</npc>

Code:
[Warning - Merchant] NpcSystem:
ShopModule.onBuy - Item not found on shopItems list
 
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Merchant" script="default.lua" walkinterval="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="128" head="97" body="56" legs="68" feet="116" addons="2"/>
	<parameters>
		<parameter key="module_shop" value="1"/>
		<parameter key="shop_buyable" value="molotov cocktail, 2009, 11"/>
	</parameters>
</npc>

it should be item name, item id, price, you've got an extra part? i don't do NPC scripting much, if you can't tell ;)
 
Yeah, if you read the earlier posts, the initial error states that it is missing a subType as I am using a container (green flask 2009).
So, the 11 is the ID of oil and 3 is the price, that's why I have 4 "arguments" or whatever it's called.

:S
 
Yeah, if you read the earlier posts, the initial error states that it is missing a subType as I am using a container (green flask 2009).
So, the 11 is the ID of oil and 3 is the price, that's why I have 4 "arguments" or whatever it's called.

:S

ohhhh yeh, why couldn't you have made it a different item? xD
doubtful, but is the name in the script exactly the same as the one in items.xml?
other than that I'm clueless sorry
 
Well, I just changed 11 to 0 (empty) and it works now.
I guess it's a bug in TFS :p

@up, I tried that, still same error :p
Oh well, thanks everyone, I'll just use it empty. REP++ all
 
time to adjust script to work with empty one? ;)

Initially I wasn't thinking about that since I didn't want it empty, I wanted it to give oil, but since that's not possible, I'll be making an oil cask or something next to the NPC
 
Back
Top