Shotgun guy's coding help

Ask about ACS, DECORATE, ZScript, or any other scripting questions 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.

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!)
User avatar
Shotgun guy
Posts: 73
Joined: Sat Mar 24, 2018 5:35 am
Location: Hungary

Shotgun guy's coding help

Post by Shotgun guy »

Hi members! I thinked,that I joined to here. But I finally joined because need technic help. I create too Doom wads. I already released a 2 level wad (Beta). Now I'm working on Hell Theme wad and to it help. I'd like to ask,that a given level player start with Melee and not pistol. Plus Music change on Boss level. I read Music Changer in ACS,but I use Decorate.
User avatar
orangeninja27
Posts: 9
Joined: Wed Mar 21, 2018 2:42 pm

Re: Shotgun guy's coding help

Post by orangeninja27 »

I assume you would like help making the player start with specific items, right? If so, you're in luck - it's actually very easy.

First, you need to have a decorate.txt file in your WAD/PK3. Got that done? Good!

All you need to do now is type the following code, and replace YourPlayerClass with the name you want your actor to be (ensure that name isn't taken already by another actor) and Item with the actor name of the item you want the player to start with.

Code: Select all

Actor YourPlayerClass : DoomPlayer 
{
	Player.StartItem Item
}
/* Note that, with inheritance, if you define Player.StartItem the player will only start with the defined items. If you want the player to spawn with more items, just add Player.StartItem again. By the way, this is how you make a multi-line comment in DECORATE. */
Now that you have a custom player class, you need to make a MAPINFO lump like so:

Code: Select all

gameinfo
{
	playerclasses = "YourPlayerClass"
}
// This code tells the game to only use your specified player class.
That's it, you're done! I can't help with the music changing, sadly. I believe it is out of the capabilities of DECORATE alone, you might need to add things to the map or use ZScript instead.

P.S: Sorry if this was confusing, I'm not very good at explaining things. By the way, is English your second language?
User avatar
Shotgun guy
Posts: 73
Joined: Sat Mar 24, 2018 5:35 am
Location: Hungary

Re: Shotgun guy's coding help

Post by Shotgun guy »

orangeninja27 wrote:I assume you would like help making the player start with specific items, right? If so, you're in luck - it's actually very easy.

First, you need to have a decorate.txt file in your WAD/PK3. Got that done? Good!

All you need to do now is type the following code, and replace YourPlayerClass with the name you want your actor to be (ensure that name isn't taken already by another actor) and Item with the actor name of the item you want the player to start with.

Code: Select all

Actor YourPlayerClass : DoomPlayer 
{
	Player.StartItem Item
}
/* Note that, with inheritance, if you define Player.StartItem the player will only start with the defined items. If you want the player to spawn with more items, just add Player.StartItem again. By the way, this is how you make a multi-line comment in DECORATE. */
Now that you have a custom player class, you need to make a MAPINFO lump like so:

Code: Select all

gameinfo
{
	playerclasses = "YourPlayerClass"
}
// This code tells the game to only use your specified player class.
That's it, you're done! I can't help with the music changing, sadly. I believe it is out of the capabilities of DECORATE alone, you might need to add things to the map or use ZScript instead.

P.S: Sorry if this was confusing, I'm not very good at explaining things. By the way, is English your second language?
Yes. E.G:Doom 2 - Map1 (Melee) and From Map2 (Pistol). Yes,English my second lanuage.
User avatar
orangeninja27
Posts: 9
Joined: Wed Mar 21, 2018 2:42 pm

Re: Shotgun guy's coding help

Post by orangeninja27 »

You'll probably need to use ACS to make the player gain specific items when they enter a map. I have no idea how to use ACS, so I can't help, sadly.
User avatar
Shotgun guy
Posts: 73
Joined: Sat Mar 24, 2018 5:35 am
Location: Hungary

Re: Shotgun guy's coding help

Post by Shotgun guy »

I added what you send,but unfortunately I got so error on Zdoom starting:
You do not have the required permissions to view the files attached to this post.
User avatar
orangeninja27
Posts: 9
Joined: Wed Mar 21, 2018 2:42 pm

Re: Shotgun guy's coding help

Post by orangeninja27 »

ZDoom is outdated. You should be using GZDoom, and you can't use existing actor names. Check the wiki to ensure you're not just duplicating existing actors.
User avatar
Shotgun guy
Posts: 73
Joined: Sat Mar 24, 2018 5:35 am
Location: Hungary

Re: Shotgun guy's coding help

Post by Shotgun guy »

So I did in DECORATE and worked on ZDoom:

Code: Select all

//Player

//===========================================================================
//
// Doom Guy (Marine)
//
//===========================================================================

ACTOR MarinePlayer : DoomPlayer
{
   Player.StartItem "Fist"
}
So I can do,that from MAP2 I start with Pistol or I need to do in ACS?
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Shotgun guy's coding help

Post by ramon.dexter »

Use gzdoom, zdoom is outdated!!!
User avatar
Shotgun guy
Posts: 73
Joined: Sat Mar 24, 2018 5:35 am
Location: Hungary

Re: Shotgun guy's coding help

Post by Shotgun guy »

ramon.dexter wrote:Use gzdoom, zdoom is outdated!!!
Frankly speaking I don't like GZDoom.
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Shotgun guy's coding help

Post by ramon.dexter »

Yeah, I expected this response. And do you have sme real reason why you dont want to use gzdoom?

For your information - zdoom is outdated - that means it is not developed and not supported. That's the reason why we are telling you to use gzdoom instead.

Also, which you haven't noticed, you can already use software rendering in gzdoom (if the point is how it looks). So, there is really no point in staying on old, outdated, not supported zdoom.
User avatar
Shotgun guy
Posts: 73
Joined: Sat Mar 24, 2018 5:35 am
Location: Hungary

Re: Shotgun guy's coding help

Post by Shotgun guy »

To Me the Graphic quaility don't like because so not good and not original Doom graphic style.
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm

Re: Shotgun guy's coding help

Post by Mikk- »

You can still use the software renderer in GzDOOM- why do people never realise this?
User avatar
Shotgun guy
Posts: 73
Joined: Sat Mar 24, 2018 5:35 am
Location: Hungary

Re: Shotgun guy's coding help

Post by Shotgun guy »

Software renderer? I didn't hear yet this in my life.
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm

Re: Shotgun guy's coding help

Post by Mikk- »

Yes, the Software renderer in GzDOOM is the same (or similar, I can't remember) to the renderer in ZDOOM. In the settings menu there is a "Change Rendering Output" menu, there you can choose the OpenGL renderer or the Software renderer.
User avatar
Shotgun guy
Posts: 73
Joined: Sat Mar 24, 2018 5:35 am
Location: Hungary

Re: Shotgun guy's coding help

Post by Shotgun guy »

Mikk- wrote:Yes, the Software renderer in GzDOOM is the same (or similar, I can't remember) to the renderer in ZDOOM. In the settings menu there is a "Change Rendering Output" menu, there you can choose the OpenGL renderer or the Software renderer.
I don't have renderer in my Doom wad. Good to Me normal Doom renderer. I like to ask,that how to works the LOCKDEFS function. I learned,that 132-134 Door use 2 key. But 1-6 Locks this I can't do.

Code: Select all

//
// Doom Locks 
//
ClearLocks

Lock 1 Doom
{
	//$Title "Black skull"
	RedCard
	Message "$PD_REDC"
	RemoteMessage "$PD_REDCO"
	Mapcolor 0 0 0
}


Lock 2 Doom
{
	//$Title "Green skull"
	BlueCard
	Message "$PD_BLUEC"
	RemoteMessage "$PD_BLUECO"
	Mapcolor 0 255 0
}


Lock 3 Doom
{
	//$Title "White skull"
	YellowCard
	Message "$PD_YELLOWC"
	RemoteMessage "$PD_YELLOWCO"
	Mapcolor 255 255 255
}


Lock 4 Doom
{
	//$Title "Red skull"
	RedSkull
	Message "$PD_REDS"
	RemoteMessage "$PD_REDSO"
	Mapcolor 255 0 0
}


Lock 5 Doom
{
	//$Title "Blue skull"
	BlueSkull
	Message "$PD_BLUES"
	RemoteMessage "$PD_BLUESO"
	Mapcolor 0 0 255
}


Lock 6 Doom
{
	//$Title "Yellow skull"
	YellowSkull
	Message "$PD_YELLOWS"
	RemoteMessage "$PD_YELLOWSO"
	Mapcolor 255 255 0
}


Lock 129 Doom
{
	//$Title "Any red or black skull"
	Any { RedCard RedSkull }
	Message "$PD_REDK"
	RemoteMessage "$PD_REDO"
	Mapcolor 255 128 128
}


Lock 130 Doom
{
	//$Title "Any blue or green skull"
	Any { BlueCard BlueSkull }
	Message "$PD_BLUEK"
	RemoteMessage "$PD_BLUEO"
	Mapcolor 0 255 255
}


Lock 131 Doom
{
	//$Title "Any yellow or white skull"
	Any { YellowCard YellowSkull }
	Message "$PD_YELLOWK"
	RemoteMessage "$PD_YELLOWO"
	Mapcolor 255 255 128
}


Lock 132 Doom
{
	//$Title "Red or black skull"
	Any { RedCard RedSkull }
	Message "$PD_REDK"
	RemoteMessage "$PD_REDO"
	Mapcolor 255 128 128
}


Lock 133 Doom
{
	//$Title "Blue or green skull"
	Any { BlueCard BlueSkull }
	Message "$PD_BLUEK"
	RemoteMessage "$PD_BLUEO"
    Mapcolor 0 255 255
}


Lock 134 Doom
{
	//$Title "Yellow or white skull"
	Any { YellowCard YellowSkull }
	Message "$PD_YELLOWK"
	RemoteMessage "$PD_YELLOWO"
	Mapcolor 255 255 128
}

Lock 100
{
	//$Title "Any key"
	Message "$PD_ANY"
	RemoteMessage "$PD_ANYOBJ"
	Mapcolor 128 128 255
}

Lock 228
{
	//$Title "Any key"
	Message "$PD_ANY"
	RemoteMessage "$PD_ANYOBJ"
	Mapcolor 128 128 255
}

Lock 229 Doom
{
	//$Title "One of each color"
	Any { BlueCard BlueSkull }
	Any { YellowCard YellowSkull }
	Any { RedCard RedSkull }
	Message "$PD_ALL3"
	RemoteMessage "$PD_ALL3O"
}

Lock 101 Doom
{
	//$Title "All keys"
	BlueCard 
	BlueSkull
	YellowCard 
	YellowSkull
	RedCard 
	RedSkull
	Message "$PD_ALL6"
	RemoteMessage "$PD_ALL6O"
}

Return to “Scripting”