Making a projectile that's blocked by lines that are set to
					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.
	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.
- 
				TheBladeRoden
- Posts: 13
- Joined: Thu Jan 20, 2011 10:33 pm
Making a projectile that's blocked by lines that are set to
block players?
So this mod has maps with fences that are set to block players and projectiles pass through it as normal. Problem is, I have a projectile that acts like a teleport beacon, so one can easily use it to get outside the map. So is there a way to get a projectile that is blocked by walls that are set to only block players?
Let's assume for argument's sake that editing the maps is out of the question.
			
			
									
						
										
						So this mod has maps with fences that are set to block players and projectiles pass through it as normal. Problem is, I have a projectile that acts like a teleport beacon, so one can easily use it to get outside the map. So is there a way to get a projectile that is blocked by walls that are set to only block players?
Let's assume for argument's sake that editing the maps is out of the question.
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: Making a projectile that's blocked by lines that are set
Presumebly, you could make the projectile inherit from PlayerPawn, though I'm not sure if that'll work or what the side effects would be.
			
			
									
						
										
						- 
				TheBladeRoden
- Posts: 13
- Joined: Thu Jan 20, 2011 10:33 pm
Re: Making a projectile that's blocked by lines that are set
The Missile flag negates it
			
			
									
						
										
						Re: Making a projectile that's blocked by lines that are set
I don't think there is a good way to do that, no. If you find a solution, you might want to check with the devs whether than solution can be trusted to persist throughout future versions of zdoom. Even if you do find a solution that provides the desired result, I think it will involve a change to the map.
EDIT: This is one of the first times I've actually tried to glean some serious map format information from the wiki. Much harder than finding ACS and decorate information; although it might be my lacking familiarity with the subject. List of linedef properties?
			
			
									
						
										
						EDIT: This is one of the first times I've actually tried to glean some serious map format information from the wiki. Much harder than finding ACS and decorate information; although it might be my lacking familiarity with the subject. List of linedef properties?
Spoiler: You could always try
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: Making a projectile that's blocked by lines that are set
That won't work, though; +MISSILE is what make the projectile die on hitting something and what gives it the constant motion trait. Without it, it won't act like a projectile.
			
			
									
						
										
						Re: Making a projectile that's blocked by lines that are set
Is there any way to have a missile trigger a linespecial and be the activator? Normally, it would make its "target" (creator) the activator. Player-blocking lines could have a script (execute with result for immediate effect) that calls "SetActorState(0, "CrossedPlayerLine"), which would have no effect unless the state is defined in decorate. That way, any projectile needing to act in a specific manner when crossing player lines could implement the behaviour through that state.
If there is no way to make the projectile an activator... Maybe that's a feasible feature. I will not experiment on my own right now, as I only just got my environment ready for source code modification; my modding setup isn't ready yet.
			
			
									
						
										
						If there is no way to make the projectile an activator... Maybe that's a feasible feature. I will not experiment on my own right now, as I only just got my environment ready for source code modification; my modding setup isn't ready yet.
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: Making a projectile that's blocked by lines that are set
Yes, there is. I believe it's a MAPINFO option.
			
			
									
						
										
						Re: Making a projectile that's blocked by lines that are set
That may be good enough. It depends on the map. Maps with missile-triggered linedefs that need to be activated by the shooter can not make use of that feature, can they? TheBladeRoden, does this look like a solution to you?
Use mapinfo (or some other trick) so that missiles are the activators when they trigger linedefs.
Make the fence linedefs trigger a script (use the special "execute with result").
Put a command in the script that only affects actors that need to react when entering an area the player cannot enter.
* You can give all such actors (in DECORATE) a state called CrossedPlayerLine, and set the activator's state to CrossedPlayerLine in ACS. -- SetActorState(0, "CrossedPlayerLine"); -- does nothing if that state is not defined.
In CrossedPlayerLine you could reverse xy-velocity, blow up the actor, remove it, or replace it with a similar (non-teleport-enabling) actor moving along the same vector.
			
			
									
						
										
						Use mapinfo (or some other trick) so that missiles are the activators when they trigger linedefs.
Make the fence linedefs trigger a script (use the special "execute with result").
Put a command in the script that only affects actors that need to react when entering an area the player cannot enter.
* You can give all such actors (in DECORATE) a state called CrossedPlayerLine, and set the activator's state to CrossedPlayerLine in ACS. -- SetActorState(0, "CrossedPlayerLine"); -- does nothing if that state is not defined.
In CrossedPlayerLine you could reverse xy-velocity, blow up the actor, remove it, or replace it with a similar (non-teleport-enabling) actor moving along the same vector.

