How do I fix monsters not working with portals?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.

How do I fix monsters not working with portals?

Postby stan423321 » Wed Sep 06, 2017 8:39 am

I have recently been experimenting with altering small fragments of a map during runtime by dynamically setting up interactive line portals to prefabricated areas. This unfortunately messes with A_Chase monsters, since they follow the players by looking in their direction, map coordinate wise. So a monster that is behind a portal can, generally, end up going into a completely random direction after getting its sights on you. It doesn't have to, but it usually does.

The thing is, I think A_Chase would generally work well enough as is if I could supply my very own difference vector between player and the monster, or alternatively my very own player position instead of the true one. Is there any obvious method of doing this, especially something involving ZScript? The only thing that comes to mind is setting up some sort of fake target actor for every combination of map-misplaced room and a player, but that sounds like an overkill if I have a non-single digit amount of rooms, plus maybe it wouldn't even be working? I am assuming here I can mod the monster's code and supply my own A_Chase equivalent, though a method not involving this would obviously be better.
stan423321
 
Joined: 25 Mar 2014

Re: How do I fix monsters not working with portals?

Postby Rachael » Wed Sep 06, 2017 12:43 pm

My first question is, have you tried using Static (Eternity) style portals? If you do that, then A_Chase should become portal-aware and monsters will chase you through them like normal. They can also attack you from the other side of a portal, as well, and dynamic lights should also render through the other side.
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: How do I fix monsters not working with portals?

Postby Amuscaria » Wed Sep 06, 2017 2:34 pm

Rachael wrote:My first question is, have you tried using Static (Eternity) style portals? If you do that, then A_Chase should become portal-aware and monsters will chase you through them like normal. They can also attack you from the other side of a portal, as well, and dynamic lights should also render through the other side.


Oh Snap... Gotta make use of this.
User avatar
Amuscaria
The Sentient Mushroom
 
Joined: 26 Jul 2004
Location: Growing from mycelium near you.

Re: How do I fix monsters not working with portals?

Postby stan423321 » Thu Sep 07, 2017 12:49 am

I admit I have not experimented with static line portals, but according to wiki, they are mutually exclusive with setting up the connection during runtime, as you cannot run Line_SetPortalTarget on them, and Line_SetPortal appears to work exclusively during map loading, at which point target is constant. So this feature doesn't sound fit for described purposes.
stan423321
 
Joined: 25 Mar 2014

Re: How do I fix monsters not working with portals?

Postby Rachael » Thu Sep 07, 2017 2:55 am

Then, unfortunately, what you want is not currently available to the engine.
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: How do I fix monsters not working with portals?

Postby Graf Zahl » Thu Sep 07, 2017 4:09 am

Keep in mind that in order for the AI to be able to look through portals, the offset needs to be static throughout the level's duration and that's simply not doable with portals that can be retargeted.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: How do I fix monsters not working with portals?

Postby stan423321 » Thu Sep 07, 2017 9:09 am

Well, if that's the case, then wiki description of interactive portals is wrong at the moment - it explicitly says monsters looking through them work. I'll try to fix that soonish, but someone more knowledgeable with the specifics should probably refine the portals article then, as I will just delete the erroneous part.
stan423321
 
Joined: 25 Mar 2014


Return to Editing (Archive)

Who is online

Users browsing this forum: No registered users and 2 guests