MancubusBruiser1988 Posted September 10, 2016 How do I get a platform (press to use) to go only to a certain level? The platforms keep going right down to the ground level when pressed and I want it to stop only at the level I am on (Hexen format) 0 Quote Share this post Link to post
Ijon Tichy Posted September 10, 2016 to do it generically, you'll need a combination of GetSectorFloorZ and Floor_(Raise/Lower)ByValue in ACS since hexen format doesn't support arguments greater than 255, what I'd do is tag the platform and floors you want it to stop at with a unique tag each, then send it to an ACS script like this one: script 1 (int platformTag, int targetTag) { int platformHeight = GetSectorFloorZ(platformTag, 0, 0); int targetHeight = GetSectorFloorZ(targetTag, 0, 0); int diff = targetHeight - platformHeight; if (diff == 0) { terminate; } if (diff > 0) { Floor_RaiseByValue(platformTag, 8, diff); } // 8 is the speed - 8 units per 8 tics else { Floor_LowerByValue(platformTag, 8, -diff); } }so you'd be using ACS_ExecuteAlways (special 226), first argument 1 (the script number), second argument 0 (we want it to run on this map), third argument the tag of the platform sector, fourth argument the tag of the sector it should stop at keep in mind if there's multiple sectors with the same tag that GetSectorFloorZ will grab the floor height of the sector with the lowest sector number (ie. usually the one created first) 0 Quote Share this post Link to post
MancubusBruiser1988 Posted September 10, 2016 Thanks. Seems like a lot just for a small thing to do. Do the other formats have any simple settings that do this without having to script? Hexen format seems more limited in some aspects 0 Quote Share this post Link to post
Rayziik Posted September 10, 2016 You could do this in Boom by using the repeatable "lower/raise to nearest floor" linedef actions. There's also platform actions too, iirc, that will make the floor and ceiling travel at the same time. 0 Quote Share this post Link to post
scifista42 Posted September 10, 2016 Use Floor_MoveToValue with the intended target height level as the "height" parameter. 0 Quote Share this post Link to post
Ijon Tichy Posted September 10, 2016 I was looking for something like Floor_MoveToHeight, but there's a big issue with it in that you're limited to heights in the -255/255 range if you're using it on a line in hexen format, and if for some reason the target height changes, it's not flexible enough on its own but yeah that'd simplify the second half of my six-line script down if you used it there come to think of it, you'd need to do a ">> 16" on the target height if you're getting it from GetSectorFloorZ, since the line specials expect ints and not fixeds 0 Quote Share this post Link to post
scifista42 Posted September 10, 2016 Ijon Tichy said:there's a big issue with it in that you're limited to heights in the -255/255 range if you're using it on a line in hexen format, If you need a height outside of the -255 to 255 range, either use Floor_MoveToValueTimes8, or use Floor_MoveToValue inside a script, because the 0-255 argument value limit only applies when the action is used on a linedef's / thing's Action, not inside a script. 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.