It looks like they changed how it works in tfs 1.3Should the uniqueid and actionid be the same?
Can you give an example of 2-3 of these quests?None of my quests are working, I have searched everywhere for a fix.
real map tfs 1.3 10.98 any help at all will be grateful
Thank you.
Quests are giving items but only once every serversave
Does the chest have actionid 2000 in RME?
It looks like they changed how it works in tfs 1.3Should the uniqueid and actionid be the same?
If it's regarding a similar issue, yes.That worked!!! thank you
Would you be able to help me with another issue on this thread or no
Then yeah, do a new thread. xPHas to do with a NPC file
what if i want reward to be 2-100x count ?It looks like they changed how it works in tfs 1.3
apparently you just put the UniqueID as the itemid
so
ActionID = 0
UniqueID = itemid
what if i want reward to be 2-100x count ?
local actionId = 45001
local reward = {1111, 2, 100} -- {itemid, amountMin, amountMax}
local action = Action()
function action.onUse(player, item, fromPosition, target, toPosition, isHotkey)
player:addItem(reward[1], math.random(reward[2], reward[3]), true)
return true
end
action:aid(actionId)
action:register()
But before i could just add action ID 2000If you want something custom, you'll need to use a custom script.
Lua:local actionId = 45001 local reward = {1111, 2, 100} -- {itemid, amountMin, amountMax} local action = Action() function action.onUse(player, item, fromPosition, target, toPosition, isHotkey) player:addItem(reward[1], math.random(reward[2], reward[3]), true) return true end action:aid(actionId) action:register()
But before i could just add action ID 2000
UNIQ ID ( for storage)
and put all i want in box/bag/ any container what this ( container will have)
I can make this work like before ?
testing some quetss.lua , i hope it works
Probably have to script it yourself, or find the old version and convert it.
I'd have to assume that the UniqueId is the storage value, and the actionId tells it what script to run.
Then you'd have to loop through the container and copy all the items inside (into a bag?), then attempt to give that to the player, checking for capacity and free space.
Not entirely hard to do.. just time consuming.
it was working perfectly till 1.2 tfs for me, on 1.3+ its different now lol
Probably have to script it yourself, or find the old version and convert it.
I'd have to assume that the UniqueId is the storage value, and the actionId tells it what script to run.
Then you'd have to loop through the container and copy all the items inside (into a bag?), then attempt to give that to the player, checking for capacity and free space.
Not entirely hard to do.. just time consuming.
Probably have to script it yourself, or find the old version and convert it.
I'd have to assume that the UniqueId is the storage value, and the actionId tells it what script to run.
Then you'd have to loop through the container and copy all the items inside (into a bag?), then attempt to give that to the player, checking for capacity and free space.
Not entirely hard to do.. just time consuming.
local annihilatorReward = {1990, 2400, 2431, 2494}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.uid <= 1250 or item.uid >= 30000 then
return false
end
local itemType = ItemType(item.uid)
if itemType:getId() == 0 then
return false
end
local itemWeight = itemType:getWeight()
local playerCap = player:getFreeCapacity()
if table.contains(annihilatorReward, item.uid) then
if player:getStorageValue(PlayerStorageKeys.annihilatorReward) == -1 then
if playerCap >= itemWeight then
if item.uid == 1990 then
player:addItem(1990, 1):addItem(2326, 1)
else
player:addItem(item.uid, 1)
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found a ' .. itemType:getName() .. '.')
player:setStorageValue(PlayerStorageKeys.annihilatorReward, 1)
player:addAchievement("Annihilator")
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.")
end
elseif player:getStorageValue(item.uid) == -1 then
if playerCap >= itemWeight then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found a ' .. itemType:getName() .. '.')
player:addItem(item.uid, 1)
player:setStorageValue(item.uid, 1)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.")
end
return true
end
im not programer at all can you please remove those what i dont need ?@Lbtg this is the quest system you are looking for:
orts2/data/actions/scripts/quests/system.lua at main · EPuncker/orts2
ORTS datapack working on latest TFS. Contribute to EPuncker/orts2 development by creating an account on GitHub.github.com
just remove the unwanted stuff and you are done
Lua:function onUse(player, item, fromPosition, target, toPosition, isHotkey) local storage = specialQuests[item.actionid] if not storage then storage = item.uid if storage > 65535 then return false end end if player:getStorageValue(storage) > 0 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'The ' .. ItemType(item.itemid):getName() .. ' is empty.') return true end local items, reward = {} local size = item:isContainer() and item:getSize() or 0 if size == 0 then reward = item:clone() else local container = Container(item.uid) for i = 0, container:getSize() - 1 do items[#items + 1] = container:getItem(i):clone() end end size = #items if size == 1 then reward = items[1]:clone() end local result = '' if reward then local ret = ItemType(reward.itemid) if ret:isRune() then result = ret:getArticle() .. ' ' .. ret:getName() .. ' (' .. reward.type .. ' charges)' elseif ret:isStackable() and reward:getCount() > 1 then result = reward:getCount() .. ' ' .. ret:getPluralName() elseif ret:getArticle() ~= '' then result = ret:getArticle() .. ' ' .. ret:getName() else result = ret:getName() end else if size > 20 then reward = Game.createItem(item.itemid, 1) elseif size > 8 then reward = Game.createItem(1988, 1) else reward = Game.createItem(1987, 1) end for i = 1, size do local tmp = items[i] if reward:addItemEx(tmp) ~= RETURNVALUE_NOERROR then print('[Warning] QuestSystem:', 'Could not add quest reward to container') end end local ret = ItemType(reward.itemid) result = ret:getArticle() .. ' ' .. ret:getName() end if player:addItemEx(reward) ~= RETURNVALUE_NOERROR then local weight = reward:getWeight() if player:getFreeCapacity() < weight then player:sendCancelMessage(string.format('You have found %s weighing %.2f oz. You have no capacity.', result, (weight / 100))) else player:sendCancelMessage('You have found ' .. result .. ', but you have no room to take it.') end return true end if questsExperience[storage] then player:addExperience(questsExperience[storage], true) end if questLog[storage] then player:setStorageValue(questLog[storage], 1) end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found ' .. result .. '.') player:setStorageValue(storage, 1) return true end