Jump to content


Photo

Kill the Bunnies


  • Please log in to reply
5 replies to this topic

#1 CobrasShadows

CobrasShadows
  • Members
  • 42 posts
  • Location:Equestria, near Ponyville
  • Projects:A mod, school, and so many others...
  •  Lord of the Ponies

Posted 23 February 2016 - 08:29 PM

Hello there !

 

I'm having a problem coding a kindof hunting system. Here's the scenario.

 

I'm using monster lairs replaced with animals, so the player can kill the animals (here rabbits). But the problem is I tried changing my code and searching indefinitely for it, I did not find what was making a unit attackable or not. So you can't kill the bunnies and that's my problem.

 

If you could help me, it would be awesome.

 

Here's the code:

Object Rabbit

  Draw = W3DScriptedModelDraw ModuleTag_01
    DefaultModelConditionState
		Model               = CURabbit1_SKN
    End
    
   	IdleAnimationState
		StateName					=   STATE_Idle
		Animation = IdleB
			AnimationName       = CURabbit1_SKL.CURabbit1_IDLA
			AnimationPriority	= 10
			AnimationMode       = ONCE
		End
		BeginScript
			Prev = CurDrawablePrevAnimationState()
			if Prev == "STATE_Alert" then CurDrawableSetTransitionAnimState("TRANS_AlertToIdle") end
		EndScript
    End

	AnimationState				= MOVING WANDER
		Animation				= WLKA
			AnimationName		= CURabbit1_SKL.CURabbit1_WLKA
			AnimationBlendTime	=	20
			AnimationMustCompleteBlend = yes
		End
	End

	AnimationState				= MOVING PANICKING
		Animation				= RUNA
			AnimationName		= CURabbit1_SKL.CURabbit1_RUNA
			AnimationMode		= LOOP
		End
		Flags					= RANDOMSTART
	End    
	    	
	AnimationState			=	MOVING
		StateName			=	STATE_moving
		Animation			=	Moving
			AnimationMode	= LOOP
			AnimationName	=	CURabbit1_SKL.CURabbit1_WLKA
		End
		Flags					= RANDOMSTART
	End
	
	TransitionState					=	TRANS_AlertToIdle
		Animation					=   CURabbit1_IDLD
			AnimationName			=	CURabbit1_SKL.CURabbit1_IDLD
			AnimationMode			=	ONCE
		End
	End	
	
	TransitionState					=	TRANS_IdleToAlert
		Animation					=   ATNA
			AnimationName			=	CURabbit1_SKL.CURabbit1_IDLC
			AnimationMode			=	ONCE
		End
	End		

	AnimationState        = EMOTION_ALERT
		StateName			=   STATE_Alert
		Animation           = ALERT_1
			AnimationName     = CURabbit1_SKL.CURabbit1_IDLB
			AnimationMode     = ONCE
		End
		BeginScript
			Prev = CurDrawablePrevAnimationState()
			if Prev == "STATE_Idle" then CurDrawableSetTransitionAnimState("TRANS_IdleToAlert") end
		EndScript
		Flags               = RESTART_ANIM_WHEN_COMPLETE ; acts like an idle animation & keeps running the animations.
	End

	AnimationState          = DYING DEATH_1
		Animation
			AnimationName   = CURabbit1_SKL.CURabbit1_IDLA
			AnimationMode   = LOOP
		End
	End
	
	AnimationState        = DYING
		Animation           = CURabbit1_DIEA
  			AnimationName     = CURabbit1_SKL.CURabbit1_DIEA
			AnimationMode     = ONCE
		End
	End

 End
 
; ***DESIGN parameters ***
  EditorSorting =     UNIT
  TransportSlotCount = 1
  ArmorSet
    Conditions      = None
    Armor           = NoArmor
    DamageFX        = None
  End
  VisionRange = 121
  DisplayName = OBJECT:Prop
  CrushableLevel = 0  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
 
;  *** ENGINEERING Parameters ***
  RadarPriority = NOT_ON_RADAR
  KindOf = PRELOAD SELECTABLE PATH_THROUGH_EACH_OTHER PATH_THROUGH_INFANTRY GRAB_AND_DROP HAS_HEALTH_BAR CREEP
 
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 1.0                  
  End
 
 	Behavior = AnimalAIUpdate ModuleTagWanderAround
		FleeRange = 200			; how close enemies have to be before we panic
		FleeDistance = 800      ; how far the animal will run once spooked
		WanderPercentage = 10	;percentage of the time we should move
		MaxWanderDistance = 50  ;maximum distance to move at once
		MaxWanderRadius = 1000  ; how far to wander on our own
		UpdateTimer = 10000		; temp disable		9     ; how often do we want to check for enemies
	End

  LocomotorSet
	Locomotor = HumanLocomotor
	Condition = SET_NORMAL
	Speed     = 9
  End

  LocomotorSet
	Locomotor = HumanLocomotor
	Condition = SET_PANIC
	Speed     = 33
  End

  Behavior = PhysicsBehavior ModuleTag_04
  End
 
	Behavior = SlowDeathBehavior ModuleTag_FadeoutDeath
		DeathTypes			= NONE +FADED
		DeathFlags			= DEATH_1
		FadeDelay			= 0
		FadeTime			= 3500
		DestructionDelay	= 4000
	End

	Behavior = SlowDeathBehavior ModuleTag_05
		DeathTypes = ALL -FADED
		SinkDelay = 600000
		SinkRate = 0.40     ; in Dist/Sec
		DestructionDelay = 700000
	End
 
  Behavior = SquishCollide ModuleTag_06
  End
 
  Geometry = CYLINDER
  GeometryMajorRadius = 0.8
  GeometryHeight = 0.8
  GeometryIsSmall = No
  Shadow = SHADOW_DECAL

End

Thanks a lot for your attention and your help ! ^^


ocarina_bookmark___song_of_time_by_empir


#2 Samuel R. Kinsey

Samuel R. Kinsey
  • Members
  • 48 posts

Posted 24 February 2016 - 02:55 AM

I don't know, but I'd try changing the maxhealth to 50 or so, and compare the first lines in the engineering parameters to other units



#3 CobrasShadows

CobrasShadows
  • Members
  • 42 posts
  • Location:Equestria, near Ponyville
  • Projects:A mod, school, and so many others...
  •  Lord of the Ponies

Posted 24 February 2016 - 06:28 AM

Thanks for your reply. However I already tried to do as you say, but even with the same engineering as a spider, the rabbit appears to not be attachable... Could it come from the fact that the bunny has no skeleton so we can't click on him or something like that ?

ocarina_bookmark___song_of_time_by_empir


#4 Kwen

Kwen

    Vileartist

  • T3A Staff
  • 4,865 posts
  • Location:Korea I wish
  • Projects:It'sa secreeet
  •  T3A's First N00b
  • Division:BFME
  • Job:T3A Expert
  • Donated

Posted 24 February 2016 - 08:17 AM

Well the rabbit does have a skeleton, it's just listed in the animation line itself instead of a skeleton line in the model condition. However you would probably have better luck if you made a child object of an already working creep and just substitute the necessary features you need to make it appear as your rabbit. This could be repeated as you wish for other animals.

                           https://www.twitch.tv/vileartist - Yes shameless self-promotion

          ----------------------------------------------------------------------------------------------------------------------

                            "Old modders never die, they just fade away" ~ Hostile


#5 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 29 February 2016 - 07:53 PM

You might have the problem that the bunny is small, and probably does not have a BoundingBox, maybe if you scale it up and try clicking on it you can click on it, not sure though...


Ridder Geel

#6 CobrasShadows

CobrasShadows
  • Members
  • 42 posts
  • Location:Equestria, near Ponyville
  • Projects:A mod, school, and so many others...
  •  Lord of the Ponies

Posted 01 March 2016 - 06:55 PM

Yeah I finally found out it was the model bugging it... I'm gonna try to scale it up to see..


ocarina_bookmark___song_of_time_by_empir





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users