Welcome, Guest. Please login or register. Did you miss your activation email?

* TUTORIAL SECTION RULES

This section is for SMOD TUTORIALS & GUIDES ONLY.
You may create a new topic in the appropriate area to share your tutorial. If you post anything off-topic here you will be temp-banned. This is so we don't hassle the moderators too much, they are volunteers.

If you need help with a tutorial, post a reply in its thread . Do not start a new topic for help here!

Author Topic: [SMOD2] Custom Zombies (npc_czombie)  (Read 3336 times)

0 Members and 1 Guest are viewing this topic.

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
[SMOD2] Custom Zombies (npc_czombie)
« on: November 24, 2009, 02:33:26 PM »
Real quick tutorial on the npc_czombie that the_author included with SMOD2. He actually has done a very good job on providing english explanations for everything, and for that I say thank you. I will go through the rest of the script when I have more time and update this tutorial.

If you are confused on how to get the custom zombies to not spawn a random type then here is how you do it (keep in mind that this is catered to mapadds).


CUSTOM ZOMBIE (npc_czombie) TUTORIAL

I. ZOMBIENAME

Code: [Select]
"Zombies" {

"normal_zombie" {

"Model" {
"Body" "models/zombie/classic.mdl"
"Torso" "models/zombie/classic_torso.mdl" // Body is not chopped when you do not set the option.
"Leg" "models/zombie/classic_legs.mdl" // Body is not chopped when you do not set the option.
}

"Headcrab" {
"Model" "models/headcrabclassic.mdl"
"Classname" "npc_headcrab"
}

"Base" {
"Blood" "BLOOD_COLOR_ZOMBIE"
"Health" "20 50"
"FOV" "0.2"
"Speed" "1.0 1.2"
"MeleeDamage" "20 50"

"Capabilities" {
"MOVE_GROUND" "1"
"INNATE_MELEE_ATTACK1" "1"
}
}

"ReplaceActivities" {
"ACT_RUN" "ACT_WALK"
}

"Sounds" { // not implemented yet.
"Moan" ""
"Attack" ""
"AttackMiss" ""
"Pain" ""
"Die" ""
"Alert" ""
"Idle" ""
"Attack" ""
}
}


"zombie2" {

"Model" {
"Body" "models/mossman.mdl"
"Torso" "" // Body is not chopped when you do not set the option.
"Leg" "" // Body is not chopped when you do not set the option.
}

// "Headcrab" { // Headcrab isn't released when omit this section.
// "Model" ""
// "Classname" ""
// }

"Base" {
"Blood" "BLOOD_COLOR_RED"
"Health" "20 40"
"FOV" "0.2"
"Speed" "0.8 1.0 1.2"

//"MeleeDamage" "150"
"TackleDamage" "50"

"Capabilities" {
"MOVE_GROUND" "1"
"MOVE_JUMP" "1"
"MOVE_CLIMB" "1"
"INNATE_MELEE_ATTACK1" "1"
"AUTO_DOORS" "1"
}
}

"ReplaceActivities" {
"ACT_RUN" "ACT_RUN"
"ACT_MELEE_ATTACK1" "ACT_RUN_PROTECTED"
"ACT_ZOMBIE_TANTRUM" "ACT_SIGNAL2"
"ACT_FLINCH_PHYSICS" "ACT_COWER"
"ACT_GESTURE_FLINCH_HEAD" "ACT_COWER"
"ACT_JUMP" "ACT_RUN_CROUCH"
"ACT_CLIMB_DISMOUNT" "ACT_LAND"
"ACT_IDLE_ON_FIRE" "ACT_COWER"
"ACT_WALK_ON_FIRE" "ACT_RUN_PROTECTED"
"ACT_ZOM_SWATRIGHTMID" "ACT_RUN_CROUCH_AIM_RIFLE"
"ACT_ZOM_SWATRIGHTLOW" "ACT_RUN_CROUCH_RPG"
"ACT_ZOM_SWATLEFTMID" "ACT_RUN_CROUCH_AIM_RIFLE"
"ACT_ZOM_SWATLEFTLOW" "ACT_RUN_CROUCH_RPG"
}

"Tackle" {
"ACT_MELEE_ATTACK1" "100"
"ACT_WALK_ON_FIRE" "0"
"ACT_ZOM_SWATRIGHTMID" "0"
"ACT_ZOM_SWATRIGHTMID" "0"
"ACT_ZOM_SWATRIGHTLOW" "0"
"ACT_ZOM_SWATLEFTMID" "0"
"ACT_ZOM_SWATLEFTLOW" "0"
}

"Explode" { // Experimental.
"DamageType" "" // not implemented yet.
"Type" "" // not implemented yet.
"Probability" "60"
"Damage" "200"
"Radius" "120"
}

"Sounds" { // not implemented yet.
"Moan" ""
"Attack" ""
"AttackMiss" ""
"Pain" ""
"Die" ""
"Alert" ""
"Idle" ""
"Attack" ""
}
}
}

This is the smod_customzombies.txt file that is included with smod2. However for the sake of this short tutorial we are only going to look at one thing, the zombiename.

Code: [Select]
"zombie2"
We need to define this as a keyvalue for our npc_czombie, otherwise SMOD will use whatever is set for smod_npc_czombie_default, and if there is nothing there, it will choose one at random.

So for every new custom zombie type you create, it will need a zombiename.

II. MAPADD IT!

So in a mapadd it would look like this:

Code: [Select]
"npc_czombie" {
"origin" "322 -1629 -15" "angle" "0 100 0"
"keyvalues" {
"zombiename" "zombie2"
}
}

And that will make a zombie2 :)

III. EXAMPLE

Here I want a zombie2 that doesn't explode!

Code: [Select]
"zombie2noexplosion" {

"Model" {
"Body" "models/mossman.mdl"
"Torso" "" // Body is not chopped when you do not set the option.
"Leg" "" // Body is not chopped when you do not set the option.
}

// "Headcrab" { // Headcrab isn't released when omit this section.
// "Model" ""
// "Classname" ""
// }

"Base" {
"Blood" "BLOOD_COLOR_RED"
"Health" "20 40"
"FOV" "0.2"
"Speed" "0.8 1.0 1.2"

//"MeleeDamage" "150"
"TackleDamage" "50"

"Capabilities" {
"MOVE_GROUND" "1"
"MOVE_JUMP" "1"
"MOVE_CLIMB" "1"
"INNATE_MELEE_ATTACK1" "1"
"AUTO_DOORS" "1"
}
}

"ReplaceActivities" {
"ACT_RUN" "ACT_RUN"
"ACT_MELEE_ATTACK1" "ACT_RUN_PROTECTED"
"ACT_ZOMBIE_TANTRUM" "ACT_SIGNAL2"
"ACT_FLINCH_PHYSICS" "ACT_COWER"
"ACT_GESTURE_FLINCH_HEAD" "ACT_COWER"
"ACT_JUMP" "ACT_RUN_CROUCH"
"ACT_CLIMB_DISMOUNT" "ACT_LAND"
"ACT_IDLE_ON_FIRE" "ACT_COWER"
"ACT_WALK_ON_FIRE" "ACT_RUN_PROTECTED"
"ACT_ZOM_SWATRIGHTMID" "ACT_RUN_CROUCH_AIM_RIFLE"
"ACT_ZOM_SWATRIGHTLOW" "ACT_RUN_CROUCH_RPG"
"ACT_ZOM_SWATLEFTMID" "ACT_RUN_CROUCH_AIM_RIFLE"
"ACT_ZOM_SWATLEFTLOW" "ACT_RUN_CROUCH_RPG"
}

"Tackle" {
"ACT_MELEE_ATTACK1" "100"
"ACT_WALK_ON_FIRE" "0"
"ACT_ZOM_SWATRIGHTMID" "0"
"ACT_ZOM_SWATRIGHTMID" "0"
"ACT_ZOM_SWATRIGHTLOW" "0"
"ACT_ZOM_SWATLEFTMID" "0"
"ACT_ZOM_SWATLEFTLOW" "0"
}

"Sounds" { // not implemented yet.
"Moan" ""
"Attack" ""
"AttackMiss" ""
"Pain" ""
"Die" ""
"Alert" ""
"Idle" ""
"Attack" ""
}
}

Now I need to add him to my map, and make sure to use the new zombiename!

Code: [Select]
"npc_czombie" {
"origin" "322 -1629 -15" "angle" "0 100 0"
"keyvalues" {
"zombiename" "zombie2noexplosion"
}
}


Great.
« Last Edit: July 21, 2011, 12:55:42 AM by BIZ »

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal