New here, need some help/advice for Modding

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

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!)
Post Reply
User avatar
MileenaKahnumm
Posts: 5
Joined: Mon Jan 07, 2019 2:48 pm
Contact:

New here, need some help/advice for Modding

Post by MileenaKahnumm »

Hello everyone,
I'm new here just joined, I'm a novice/beginner in the DOOM modding scene. Watched a few tutorials on YouTube about Slade 3(mostly) mainly the coding aspect is my main concern. I got inspired to create my own mod for DOOM, nothing too complex just something simple since I'm just starting out for the first time. What am I trying to create? Just a simple weapons replacement mod. I'm using resources readily available made by ppl in the DOOM Community I do plan on crediting ppl who made said resources etc. and asking around if it's ok to use stuff unless there's a resources thread where the poster says it's ok to use their stuff. The mod I'm planning on making is intended for personal use(me only) maybe later I'll post up for everyone to play.

Anywho I've hit a snag(to be expected) since I'm a beginner.
I've attached my .pk3 file so you can take a look at it and go through it with a fine tooth comb and see what I've done that is incorrect. What I was trying to do was replace the ChainGun with an Assault Rifle and test out spawning it in DOOM and picking it up. No Fire States have been coded in yet, that's gonna, be the next step.
GZError.PNG
Attachments
KahnummMod.pk3
(137.75 KiB) Downloaded 17 times
User avatar
Cherno
Posts: 1309
Joined: Tue Dec 06, 2016 11:25 am

Re: New here, need some help/advice for Modding

Post by Cherno »

Your first actor definition, BDGUY, has one too many braces.

Code: Select all

ACTOR BDGUY: DoomPlayer  
{
Player.WeaponSlot 1, Fist, Chainsaw
Player.WeaponSlot 2, Pistol
Player.WeaponSlot 3, Shotgun, SuperShotgun
Player.WeaponSlot 4, Chaingun
Player.WeaponSlot 5, RocketLauncher
Player.WeaponSlot 6, PlasmaRifle
Player.WeaponSlot 7, BFG9000


  }   <------- THIS ONE :)
}
needs to be

Code: Select all

ACTOR BDGUY: DoomPlayer  
{
Player.WeaponSlot 1, Fist, Chainsaw
Player.WeaponSlot 2, Pistol
Player.WeaponSlot 3, Shotgun, SuperShotgun
Player.WeaponSlot 4, Chaingun
Player.WeaponSlot 5, RocketLauncher
Player.WeaponSlot 6, PlasmaRifle
Player.WeaponSlot 7, BFG9000

}
For each opening brace {, there needs to be exactly one closing brace }.
User avatar
MileenaKahnumm
Posts: 5
Joined: Mon Jan 07, 2019 2:48 pm
Contact:

Re: New here, need some help/advice for Modding

Post by MileenaKahnumm »

@Cherno thanks I'll Keep that in mind(Noted)

Script error, "KahnummMod.pk3:decorate" line 52:
Missing token (unexpected end of file).

Another problem.

heres my code-

Code: Select all

ACTOR BDGUY: DoomPlayer  
{
Player.WeaponSlot 1, Fist, Chainsaw
Player.WeaponSlot 2, Pistol
Player.WeaponSlot 3, Shotgun, SuperShotgun
Player.WeaponSlot 4, Chaingun
Player.WeaponSlot 5, RocketLauncher
Player.WeaponSlot 6, PlasmaRifle
Player.WeaponSlot 7, BFG9000

}


ACTOR UACRifle: DoomWeapon Replaces Chaingun 
{
Weapon.SlotNumber 4
Weapon.AmmoUse 1 
Weapon.AmmoGive 30
Weapon.AmmoType "Clip"
Tag "UAC Rifle"

 


Inventory.PickupSound "weapon/WEAPPK"
Inventory.PickupMessage "You Got The UAC Assault Rifle!"  

States 
{

Spawn:
RIFS A -1
stop

Select:
RIFG A 1  A_Raise
loop

Deselect:
RIFG A 1 A_Lower
loop

Ready:
RIFG A 1 A_WeaponReady
loop

Fire:
RIFF B 2 BRIGHT A_PlaySound("weapon/RIFFIRE",2)
RIFF C 1 BRIGHT A_FireBullets(0,0,1,4)
RIFF B 3 
Goto Ready
}
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: New here, need some help/advice for Modding

Post by wildweasel »

Same problem as before, although now the problem is that you have not enough closing braces. There is an opening brace after the ACTOR line, and another opening the States block - you need to close both of them at the end of the definition. Always close everything that you open.

It helps a lot if you indent any sections of code that go between braces, so you can visualize how deep the code goes, so to speak.
User avatar
MileenaKahnumm
Posts: 5
Joined: Mon Jan 07, 2019 2:48 pm
Contact:

Re: New here, need some help/advice for Modding

Post by MileenaKahnumm »

wildweasel wrote:Same problem as before, although now the problem is that you have not enough closing braces. There is an opening brace after the ACTOR line, and another opening the States block - you need to close both of them at the end of the definition. Always close everything that you open.

It helps a lot if you indent any sections of code that go between braces, so you can visualize how deep the code goes, so to speak.
Always close everything you open and indent (Noted) not sure but think I did it (close both of them)
I try my best to keep everything clean and organized so its easy to read.

got this Error -
Script error, "KahnummMod.pk3:decorate" line 27:
"Select:" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 28:
"UACG" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 28:
"A" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 28:
"1" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 28:
"A_Raise" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 29:
"loop" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 31:
"Deselect:" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 32:
"UACG" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 32:
"A" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 32:
"1" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 32:
"A_Lower" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 33:
"loop" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 35:
"Ready:" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 36:
"UACG" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 36:
"A" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 36:
"1" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 36:
"A_WeaponReady" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 37:
"loop" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 39:
"Fire:" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 40:
"UACF" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 40:
"B" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 40:
"2" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 40:
"A_PlayWeaponSound(" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 40:
"weapon/RIFFIRE" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 40:
")" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 41:
"UACF" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 41:
"C" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 41:
"3" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 41:
"A_FireBullets(0,0,1,4)" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 42:
"Goto" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 42:
"Ready" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 44:
"Spawn:" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 45:
"UACS" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 45:
"A" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 45:
"-1" is an unknown flag

Script error, "KahnummMod.pk3:decorate" line 46:
"stop" is an unknown flag


Execution could not continue.

Script error, "KahnummMod.pk3:decorate" line 47:
States does not define any animation frames

attached my .pk3 file(newer one) have look when you have the time to.
Attachments
KahnummMod.pk3
(137.84 KiB) Downloaded 21 times
User avatar
ramon.dexter
Posts: 1519
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: New here, need some help/advice for Modding

Post by ramon.dexter »

No, you really dont understand what we are trying to tell you. And based on what you did in this .pk3, you dont have any skill in coding. Sorry for being hard on you, I'm just that :)

So, what we mean by indent? Start writing in any text editor and hit tab. See? That's indent. Tho you can use spacebar for indenting, I like indenting by tab - its better visible.
Next, opening and closing braces. Here is a small example:

Code: Select all

actor abcd : efgh
{
  states
  {
  state:
  }
}
See? The states are inside the actor. The error spewing is caused by the problem that you actually put "States" outside of the actor definition. So, instead of hurrying on doom modding, you should really learn this coding basics. Because you are unable to mod anything without this basic knowledge.

Here is corrected decorate from you file.

Code: Select all

ACTOR BDGUY: DoomPlayer  
{
    Player.WeaponSlot 1, Fist, Chainsaw
    Player.WeaponSlot 2, Pistol
    Player.WeaponSlot 3, Shotgun, SuperShotgun
    Player.WeaponSlot 4, Chaingun
    Player.WeaponSlot 5, RocketLauncher
    Player.WeaponSlot 6, PlasmaRifle
    Player.WeaponSlot 7, BFG9000
}


ACTOR UACRifle: Weapon Replaces Chaingun 
{
    Weapon.SlotNumber 4
    Weapon.AmmoUse 1 
    Weapon.AmmoGive 30
    Weapon.AmmoType "Clip"
    Tag "UAC Rifle"
    Inventory.PickupSound "weapon/WEAPPK"
    Inventory.PickupMessage "You Got The UAC Assault Rifle!"  

    States 
    {
        Select:
        UACG A 1  A_Raise
        loop

        Deselect:
        UACG A 1 A_Lower
        loop

        Ready:
        UACG A 1 A_WeaponReady
        loop

        Fire:
        UACF B 2 BRIGHT A_PlayWeaponSound("weapon/RIFFIRE")
        UACF C 3 BRIGHT A_FireBullets(0,0,1,4)
        Goto Ready

        Spawn:
        UACS A -1
        stop
    }
}
User avatar
MileenaKahnumm
Posts: 5
Joined: Mon Jan 07, 2019 2:48 pm
Contact:

Re: New here, need some help/advice for Modding

Post by MileenaKahnumm »

ramon.dexter wrote:No, you really dont understand what we are trying to tell you. And based on what you did in this .pk3, you dont have any skill in coding. Sorry for being hard on you, I'm just that :)

So, what we mean by indent? Start writing in any text editor and hit tab. See? That's indent. Tho you can use spacebar for indenting, I like indenting by tab - its better visible.
Next, opening and closing braces. Here is a small example:

Code: Select all

actor abcd : efgh
{
  states
  {
  state:
  }
}
See? The states are inside the actor. The error spewing is caused by the problem that you actually put "States" outside of the actor definition. So, instead of hurrying on doom modding, you should really learn this coding basics. Because you are unable to mod anything without this basic knowledge.

Here is corrected decorate from you file.

Code: Select all

ACTOR BDGUY: DoomPlayer  
{
    Player.WeaponSlot 1, Fist, Chainsaw
    Player.WeaponSlot 2, Pistol
    Player.WeaponSlot 3, Shotgun, SuperShotgun
    Player.WeaponSlot 4, Chaingun
    Player.WeaponSlot 5, RocketLauncher
    Player.WeaponSlot 6, PlasmaRifle
    Player.WeaponSlot 7, BFG9000
}


ACTOR UACRifle: Weapon Replaces Chaingun 
{
    Weapon.SlotNumber 4
    Weapon.AmmoUse 1 
    Weapon.AmmoGive 30
    Weapon.AmmoType "Clip"
    Tag "UAC Rifle"
    Inventory.PickupSound "weapon/WEAPPK"
    Inventory.PickupMessage "You Got The UAC Assault Rifle!"  

    States 
    {
        Select:
        UACG A 1  A_Raise
        loop

        Deselect:
        UACG A 1 A_Lower
        loop

        Ready:
        UACG A 1 A_WeaponReady
        loop

        Fire:
        UACF B 2 BRIGHT A_PlayWeaponSound("weapon/RIFFIRE")
        UACF C 3 BRIGHT A_FireBullets(0,0,1,4)
        Goto Ready

        Spawn:
        UACS A -1
        stop
    }
}
Thanks for your input I'll make note of the important bits you mentioned and it's all good no problem, I'm well aware that I have no skill in coding(I'm a NEWBIE) I'll practice on the coding aspect for awhile. I know I can't make a mod and learn all this overnight it will take time.
Post Reply

Return to “Scripting”