Decorate and Player Starts
Moderator: GZDoom Developers
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.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
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.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Decorate and Player Starts
This might be something people have known for years...or it might be ridiculous and impossible, but...
I want to work in new things with my mod so that they alter existing maps. I've learned that by giving things the same editor number as DM and Coop starts, I can make them show up in interesting places. But having a monster spawn attacking the player immediately when they start the level, from behind, is kind of lame. So is there a way to twist it so that the Player 1 Start has the editor number of, say, the Player 3 Start? I want to make it happen in Decorate, if possible.
I want to work in new things with my mod so that they alter existing maps. I've learned that by giving things the same editor number as DM and Coop starts, I can make them show up in interesting places. But having a monster spawn attacking the player immediately when they start the level, from behind, is kind of lame. So is there a way to twist it so that the Player 1 Start has the editor number of, say, the Player 3 Start? I want to make it happen in Decorate, if possible.
- Player701
-
- Posts: 1707
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: Decorate and Player Starts
You cannot do anything with player starts in DECORATE, since they are not actors. But you can use MAPINFO for that.
The above code swaps the editor numbers of Player 3 and Player 1 starts. Note that removing the Player 3 start reassignment will result in a duplicate Player 1 start appearing on the map, and a voodoo doll will be spawned in its place (and you will also not be able to control where exactly the actual player will spawn, because it is determined by the order of records in the map's THINGS lump). However, this will also break any single-player or 2-player-only maps that do not have a Player 3 start.
Code: Select all
DoomEdNums
{
3 = "$Player1Start"
1 = "$Player3Start"
}
Re: Decorate and Player Starts
Thanks! I should actually be able to do a lot with this. I'm aware this could cause unforeseen (and definitely foreseen) complications, but it's an experiment at the moment. Until I add custom maps to the mod, I want to be able to bring new Things into the picture and have them be as universal as possible. I'm thinking of grabbing WADs I like and making a custom megawad out of them (credit given to each mapper, of course). Then I can place the new Things in those maps.
Re: Decorate and Player Starts
Actually, so far it doesn't seem to be moving the Player 1 Start at all. I put the code in MapInfo. There are, however, no maps in there yet. But above it I have this:
and it works.
Code: Select all
gameinfo{
pickupcolor = "7F7FFF"
PlayerClasses = "GBADoomPlayer"
}
Re: Decorate and Player Starts
Since I've put an enemy in place of all the DM spawns, I guess all I really need is a way to prevent the one near the P1 Start from appearing. So far no luck with adding an invisible actor with an editor number of 11 that spawns them with a jumpifcloser function. I might not be able to do this.
- Player701
-
- Posts: 1707
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: Decorate and Player Starts
If the MAPINFO code to reassign player start editor numbers is not working for you, perhaps you're using an older version of GZDoom or Zandronum. In this case, there is probably no way to swap player starts at all, unless, in case you're using Zandronum, its developers implement it in future releases.rabidrage wrote:Actually, so far it doesn't seem to be moving the Player 1 Start at all. I put the code in MapInfo. There are, however, no maps in there yet. But above it I have this:
and it works.Code: Select all
gameinfo{ pickupcolor = "7F7FFF" PlayerClasses = "GBADoomPlayer" }
A_JumpIfCloser requires the calling actor to have a target, so your spawner actor should acquire one first before you can run any checks on it. You have to call A_Look once to have a chance of acquiring a target; also give your spawner the LOOKALLAROUND flag to ensure that players can be detected in a circle around it.Polly Besslewill wrote:Since I've put an enemy in place of all the DM spawns, I guess all I really need is a way to prevent the one near the P1 Start from appearing. So far no luck with adding an invisible actor with an editor number of 11 that spawns them with a jumpifcloser function. I might not be able to do this.
Code: Select all
actor TestSpawner
{
+LOOKALLAROUND
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Look
TNT1 A 0 A_JumpIfCloser(384, 2)
TNT1 A 0 A_SpawnItemEx("DoomImp")
TNT1 A 0
Stop
}
}
Re: Decorate and Player Starts
Okay. First off, I finally slowed down long enough to have the forum log me in automatically. I'm sure you're annoyed with me popping up under random names. 
Second, your actor works! The thing is that I'm not sure why. Like, I'm not sure how this gives the spawner a target where my attempts at a spawner don't. It doesn't seem to establish a state where the spawner doesn't spawn, nor does it seem to establish a target, unless the target is...2? But the player doesn't automatically have an actor number, so...
I'm so confused!
Obviously there is still a lot I don't understand about all this. For all that I've pulled off, sometimes I still feel clueless.

Second, your actor works! The thing is that I'm not sure why. Like, I'm not sure how this gives the spawner a target where my attempts at a spawner don't. It doesn't seem to establish a state where the spawner doesn't spawn, nor does it seem to establish a target, unless the target is...2? But the player doesn't automatically have an actor number, so...
I'm so confused!
Obviously there is still a lot I don't understand about all this. For all that I've pulled off, sometimes I still feel clueless.
- Player701
-
- Posts: 1707
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: Decorate and Player Starts
It's rather simple, actually. First, we call A_Look to look for players, so that if a player is near, the spawner acquires a target. (Since it has LOOKALLAROUND, it will look for players regardless of the direction it's facing.) Then, A_JumpIfCloser is called. If there is no target present, or if the target is too far away, the jump doesn't happen, so the execution continues normally and calls A_SpawnItemEx to spawn a monster. If a target is present and is also sufficiently close to the spawner, A_JumpItemEx jumps 2 states forward and lands on the last "TNT1 A 0" line, skipping the call to A_SpawnItemEx.rabidrage wrote:Second, your actor works! The thing is that I'm not sure why.
Re: Decorate and Player Starts
And now it all makes sense! Thank you very much. So A_Look will always by default have something look for players without setting the player as a target any other way?
- Player701
-
- Posts: 1707
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: Decorate and Player Starts
I'm not sure if I understood your question completely. A_Look indeed does look for players, and if it finds one, it sets the target pointer of the calling actor to that player and also jumps to the See state provided that it exists (the DECORATE code that I posted does not have one).
Re: Decorate and Player Starts
You answered it perfectly. I just wasn't sure if something had to be classed as a monster or not before its automatic target would the player, let alone anything at all.