Weapons Creation
- NourPrince
- Topic Author
- Chaingunner
Less
More
- Posts: 63
10 years 2 weeks ago #1
by NourPrince
Weapons Creation was created by NourPrince
Hello, since i know that I'm new to the website but not the weapons coding. I have decided to put a tutorial with everything i wanted to make sure that people can now create weapons.
Okay, Lets first meet the Requirements:
Slade 3 *any version, doesn't matter*
Any photo editing programs *I use Paint.net*
and of course, ZDoom port or based poort *using Skulldronum *
Now lets go to the coding.
Before we start. we must put Decorate Marker, SNDINFO marker, Keyconf marker and SS_Start and SS_End.
But WTF is Decorate, SNDINFO, KEYCONF and even those SS_Start and SS_END?
Decorate is a base for the weapon to setting up the actor (behaviour) of the weapon
sndinfo is sound info (which is too obvious to say what does it do)
keycon is key configuration (Atleast this isnt captain obvious, that does setting up to make the weapon show)
SS_Start and SS_End is the Sprites markers, in which it makes the weapon show completely *not like invisible ones xd*
First, make a sprites *or get any sprites from Doom 2 for example* and lets analyze the name of it
The sprites from shotgun looks like this SHTGA0, but why does that named?
SHTG is 4 name for sprites (longer or less than the required name would make the zandronum saying fatal error)
The Alphabetic (A) next to name is called Sprite Frames (as like to make animations or to make something work but in easy way)
while on 0... i dont know :S but who cares just do the 0 thing cause its important.
Lets take our sample from my still made weapon "MS41". a Handy Assault Rifle *which it isnt 2 in 1 weapon -_-*
then view as text the decorate and put this code
Actor MS41 : Weapon
{
Simple. This code shows about the Actor name and the class of it *In which the class is Weapon while the Actor name is MS41*.
Now lets put the pickup message
Inventory.PickupMessage "You got the MS41 Handy Assault Rifle! Not sure why this name is new... BUT WHO THE *censored with duct tape* CARES?"
Of course i censored the word. but you can see it in Doom gameplay lets just say thats a bad word starting with F ,
This code does give you the pickup message when you picked the weapon.
Now after those 'hard" codes lets put some juice finally.
Weapon.AmmoType "Clip"
Weapon.AmmoGive 140
Weapon.SlotNumber 4
WOWOWOW! its too complicated to understand!! lets just seperate them and explain them what they were doing.
Weapon.AmmoType "Clip": This code shows what ammo are the weapon using. *you can do custom ammo, but lets use the Doom for easy learning *
Weapon.AmmoGive 140: This code can give you 140 ammo.
Weapon.SlotNumber 4: This is like assisstant to KeyConf.
Okay now thats better. Now lets go to the STATES codes. the States is the code manager that can manages the sprites witb behaviors they need to do.
first, lets do this code
States
{
so the port can analyze the states correctly.
Okay the things will be changed.
To make the weapon droppable, you need to do this code
Spawn:
MSPU A -1 A_Spawn
Stop
Woo... thats really weird, but lets explain it.
Spawn: is the dropped weapon state
MSPU A -1 A_Spawn
MSPU A is a sprite we learned it earlier, but A_Spawn is the behavior so we can see the weapon thats dropped.
Stop thing is the Sprite Conductor. Theres few conductors
Loop is the conductor that loops the sprite forever
Stop is the conductor that stops instantly. because of -1, we made it to stay until its picked
goto "state name" is the conductor whos can skip to the ordered state (in which its the advanced conductor)
Now lets go to the Ready state
Its simillar to Spawn state but ONLY not do with Pickup sprite. only do it with HUD sprite
Ready:
MSAL A 1 A_WeaponReady
Loop
Okay, I think the -1 is changed to 1, while the A_Spawn is replaced to A_WeaponReady, this A_WeaponReady is to make the Weapon ready to fire, selected, deselected. etc.
Speaking of Selected. theres a select state and deselect state.
Select:
MSAL A 1 A_Raise
Loop
Its just only A_Raise is there, to raise the weapon -_-
Deselect:
MSAL A 1 A_Lower
Loop
Same as select, except it lowers
Now, here comes the hardest part. The Fire State.
Fire state is the state in which the weapon fires using your left mouse button or your keyboard whenever what fire control you use.
Fire:
MSAL B 0 A_PlayWeaponSound ("MS41/Fire")
MSAL B 2 A_FireBullets(3, 3, 1, 7, "BulletPuff", 1)
MSAL C 2
goto Ready
Now thats some math we need to do *wait what?*
A_PlayWeaponSound is the behavior in which plays the sound from SNDINFO..
A_FireBullets is the main behavior for firing a weapon. it always comes to this (3, 3, 1, 7, "BulletPuff", 1).
To sum this we need for now to start with the 2 threes.
1st three is the Horizontal Accuracy, a left or right accuracy depends on what far you are.
2nd three is the Vertical Accuracy, a up or right accuracy. "depends on what far you are also xd"
The 1 after 2nd three is called number of bullets they need to shoot. *its obvious to do 1 because its assault rifle*.
The BulletPuff is the puff actor, its like where they act as a bullet rounds fired.
the 1 in final is Fire Activation
Oh wow.. my mind were about to explode, lets just save the decorate and take alittle rest.
Okay, now we did the decorate. I'm happy about that you are now a decorate master. but were not done yet. we need to make a keyconf.
View as text the Keyconf and then do like this
weaponsection "MS41"
addslotdefault 4 MS41
Weaponsection is the orginaziation for actor in which you can get it.
addslotdefault is the adder for slots (1 for fists, 2 for pistols, etc.)
The sndinfo is easy. just get any sound and rename them to smaller name and put this code on sndinfo
MS41/Fire MS41Fire.
This does the sound *duh*
Oh my.... *slept*
Okay. I hope you find this really helpful.
Note: Don't ever use the MS41 actor as your weapon just name it anything else.
Okay, Lets first meet the Requirements:
Slade 3 *any version, doesn't matter*
Any photo editing programs *I use Paint.net*
and of course, ZDoom port or based poort *using Skulldronum *
Now lets go to the coding.
Before we start. we must put Decorate Marker, SNDINFO marker, Keyconf marker and SS_Start and SS_End.
But WTF is Decorate, SNDINFO, KEYCONF and even those SS_Start and SS_END?
Decorate is a base for the weapon to setting up the actor (behaviour) of the weapon
sndinfo is sound info (which is too obvious to say what does it do)
keycon is key configuration (Atleast this isnt captain obvious, that does setting up to make the weapon show)
SS_Start and SS_End is the Sprites markers, in which it makes the weapon show completely *not like invisible ones xd*
First, make a sprites *or get any sprites from Doom 2 for example* and lets analyze the name of it
The sprites from shotgun looks like this SHTGA0, but why does that named?
SHTG is 4 name for sprites (longer or less than the required name would make the zandronum saying fatal error)
The Alphabetic (A) next to name is called Sprite Frames (as like to make animations or to make something work but in easy way)
while on 0... i dont know :S but who cares just do the 0 thing cause its important.
Lets take our sample from my still made weapon "MS41". a Handy Assault Rifle *which it isnt 2 in 1 weapon -_-*
then view as text the decorate and put this code
Actor MS41 : Weapon
{
Simple. This code shows about the Actor name and the class of it *In which the class is Weapon while the Actor name is MS41*.
Now lets put the pickup message
Inventory.PickupMessage "You got the MS41 Handy Assault Rifle! Not sure why this name is new... BUT WHO THE *censored with duct tape* CARES?"
Of course i censored the word. but you can see it in Doom gameplay lets just say thats a bad word starting with F ,
This code does give you the pickup message when you picked the weapon.
Now after those 'hard" codes lets put some juice finally.
Weapon.AmmoType "Clip"
Weapon.AmmoGive 140
Weapon.SlotNumber 4
WOWOWOW! its too complicated to understand!! lets just seperate them and explain them what they were doing.
Weapon.AmmoType "Clip": This code shows what ammo are the weapon using. *you can do custom ammo, but lets use the Doom for easy learning *
Weapon.AmmoGive 140: This code can give you 140 ammo.
Weapon.SlotNumber 4: This is like assisstant to KeyConf.
Okay now thats better. Now lets go to the STATES codes. the States is the code manager that can manages the sprites witb behaviors they need to do.
first, lets do this code
States
{
so the port can analyze the states correctly.
Okay the things will be changed.
To make the weapon droppable, you need to do this code
Spawn:
MSPU A -1 A_Spawn
Stop
Woo... thats really weird, but lets explain it.
Spawn: is the dropped weapon state
MSPU A -1 A_Spawn
MSPU A is a sprite we learned it earlier, but A_Spawn is the behavior so we can see the weapon thats dropped.
Stop thing is the Sprite Conductor. Theres few conductors
Loop is the conductor that loops the sprite forever
Stop is the conductor that stops instantly. because of -1, we made it to stay until its picked
goto "state name" is the conductor whos can skip to the ordered state (in which its the advanced conductor)
Now lets go to the Ready state
Its simillar to Spawn state but ONLY not do with Pickup sprite. only do it with HUD sprite
Ready:
MSAL A 1 A_WeaponReady
Loop
Okay, I think the -1 is changed to 1, while the A_Spawn is replaced to A_WeaponReady, this A_WeaponReady is to make the Weapon ready to fire, selected, deselected. etc.
Speaking of Selected. theres a select state and deselect state.
Select:
MSAL A 1 A_Raise
Loop
Its just only A_Raise is there, to raise the weapon -_-
Deselect:
MSAL A 1 A_Lower
Loop
Same as select, except it lowers
Now, here comes the hardest part. The Fire State.
Fire state is the state in which the weapon fires using your left mouse button or your keyboard whenever what fire control you use.
Fire:
MSAL B 0 A_PlayWeaponSound ("MS41/Fire")
MSAL B 2 A_FireBullets(3, 3, 1, 7, "BulletPuff", 1)
MSAL C 2
goto Ready
Now thats some math we need to do *wait what?*
A_PlayWeaponSound is the behavior in which plays the sound from SNDINFO..
A_FireBullets is the main behavior for firing a weapon. it always comes to this (3, 3, 1, 7, "BulletPuff", 1).
To sum this we need for now to start with the 2 threes.
1st three is the Horizontal Accuracy, a left or right accuracy depends on what far you are.
2nd three is the Vertical Accuracy, a up or right accuracy. "depends on what far you are also xd"
The 1 after 2nd three is called number of bullets they need to shoot. *its obvious to do 1 because its assault rifle*.
The BulletPuff is the puff actor, its like where they act as a bullet rounds fired.
the 1 in final is Fire Activation
Oh wow.. my mind were about to explode, lets just save the decorate and take alittle rest.
Okay, now we did the decorate. I'm happy about that you are now a decorate master. but were not done yet. we need to make a keyconf.
View as text the Keyconf and then do like this
weaponsection "MS41"
addslotdefault 4 MS41
Weaponsection is the orginaziation for actor in which you can get it.
addslotdefault is the adder for slots (1 for fists, 2 for pistols, etc.)
The sndinfo is easy. just get any sound and rename them to smaller name and put this code on sndinfo
MS41/Fire MS41Fire.
This does the sound *duh*
Oh my.... *slept*
Okay. I hope you find this really helpful.
Note: Don't ever use the MS41 actor as your weapon just name it anything else.
Please Log in or Create an account to join the conversation.
- NeuralStunner
- Administrator
Less
More
- Posts: 110
10 years 2 weeks ago - 10 years 2 weeks ago #2
by NeuralStunner
Replied by NeuralStunner on topic Weapons Creation
To put it plainly, this is not suitable for the site. There are so many issues, it would have to be completely rewritten.
The most glaring issue is outright misinformation. There is no "A_Spawn" function, and this (among other things) leaves me with severe doubts that you actually know much about the subject. This is entirely unacceptable!
Other problems: Too much rambling, poor structure, bad spelling and capitalization. All these make it even hard to follow or comprehend. Nobody is going to learn anything useful from this.
The most glaring issue is outright misinformation. There is no "A_Spawn" function, and this (among other things) leaves me with severe doubts that you actually know much about the subject. This is entirely unacceptable!
Other problems: Too much rambling, poor structure, bad spelling and capitalization. All these make it even hard to follow or comprehend. Nobody is going to learn anything useful from this.
Last edit: 10 years 2 weeks ago by NeuralStunner.
Please Log in or Create an account to join the conversation.
- Gez
- Administrator
Less
More
- Posts: 59
10 years 2 weeks ago #3
by Gez
Replied by Gez on topic Weapons Creation
Also you don't need KEYCONF at all.
Please Log in or Create an account to join the conversation.
- NourPrince
- Topic Author
- Chaingunner
Less
More
- Posts: 63
10 years 2 weeks ago #4
by NourPrince
Replied by NourPrince on topic Weapons Creation
Sorry..I'm not the one whos great at english. so im sorry. can someone delete this? :S
Please Log in or Create an account to join the conversation.
- NeuralStunner
- Administrator
Less
More
- Posts: 110
10 years 2 weeks ago #5
by NeuralStunner
Replied by NeuralStunner on topic Weapons Creation
No.NourPrince wrote: can someone delete this?
Please Log in or Create an account to join the conversation.
- Armstrong
- Visitor
10 years 2 weeks ago - 10 years 2 weeks ago #6
by Armstrong
Replied by Armstrong on topic Weapons Creation
Nourprince
Don't be like that now some of us don't take that bad language.
Making a tutorial its very important that you do not make any mistake on your video setup and you need to give a example how it works and how to do it right. you cannot be sloppy, you cannot be going to fast, and do not make it too difficult for somebody to understand.
Neutral Stunner is right though.
Nourprice
This is not the place.
Secondly you need to follow the institutions.
Don't make this out like we are giving you a hard time about it & were not ok we are just trying to help you understand some thanks. You be fine just take it one step at a time.
Don't be like that now some of us don't take that bad language.
Making a tutorial its very important that you do not make any mistake on your video setup and you need to give a example how it works and how to do it right. you cannot be sloppy, you cannot be going to fast, and do not make it too difficult for somebody to understand.
Neutral Stunner is right though.
Nourprice
This is not the place.
Secondly you need to follow the institutions.
Don't make this out like we are giving you a hard time about it & were not ok we are just trying to help you understand some thanks. You be fine just take it one step at a time.
Last edit: 10 years 2 weeks ago by Armstrong.
Please Log in or Create an account to join the conversation.