Advanced Search

Author Topic: How to Create a Bitchin' Class  (Read 4534 times)

0 Members and 1 Guest are viewing this topic.

September 06, 2016, 04:30:23 PM
Read 4534 times

Offline Xhatahx

  • Standard Member

  • *sregnif sevaelretni* stenet wef a evah I
  • Date Registered: September 03, 2016, 07:21:47 AM

    • View Profile
How to Create a Bitchin' Class
« on: September 06, 2016, 04:30:23 PM »
Ya ready? Because I sure aren't!

Part 1: You Want Class?
Part 2: Buy One, Get Any Amount For Free
Part 3: I Make Tools That Kill Tools
Part 4: Mega Man Doesn't Like Thieves
Part 5: Wait, The Class Isn't There!

Part 1: You Want Class?
Then go buy a top hat.

Just kidding. Look at this code while I go to sleep.
Code: [Select]
actor DudeMan : PlayerPawn
{
player.displayname "dudeman" //This is where you place the class name.
player.soundclass "megaman" //Don't change this unless you know what you're doing.
player.damagescreencolor "yellow"
player.forwardmove 0.8, 0.8
player.sidemove 0.78, 0.78 //Multiply these "move" values by some number to modify the speed. If you want then you can change the ratio between the speeds.
player.jumpz 10 //This constant changes jumping. Do note that this number is squared by the engine, so if you want a class that jumps twice as high, you need to set it to 14, not 20.
player.colorrange 0 0
player.startitem "DudeBlasterWep" //These are the weapons, ammo, and maybe flags you start with.
player.startitem "DudeAmmo", 28
mass 9999 //Don't change this unless you know what you're doing.
gravity 0.8 //Wheee!
+NODAMAGETHRUST
+DONTBLAST
+NOBLOOD
+QUICKTORETALIATE
damagefactor "Dummy", 0.0 //Don't change this. At all.
damagefactor "Normal", 1.0 //This is how much damage the player takes. Use this instead of health values unless you know what you're doing.
//It's recommended that if your class has a high speed then it should have a higher damage factor and a class with lower damage factor should have lower speed. Don't stray away from this formula unless you know what you're doing.
damagefactor "DudeKiller", 1.5 //Remember to include weaknesses to freshen up your class.
Player.MaxSkinSizeFactor 0, 0
scale 2.5
States //You can usually do states by copying the Megaman class' states, Ctrl+F and replace PLY1 with your skin, and then changing what's needed.
// If you're trying to make multiple classes, look for chapter 2.
{
Spawn:
DUDE A 0
DUDE B 1
DUDE A 1
Goto Spawn+2
See:
DUDE BCDE 5
Goto Spawn
Missile:
DUDE F 5
DUDE G 4
Goto Spawn+2
<too much time later>
}
} //If you forget these, then you're an idiot.

Yawn... Huh? Oh, right. To make a class, you have to- wait, I've already done it?

Part 2: Buy One, Get Any Amount For Free
Ya wanna make multiple classes? Good. Some sentences ago I told you to replace PLY1 in the class code with your skin of choice. If you want to make a base class, replace PLY1 with "----", quotation marks included, and don't change the defense, speed, and jump values. Then when you make another class...
Code: [Select]
actor DudeKiller : BaseClass //I hope you can follow this. If you can't, go back to the first chapter and read closer.
{
player.displayname "dudekiller"
player.forwardmove 1.12, 1.12
player.sidemove 1.09, 1.09
player.jumpz 14
player.startitem "DudeKillerWep"
player.startitem "DudeKillerAmmo", 28
player.startitem "CanCopy" //Remember this. It'll be important in chapter 4.
damagefactor "Normal", 1.5
damagefactor "DudeKillerKiller", 1.4 //This doesn't decrease the damage by 10%, it multiplies it by 1.4, so in total it will be 2.1 times more damaging than normal.
States
{
Spawn:
DKIL A 0 //Remember to include a skin here. You only need to do it for the Spawn state, the engine takes care of the other states.
DKIL B 1
DKIL A 1
Goto Spawn+2
}
}

Part 3: I Make Tools That Kill Tools
Weapons, eh? Alrighty then. Weapons are the core of the class; they make it or break it. I recommend heading to this link(http://cutstuff.net/forum/index.php?topic=1815.0) before you check below for additional info.
Code: [Select]
actor DudeBlasterWep : BaseMM8BDMWep
{
Weapon.AmmoUse1 4 //This is how much ammo is used by the main fire, which might be used with...
/*
Weapon.AmmoUse2 8 //...this, which is how much ammo is used by the alt fire.
*/
Weapon.AmmoGive 28
Weapon.SlotNumber 1
Inventory.Pickupmessage "Why am I doing this?" //Because you're a pillock.
Obituary "%o was shot by %k's Dude Blaster." //This is the message at the top of the screen for deaths. %o is the killed, %k is the killer, %g is he/she/it, %h is him/her/it, and %p is his/her/its.
weapon.ammotype "DudeAmmo"
States
{
Spawn:
WEAP T 0
stop //Make sure it has a stop state just in case the server has "Drop Weapons" set.
Ready:
MCAR X 1
loop
Ready:
MCAR H 0 ACS_ExecuteAlways(998,0,173) //You can define a custom translation, but you shouldn't unless you know what you're doing.
MCAR H 20 A_WeaponReady //That value (10) is how many tics it takes to regenerate the ammo. With this value you'll regenerate all the ammo in 8 seconds.
MCAR H 0 A_GiveInventory("DudeAmmo",1) //Yes, regenerating ammo. It's common practice that classes regenerate ammo. That way, you won't have to mess with WEPACS to make the class pick up ammo. ACS is another tutorial's job.
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
MCAR H 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
MCAR H 1 A_Raise
Loop
//Don't mess with deselecting and selecting.
Fire:
MCAR H 0 A_JumpIfNoAmmo("NoAmmo") //If you don't have enough ammo, then you can't fire.
MCAR H 0 A_PlaySoundEx("weapon/cfire","Weapon") //This plays a sound.
MCAR H 0 A_FireCustomMissile("DudeBlast",0,1,8,0) //This fires a projectile. It has the format <projectile type>,<angle>,<does it use ammo?>,<horizontal offset>,<spawn height>.
//Every variable except for the projectile type is optional
MCAR IJ 5
MCAR H 15
MCAR H 0 A_Refire
Goto Ready+1
AltFire: //It's also common practice to have altfires to make the class more interesting.
MCAR H 0 A_PlaySoundEx("weapon/chargekick","Weapon")
MCAR IIJJ 2 A_ChangeVelocity(13,0,momz,CVF_RELATIVE)
MCAR J 20
Goto Ready+1
NoAmmo: //Don't mess with this except with the sprite unless you know what you're doing.
MCAR H 1 ACS_Execute(979,0)
Goto Ready+1
}
}

actor DudeAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28 //This should usually be 7, 14, 28, 56, or 112, but you can have other values.
+INVENTORY.IGNORESKILL
}

actor DudeBlast //This is the projectile.
{
PROJECTILE
scale 2.5
+RIPPER//This makes the projectile rip through players. It's usually not there.
Speed 30 //This is the... just guess.
Radius 8
Height 8
 //Every actor is shaped like a cylinder. These variables define the radius and height of the cylinder.
Damage (10) //The average health is 100. You might have to test this if you have the +RIPPER flag.
damagetype "DudeBlast" //This is the damage type. It should be used. You can use it to have unusual pain states.
Obituary "%o was shot by %k's Dude Blaster." //You can use this to make different projectiles have different obituaries.
States
{
Spawn:
MMFX D 4 //This is the sprite the projectile has.
loop
}
}

Part 4: Mega Man Doesn't Like Thieves
What a hypocrite.

This is easily the most tedious part of the process: making sure certain classes don't pick up copy weapons. Don't tell Max.
Code: [Select]
actor WepCGiver : CustomInventory
{
inventory.pickupmessage "Power up! I stole this from Max!" //Shut up!
inventory.pickupsound "weapon/weaponup"
inventory.amount 1
inventory.maxamount 1
inventory.respawntics 5
scale 2.0
States
{
Spawn:
TNT1 A 1
loop
Pickup:
DUST B 0 A_JumpIfInventory("CanCopy",1, "Pickup2")
fail
Pickup2:
DUST B 0 A_JumpIfInventory("MegaBusterC",1, "No")
DUST B 0 A_GiveInventory("MegaBusterC",1)
stop
No:
DUST B 0
fail
}
}

actor RollingCutterWepCGiver : WepCGiver replaces RollingCutterWep
{
Inventory.Pickupmessage "$PU_ROLLINGCUTTER"
States
{
Spawn:
WEA2 F 1
loop
Pickup2:
DUST B 0 A_JumpIfInventory("RollingCutterWepC",1, "No")
DUST B 0 A_GiveInventory("RollingCutterWepC",1)
stop
}
}

actor RollingCutterWepC : RollingCutterWep //Now you just have to do this about 80 more times! Have fun!
{
dropitem "RollingCutterWepCGiver"
States
{
Spawn:
TNT1 A 0
stop
}
}
Then you head over to SBARINFO.
Code: [Select]
IsSelected RollingCutterWepC{Drawbar"BARAMMO1", "BAREMPTY", Ammo1, vertical, 16, 8;} //Done!
IsSelected SuperArmWepC{Drawbar"BARAMMO2", "BAREMPTY", Ammo1, vertical, 16, 8;}
IsSelected IceSlasherWepC{Drawbar"BARAMMO3", "BAREMPTY", Ammo1, vertical, 16, 8;}
IsSelected HyperBombWepC{Drawbar"BARAMMO4", "BAREMPTY", Ammo1, vertical, 16, 8;}
IsSelected FireStormWepC{Drawbar"BARAMMO5", "BAREMPTY", Ammo1, vertical, 16, 8;}
IsSelected ThunderBeamWepC{Drawbar"BARAMMO6", "BAREMPTY", Ammo1, vertical, 16, 8;}
IsSelected TimeSlowWepC{DrawBar"BARAMMO7", "BAREMPTY", Ammo1, vertical, 16, 8;}
IsSelected OilSliderWepC{DrawBar"BARAMMO8", "BAREMPTY", Ammo1, vertical, 16, 8;
InInventory OilSliderFlag, 1 {DrawBar"BARFLS1", "NOBAR", OilSliderFlag, vertical, 16, 8;}}
<five hours of coffee and four hours of tears later>
IsSelected DudeBlasterWep{DrawBar"BARAMM58", "BAREMPTY", Ammo1, vertical, 16, 8;} //Done!
<later, in SBARAMMO.H...>
IsSelected DudeBlasterWep{Drawbar"VARAMM58", "VAREMPTY", Ammo1, horizontal, 58, 184;}//Done, but who uses horizontal bars?
And that's it! Oh wait...
Part 5: Wait, The Class Isn't There!
Oh bugger. If you can't find your class in the game, then make a KEYCONF file, and put your classes in:
Code: [Select]
clearplayerclasses
addplayerclass Dudeman
addplayerclass DudeKiller
addplayerclass DudeKillerKiller
<hopefully not much time later>
addplayerclass SnapeDude
addplayerclass KnifeDude
addplayerclass TopDude
addplayerclass MineDude
addplayerclass GlitchDude
addplayerclass MagicDude
And then you're done!
Of course, this is a boring ass class. Be creative! Look up random functions at http://zdoom.org/wiki/ and make your class around that, or look at other weapons' code to get ideas! The skyand the engine is the limit!

September 07, 2016, 10:36:25 PM
Reply #1

Offline LemonPig

  • Standard Member

  • Im Chompdoge
  • Date Registered: August 09, 2016, 06:46:02 PM

    • View Profile
Re: How to Create a Bitchin' Class
« Reply #1 on: September 07, 2016, 10:36:25 PM »
i will tell max