Jump to content
Sign in to follow this  
teemo

zombie use gun to attack survivor

Recommended Posts

I reference Bandits mod to modify zombie nurse.

and try to let nurse can be use the gun to attack survivor.

 

 

but nurse don't have gun in game.:confusion:

 

please help to review the code, thank very much

 

 

entityclasses.xml

<entity_class name="zombieNurse" extends="zombie01">
<!-- give Nurse a AK47 -->
<property name="ItemsOnEnterGame.GameModeSurvivalSP" value="banditgunAK47" />
<property name="ItemsOnEnterGame.GameModeSurvivalMP" value="banditgunAK47" />
<!-- in s -->
<property name="AttackTimeoutDay" value="0.5" />
<property name="AttackTimeoutNight" value="0.5" />
<!-- AI properties -->
<property name="AITask-1" value="RangedAttackTarget2" param1="0" param2="20"/>	
<property name="AITask-2" value="ApproachAndAttackTarget" param1="EntityZombie" />
<property name="AITask-3" value="ApproachAndAttackTarget" param1="EntityPlayer" />
<property name="AITask-4" value="ApproachAndAttackTarget" param1="EntitySurvivor" />
<property name="AITask-5" value="ApproachAndAttackTarget" param1="EntityZombieDog" />
<property name="AITask-6" value="ApproachAndAttackTarget" param1="EntityZombieCop" />
<property name="AITask-7" value="BreakDoor" />
<property name="AITask-8" value="BreakBlock" />
<property name="AITask-9" value="ApproachSpot" />
<property name="AITask-10" value="Wander" />
<!-- Just attack Survivor Player -->
<property name="AITarget-2" value="SetAsTargetIfHurt" param1="EntityPlayer" />
<property name="AITarget-3" value="SetAsTargetIfHurt" param1="EntitySurvivor" />
<property name="AITarget-6" value="BlockingTargetTask" />
<property name="AITarget-8" value="SetNearestEntityAsTarget" param1="EntityPlayer" />
<!-- zombieNurse attributes -->
<property name="Mesh" value="Zombies/zombieStandardNurseRagdoll" />
<property name="SoundRandom" value="Enemies/Base_Zombie_Female/zombiefemaleroam" />
<property name="SoundAlert" value="Enemies/Base_Zombie_Female/zombiefemalealert" />
<property name="SoundAttack" value="Enemies/Base_Zombie_Female/zombiefemaleattack" />
<property name="SoundHurt" value="Enemies/Base_Zombie_Female/zombiefemalepain" />
<property name="SoundDeath" value="Enemies/Base_Zombie_Female/zombiefemaledeath" />
<property name="SoundSense" value="Enemies/Base_Zombie_Female/zombiefemalesense" />
<property name="AvatarController" value="AvatarZombie01Controller" />
<property name="ModelType" value="Standard" />
<!-- Remove Walk type -->
<!-- <property name="WalkType" value="7" /> -->
<property name="HandItem" value="handZombie" />
<property name="CanClimbLadders" value="true" />
<property name="PhysicsBody" value="zombieStandardFemale" />
<property name="RootMotion" value="true" />
<property name="HasDeathAnim" value="true" />
<property name="LootListOnDeath" value="21" />
</entity_class>

 

 

items.xml

<item id="2011" name="banditgunAK47" >
<property name="Extends" value="gunAK47" />
<property class="Parts">
	<property name="Stock" value="banditpartsAK47_stock" />
	<property name="Receiver" value="banditpartsAK47_receiver" />
	<property name="Pump" value="banditpartsAK47_parts" />
	<property name="Barrel" value="banditpartsAK47_barrel" />
</property>
<property class="Action0"> <!-- AttackAction -->
	<property name="Delay" value="4" />
	<property name="Magazine_size" value="1" />
	<property name="Infinite_ammo" value="true" />
	<property name="Magazine_items" value="bandit762mmBullet" />
	<property name="Reload_time" value="4" />
</property>
<property name="SellableToTrader" value="false" />
	<property name="Candrop" value="false" />
<property name="IsDeveloper" value="true" />
</item>

Edited by teemo (see edit history)

Share this post


Link to post
Share on other sites

Lots more to it than that; see that first line, extends="zombie01"? That means it takes all of the features from zombie01 that are not explicitly stated in your zombie nurse.

 

Also, check out the line with "HandItem" value="handZombie"

 

There is bound to be more to it than that, but that should give you a better starting point.

 

Me, I would extend to a bandit instead of zombie01 and see what happens.

Share this post


Link to post
Share on other sites

Zombies cannot hold weapons. You have to change the class to:

<property name="Class" value="EntityNPC" />

 

You'd also need to give it the correct AI properties to use the weapon.

 

Though like Guppy said, the hand item might also be an issue.

 

You should copy one of the bandits and just work from that. Work up from the bandit to make it more like a zombie, not the other way around. If that makes sense.

Share this post


Link to post
Share on other sites

I have see zombies use gun shot me in mod server.

 

I don't want to use bandit because zombies always kill bandit.

 

Or have any mod can be change zombies attack mode with gun?

Share this post


Link to post
Share on other sites
I have see zombies use gun shot me in mod server.

 

I don't want to use bandit because zombies always kill bandit.

 

Or have any mod can be change zombies attack mode with gun?

 

They may LOOK like zombies, but they're technically bandits. I have one of those too, though mine uses a machete.

 

If you want a "zombie" to attack using a weapon that isn't a hand (or invisible) then you will have to make it a bandit. You can make it not attack other zombies but other zombies will attack it. This is the sacrifice you make for having a "zombie" wield a weapon, currently.

Share this post


Link to post
Share on other sites

I try to fix handZombie problem.

But it doesn't work. Zombie try to shot me, there is an animation and sounds but there is no projectile, why?

 

please help me, thanks a lot!

 

 

entityclasses.xml

<entity_class name="zombieNurse" extends="zombie01">
<property name="Mesh" value="Zombies/zombieStandardNurseRagdoll" />
<property name="SoundRandom" value="Enemies/Acid_Puking_Hulk/hulkroam" />
<property name="SoundAlert" value="Enemies/Acid_Puking_Hulk/hulkalert" />
<property name="SoundAttack" value="Enemies/Acid_Puking_Hulk/hulkattack" />
<property name="SoundHurt" value="Enemies/Acid_Puking_Hulk/hulkpain" />
<property name="SoundDeath" value="Enemies/Acid_Puking_Hulk/hulkdeath" />
<property name="SoundSense" value="Enemies/Acid_Puking_Hulk/hulksense" />
<property name="SoundFootstepModifier" value="Animals/Bear/bear_footstep" />
<property name="AvatarController" value="AvatarZombie01Controller" />
<property name="ModelType" value="Standard" />
<!-- Change 7 to 1 -->
<property name="WalkType" value="1" />
<property name="Class" value="EntityZombieCop" />
<property name="RightHandJointName" value="Jaw" />
<!-- Boom -->
<property name="HandItem" value="handGunZombie" />
<property name="CanClimbLadders" value="true" />
<property name="PhysicsBody" value="zombieStandardFemale" />
<property name="RootMotion" value="true" />
<property name="HasDeathAnim" value="true" />
<property name="LootListOnDeath" value="21" />
<!-- Add Cop Class -->
<property name="MaxHealth" value="700" />
<property name="Weight" value="70" />
<property name="PushFactor" value="20" />
<property name="AITask-1" value="BreakDoor" />
<property name="AITask-2" value="BreakBlock" />
<!-- param1: 0 == attack action, 1 == use action, param2: attack length in s -->
<property name="AITask-3" value="RangedAttackTarget" param1="1" param2="5" />
<property name="AITask-4" value="ApproachAndAttackTarget" param1="EntityPlayer" />
<property name="AITask-5" value="ApproachAndAttackTarget" param1="EntityAnimalStag" />
<property name="AITask-6" value="ApproachSpot" />
<property name="AITask-7" value="Wander" />
<property name="Explosion.ParticleIndex" value="8" />
<property name="Explosion.RadiusBlocks" value="5" />
<property name="Explosion.RadiusEntities" value="6" />
<property name="Explosion.BlockDamage" value="500" />
<property name="Explosion.EntityDamage" value="150" />
<property name="Explosion.DamageBonus.earth" value="0" />
<property name="ExperienceGain" value="4000"/>
<property name="HeadDismemberBonusChance" value="0.08"/>
<property name="HeadDismemberThreshold" value="0"/> <!-- if the total damage exceeds that value, there is a chance for dismemberment /> -->
<property name="LowerLegDismemberThreshold" value="0"/>
<property name="UpperLegDismemberThreshold" value="0"/>
<property name="LowerArmDismemberThreshold" value="0"/>
<property name="UpperArmDismemberThreshold" value="0"/>
<property name="LegCrawlerThreshold" value="0"/>
<property name="LegCrippleThreshold" value="0"/>
<property name="KnockdownProneDamageThreshold" value="0"/>
<property name="KnockdownKneelDamageThreshold" value="0"/>
</entity_class>

 

Item.xml

<item id="2100" name="handGunZombie">
<property name="Extends" value="handMaster" />
<property name="IsDeveloper" value="true" />
<property name="Degradation" value="99999" param1="true" />
<property class="Action0"> <!-- AttackAction -->
	<property name="Range" value="1.75" />
	<property name="DamageEntity" value="20" />
	<property name="DamageBlock" value="250" />
	<property name="Buff" value="bleeding,infection,stunned" />
	<property name="Buff_chance" value="0.2,0.2,0.4" />
</property>
<property class="Action1"> <!-- AttackAction -->
	<property name="Infinite_ammo" value="true" />
	<property name="Class" value="Ranged" />
	<property name="Range" value="200" />
	<property name="Auto_fire" value="true" />
	<property name="Crosshair_min_distance" value="5" />
	<property name="Crosshair_max_distance" value="30" />
	<property name="Magazine_size" value="30" />
	<property name="Magazine_items" value="10mmBullet" />
	<property name="Magazine_item_ray_counts" value="1" />
	<property name="Magazine_item_ray_spreads" value="0" />
	<property name="Reload_time" value="4.1" />
	<property name="Bullet_icon" value="uzi" />
	<property name="Sound_start" value="Weapons/Ranged/MP5/mp5_fire_start" />
	<property name="Sound_repeat" value="Weapons/Ranged/MP5/mp5_fire_lp" />
	<property name="Sound_end" value="Weapons/Ranged/MP5/mp5_fire_end" />
	<property name="Sound_empty" value="Weapons/weapon_empty" />
	<property name="Sound_reload" value="Weapons/Ranged/MP5/mp5_reload" />
	<property name="Horde_meter_rate" value="2.5" />
	<property name="Horde_meter_distance" value="20" />
	<property name="Particles_muzzle_fire" value="nozzleflashuzi" />
	<property name="Particles_muzzle_smoke" value="nozzlesmokeuzi" />
	<property name="DamageBonus.head" value="4" />
	<property name="DamageBonus.wood" value="5" />
	<property name="DamageBonus.earth" value=".2" />
	<property name="DamageBonus.glass" value="25" />
	<property name="Buff" value="critGunMP5" />
	<property name="Buff_chance" value=".1" />
</property>
</item>

Share this post


Link to post
Share on other sites

At the risk of sounding rude, I think you should go back and read through what we've already told you. You're making the same mistakes now that you made originally.

 

You focused on hand item, but overlooked everything else that was pointed out to you.

 

Zombies cannot wield weapons. You have to make him a bandit by giving him EntityNPC class.

 

I also recommend you do not remove his attack zombie AI. Otherwise other zombies will tear him apart while he just stands there taking it.

 

You will also need to set the gun up to be an ItemsOnEnterGame, as it was before.

Share this post


Link to post
Share on other sites

but thank you for this thread, i found it super helpful for a future project. even though, technically, I dont think bandits as entities probably still exist in the game.

Share this post


Link to post
Share on other sites

You should look at the xml for bandits in the creaturepackhumans if you want to implemt bandits in the future.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...