• 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 TFS 0.4 8.71 Rev 4267

Seksy

Member
Joined
May 20, 2012
Messages
387
Reaction score
23
Location
Tennessee
First note. Some of my questions on 8.70 0.4 based have been removed. If my threads are removed, I would like an explanation as to why. Be courteous.

Now, the problem. I compiled rev 4267 which is 8.71
Everything works fine but ladders. I double checked, they (item 1386) are in the items.xml
they are in the actions folder/actions.xml, tied to other/teleport.lua
Teleport.lua is present (below)
but they simply dont work.

I am not sure which rev this data pack was hosted on before but teleport.lua and functions should not have changed between 8.70 and 8.71 right? Meanwhile im digging for the answer as to why this is happening.

PHP:
local UP_FLOORS = {1386, 3678, 5543, 8599, 10035}
local FIELDS = {1497, 1499, 11095, 11096}
local DRAW_WELL = 1369

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == DRAW_WELL and item.actionid ~= 100) then
        return false
    end

    local check = false
    fromPosition.stackpos = STACKPOS_GROUND
    if(isInArray(UP_FLOORS, item.itemid)) then
        fromPosition.z = fromPosition.z - 1
        fromPosition.y = fromPosition.y + 1
        if(doTileQueryAdd(cid, fromPosition, 38, false) ~= RETURNVALUE_NOERROR) then
            local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
            if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
                fromPosition.y = fromPosition.y - 2
            else
                check = true
            end
        end
    else
        fromPosition.z = fromPosition.z + 1
    end

    if(not check and doTileQueryAdd(cid, fromPosition, 38, false) ~= RETURNVALUE_NOERROR) then
        local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
        if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
            return false
        end
    end

    local pos, dir = getCreaturePosition(cid), SOUTH
    if(pos.x < fromPosition.x) then
        dir = EAST
    elseif(pos.x == fromPosition.x) then
        if(pos.y == fromPosition.y) then
            dir = getCreatureLookDirection(cid)
        elseif(pos.y > fromPosition.y) then
            dir = NORTH
        end
    elseif(pos.x > fromPosition.x) then
        dir = WEST
    end

    doTeleportThing(cid, fromPosition, false)
    doCreatureSetLookDirection(cid, dir)
    return true
end
 
Last edited:
Ok since no one is answering here ill update some. Apparently the problem lies in being a conflict between the lib and creaturescripts folders
which tells me the data pack was created for a different rev right? Im thinking this may be for 0.3.7 Rev 4393
I have compiled all other 8.70 revs and they wont work. 4186 wont compile at all and keeps getting error on talkaction.cpp

back to the drawing board...open to suggestions.
 
Explain what the problem is, what is it supposed to do, what is it not doing, what should be different and do you get errors?
People can't do anything with "not working" because this doesn't explain at all what is wrong.
 
Explain what the problem is, what is it supposed to do, what is it not doing, what should be different and do you get errors?
People can't do anything with "not working" because this doesn't explain at all what is wrong.

**Actually still tracing "what" is wrong**
At first I thought it was a problem with the code as presented above. Maybe a syntax error. But now I have realized its to do with the creaturescripts and lib folders.
(1) I compile the server, use the original datapack and all works fine.
(2) I migrate all "my data pack" over to it and ladders stop working, grates etc. (anything to do with actions/scripts/other/teleport.lua
(3) I can replace the lib folder with the original and ladders work but the log out script in creaturescripts stops working
(3) Swap those two out and the logout works but no ladders

So all this tells me its a problem in the functions thus the data pack I have was originally created for a different rev. possibly 0.3.7
Later tonight Ill screenshot the error and post back here.
Opinion?
 
You only explain what you did, "working", "not working" or "stops working" doesn't explain what your problem is.
Like I posted, what is it supposed to do, what is it not doing and what should be different, do you get errors?
Are there scripts not loading? If that is the problem, which scripts and did you already try to add print under the main function to see if you get that message in your console?
 
You only explain what you did, "working", "not working" or "stops working" doesn't explain what your problem is.
Like I posted, what is it supposed to do, what is it not doing and what should be different, do you get errors?
Are there scripts not loading? If that is the problem, which scripts and did you already try to add print under the main function to see if you get that message in your console?

I will get a screenshot soon as I can. Other than that right now all I can say is as stated above. Original source, ladders/grates function as they should.
Once I begin to migrate "my data pack" over then ladders stop functioning when I add "my lib folder"
therefore I can only assume its a function related problem. If I leave the original lib folder then some of the creaturescripts stop working.
I don't know any better way to explain it. Ill screenshot later and hopefully it will add some insight but I believe the data pack was for a total different rev.
 
Dunno if this will help but here are my lib files and creature script files.
lib-original is the lib files from the original compiled source
my-lib and my-creaturescript are the ones from my datapack.
The ladders stop working once I add my folders together.
swap out one or the other with originals and they start working again
No error in the console at all when I attempt to use the ladder. It just says you can not use this item. that make any sense?
Looking all this over I have concluded this data pack is for 0.3.7 and that would explain it would it not?
 

Attachments

Last edited:
I only need to know what the problem is.
So lets say you started your server, what exactly happened that made you come to the conclusion something is not right.
What is wrong, what should be different. "stop working" doesn't explain anything, I can't do anything with that because that can literally mean everything.
I mean, you walked on your server and then what, your server crashed? your pc crashed? What happens? That is the missing information you didn't provided.
Give an explanation of your problem, for example: I click on that item, I added it like this in actions.xml and here is the Lua script, it should give you fruit but instead of that I only get a textmessage ingame with you cannot use this object, I have this error: Error blabla.
 
Limos
Perhaps you missed it. I did explain that or so I thought. I will try to explain again here step by step
(1) I compiled the server tested in with all the original source files and all worked fine
(2) I begin to migrate "my data pack" over to the server.
(3) Migrate my creature scripts over then ladders continue to function, grates function but can not log out
(4) I migrate my lib folders over, log out function now works, but ladders/grates fail to function
can not go up ladders or down grates
So I assume its some type of conflict with lib and creature script folders.
I did find out this data pack was for 0.3.7 but lib folders should not have changed that much up to right?
I am stating to think the data pack was designed on a modified version... I guess.
Im new to this and learning as we go so forgive me.
 
Back
Top