LD-425 Change Object State seems not working

Status
Not open for further replies.

Ezer'Arch

ArchPack 2.5 is on the way
Hi,

I'm trying to get Linedef type 425, Change Object State, to work with SRB2 2.1 but it seems the linedef doesn't affect the character at all.

I uploaded a new version of the example wad following the instructions on the relevant article (https://wiki.srb2.org/wiki/Linedef_type_425). You can download the example wad and check if I'm doing something wrong.

It seems the linedef can parse the object state (i.e. S_PLAY_PAIN) but the linedef can't "apply" the state on the character. If I purposely mistype the object state the game will throw a warning, like "couldn't parse object state", which means the game can find the linedef and check the text string in the front upper texture field, but for some reason the character is not affected.

Am I doing something wrong?

Thanks in advance.
 
Last edited:
It says right in the wiki article you linked
Oh I misread it, I skipped the main paragraph and read only the setup part, sorry. It used to work with player characters before and looks like the image (on the wiki) no longer reflects how the linedef now works in 2.1.

Is there any other way to change the player states? I was planing on forcing the player into spin state on contact with water FOF. I managed to make it work in 1.09.4 and 2.0.x, I'd like to reproduce the same thing in 2.1.x.
 
Last edited:
While we're on the topic, why was the behavior changed anyway? It used to work fine in 2.0 as far as I know.
 
I actually made a thread extremely similar to this just two months ago and I can definitely help you here. Instead of using Linedef Type 425, Monster Iestyn helped me set up the object state with using Linedef Type 443 - Call Lua Function.

What you want to do is start of your Lua script with "local function <your function name>(line,mo)". Then start a new line and then type "mo.state = <player state>" and another line with "P_ResetPlayer(mo.player)". Then you can insert a new line and "end" the function. After that, you would want to add a hook by using "addHook ("LinedefExecute", <functionname>, "name to use in Doom Builder")".

If you did that correctly it should look like this:

Code:
local function letloose(line, mo)
	mo.state = S_PLAY_FALL1
	P_ResetPlayer(mo.player)
end

addHook ("LinedefExecute", letloose, "FREFALL")

To use it in the level, it's really simple. You just simply make a control sector and use one of the linedefs and simply use the Front Upper Texture for the function name and for this case, it would be "FREFALL". If you did this all correctly it should be like this. DO MIND THE END OF THE VIDEO!
 
This is gold. Saving for later. Thank you!

While we're on the topic, why was the behavior changed anyway? It used to work fine in 2.0 as far as I know.
I was messing around with the linedef. I tested it with pushable objects, decorative objects and mobjs. Really it doesn't work with players.

It doesn't work with LD-301, Each Time. It requires LD-300 Continuous, LD-302 Once, or LD-314/315 Number of Pushables to work. If you are using pushable objects, the target sector requires Sector Type 16 (Pushable objects), the object changes its state as long as it touches the floor. I could change a gargoyle into a seaweed, apparently. I couldn't change a gargoyle into any state, there are some restrictions, for example, changing into a mobj (e.g. Deton, Crawla) may crash the game. In some cases, the new state will make the object disappear in the next tic.

I failed to make the linedef change the states of mobjs (e.g. Crawla) and decorative elements (e.g. flowers, chains), nothing happened. It seems they require a sector type of their own.

I uploaded a new example wad. It was fun.
 
Last edited:
It's not actually a bug that LD 425 doesn't work with players anymore, it's been changed in the code to explicitly not work for players.

Also, Each time is designed for use with players entering the sector, if you were curious as to why that doesn't work.

Also, what about sector special 128? I *think* that is capable of working with any object as far as I'm aware: https://wiki.srb2.org/wiki/Check_for_Linedef_Executor_on_FOFs
 
Status
Not open for further replies.

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

Back
Top