• 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!

Solved TFS 1.0 - remove actionid limitations?

RazorBlade

Retired Snek
Joined
Nov 7, 2009
Messages
2,015
Solutions
3
Reaction score
629
Location
Canada
Hello! Been a while since I've been around here. Was just playing around with a script idea and I've come to a minor issue. I need to be able to set an item's action id when it is given to a player by the npc. I've found that the highest action id it can be set to is a little below 17000. I need something more along the lines of 1 million or even more. Can this limitation be changed? Will it require source edits, and will it have adverse effects? Is there another attribute that I can use instead, other than description, to store the value on the item?
 
Hello! Been a while since I've been around here. Was just playing around with a script idea and I've come to a minor issue. I need to be able to set an item's action id when it is given to a player by the npc. I've found that the highest action id it can be set to is a little below 17000. I need something more along the lines of 1 million or even more. Can this limitation be changed? Will it require source edits, and will it have adverse effects? Is there another attribute that I can use instead, other than description, to store the value on the item?

Yes if you want to change the max on the action id you will need to do a source edit. As for the other options, you still have uid, but that's probably not what you are looking for. Attributes wise, all items can have the text attribute (different than discription, used for a writable item like a scroll), and as long as that item isn't writable (such as a scroll or piece of paper, ect.) then the player won't be able to see this "hidden" attribute.
 
Yes, thanks for the response. I just started looking at text, however I wasn't sure how to view that attribute from a script. I'm not used to TFS 1.0 and I don't know what the function would be to check the attribute. Is there somewhere I can find a list of lua functions for TFS 1.0?
 
Not seeing any function related to checking attributes.

Can I just do like item.text to check its value?

Like, I'm using this to check it.
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local count = tonumber(item.text)
    Player(cid):sendTextMessage(MESSAGE_STATUS_WARNING, count)

Console just tells me it's a nil value. But I don't know if that's because I can't check it like that or if it's actually a nil value.

EDIT: switched id to a book and it does in fact set the value of text properly. Just need to know how I can access that value.
 
Last edited:
Oops, no need in the parentheses, that would make it not work as it is then considered a string, but I'm guessing you already knew that...
 
Yeah, I actually made myself a function instead to keep things simple
Code:
function getItemText(uid)
local item = Item(uid)
if item == nil then
return false
end

return item:getAttribute(ITEM_ATTRIBUTE_TEXT)

end
 
Nice! :)

I think you could do it easier, and less buggy like this tho

If not item then
return false

Idk tho
 
Back
Top