Line Set Portal Target to Permanent Random Destination

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Line Set Portal Target to Permanent Random Destination

Postby Mini--Joe » Fri Sep 21, 2018 9:06 pm

I am trying to use the "Line set portal target" action to change the portal with no assigned destination to have a random destination of one of a few different options.
I want the randomly chosen destination to essentially be linked to the line with no destination upon a button press, and then be unchangeable (one time use switch).

I tried using the method that works with teleporters, as in I use the same tag for multiple teleport destinations (substituting tele destinations with linedefs, for the visual effect) but that seems to just not work.

I also tried doing this,
but I really had no knowledge basis for something like this to work, I was just hoping something it would.

Is there a way to use Set Portal Target to set a random linedef destination(of a set of given options)?
User avatar
Joined: 27 Jul 2014

Re: Line Set Portal Target to Permanent Random Destination

Postby Kinsie » Mon Oct 08, 2018 5:58 am

Use ACS.

Code: Select allExpand view
#include "zcommon.acs"

script "RandomPortal" OPEN
   Line_SetPortalTarget (1, random(2,4));
User avatar
A Concept Utterly Obsolete
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest