Using polyobject actions via LUA

Status
Not open for further replies.
I want to make a poly object slide using LUA. I don't know how to get it work though.

Code:
Example code:
COM_AddCommand("openslidetestpolyobject", function(player)
  if player.mo
    A_LinedefExecute(mobj, 1)
  end
end)

It says I have to use a mobj_t type which I do, but when I do it does nothing after I had typed the command in and pressed enter in the console. I don't know which userdata structure to use in LUA for my polyobjects however. I have set up the sectors and stuff on my map.

s12rlt.png


EDIT: Issue is now fixed. I had to use continuous instead of each time.
 
Last edited:
Don't use an SOC action in Lua if there's a more direct way to accomplish the same thing. Use P_LinedefExecute(1, player.mo, player.mo.subsector.sector) instead.
 
Don't use an SOC action in Lua if there's a more direct way to accomplish the same thing. Use P_LinedefExecute(1, player.mo, player.mo.subsector.sector) instead.
It does nothing for me still. I'm using this on a poly object action. I don't think it works on poly object actions. Correct me if I'm wrong. If it is a bug then it needs to be fixed.

Code:
Updated Example Code:
COM_AddCommand("openslidetestpolyobject", function(player)
  if player.mo and (mapheaderinfo[gamemap].polyvilledoorscontrol)
    P_LinedefExecute(1, player.mo, player.mo.subsector.sector)
  end
end, 1)
 
Last edited:
How my map is set up

How is it set up in the map?

I have two poly objects. I have the two control sectors with a linedef that has the parameter type. Those linedefs are tagged to the poly object ID. I use tag 1 for the first poly object and tag 2 for the second poly object. I have another two control sectors with a linedef that has the poly object door slide type and another linedef that has the each time type. This is kinda hard to explain by the way.
 
Last edited:
If I remember right, each time linedef executors are handled with a special method that doesn't actually respond to P_LinedefExecute. Try using continuous triggers instead.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top