Caco football help

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
InsaneFury
Posts: 105
Joined: Mon Nov 23, 2009 6:51 am

Caco football help

Post by InsaneFury »

I want to make a kickable cacodemon. I'm trying to do this with DECORATE only and emplying ThrustThingZ and ThrustThing.

Code: Select all

actor CacoKicker
{
  health 5
  radius 8
  height 16
  Speed 15
  scale 0.5
  mass 1
  
  +MISSILE
  -SHOOTABLE
  +NONSHOOTABLE
  +SOLID
  +NOBLOCKMAP
  +RANDOMIZE
  -CANPUSHWALLS
  -NOGRAVITY
  +DOOMBOUNCE
  +BOUNCEONACTORS
  +CANBOUNCEWATER
  +FLOORCLIP
  +VULNERABLE
  +NOTIMEFREEZE

 States
 {
   Spawn:
	HEAD A 1 bright
   Goto See
   See:
		HEAD A 1 A_LookEx (LOF_DONTCHASEGOAL | LOF_NOSEESOUND | LOF_NOSOUNDCHECK, 0, 20,1,360, "Melee")
   Loop
  Melee:
	HEAD B 0 ThrustThingZ(0,20,0,1)
	HEAD A 0 A_FaceTarget
	HEAD C 0 ThrustThing((angle*(256/360))+128, 30, 0, 0) // angle*256/360+random(100,146)
	HEAD B 30
    Goto See
	Death:
	Goto See
 }
}
While the caco jumps up (ThrustThingZ), the ThrustThing line doesn't seem to do much (should kick it backward once the player bumps into it, after the FaceTarget call). Anyone care to help me out? :P
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Caco football help

Post by NeuralStunner »

[wiki]A_ChangeVelocity[/wiki] is a lot more flexible, takes degree angles, and can set velocity on all 3 planes as needed. Just keep in mind this feature is not in Skulltag.

I would guess that ThrustThing isn't working all the time because the byte angle argument doesn't "wrap": I.E. adding 128 to 192 does not bring you back around to 64. (You'd have to do that manually, by storing the resulting byte angle first, and subtracting 256 if it is over 255.)

I believe, though, that A_ChangeVelocity will "wrap" degree angles.
User avatar
InsaneFury
Posts: 105
Joined: Mon Nov 23, 2009 6:51 am

Re: Caco football help

Post by InsaneFury »

TBH I can't make heads or tails out of that entry. But then again I'm a total noob when it comes to angles and pitch. :P
Could you explain how A_ChangeVelocity would work?

I see the x/y/z are floats: do positives/negatives make the actor go forward/backward, i.e. x=-20 would mean backward and 20 would mean forward at speed 20? Is it a modifier for the speed set in the actor, i.e. x=-0.8 would make the actor go backward at 80% its speed, and 0.8 would make it move forward? This all assuming flags=1 of course. In my case the flags would be >2, as I need the caco to move from the state in which speed=0.

Either way, I tinkered with it and still can't get the caco to do anything other than jump. I'm thinking it's because it starts with 0 velocity? If I summon the caco and bump into it immediately (while it's still in motion from the summon), it'll trigger properly. Otherwise it just jumps up, even with the A_ChangeVelocity code, specifying :

Code: Select all

actor CacoKicker
{
  health 5
  radius 8
  height 16
  Speed 15
  scale 0.5
  mass 1
 
  +MISSILE
  -SHOOTABLE
  +NONSHOOTABLE
  +SOLID
  +NOBLOCKMAP
  +RANDOMIZE
  -CANPUSHWALLS
  -NOGRAVITY
  +DOOMBOUNCE
  +BOUNCEONACTORS
  +CANBOUNCEWATER
  +FLOORCLIP
  +VULNERABLE
  +NOTIMEFREEZE

States
{
   Spawn:
   HEAD A 1 bright
   Goto See
   See:
      HEAD A 1 A_LookEx (LOF_DONTCHASEGOAL | LOF_NOSEESOUND | LOF_NOSOUNDCHECK, 0, 20,1,360, "Melee")
   Loop
  Melee:
   // HEAD B 0 ThrustThingZ(0,20,0,1)
   HEAD A 0 A_FaceTarget
   HEAD A 0 A_Chase(0,0)
   HEAD C 0 A_ChangeVelocity(20,0,8,3)
   HEAD C 0 ThrustThing((angle*(256/360))+128, 30, 0, 0) // angle*256/360+random(100,146)
   HEAD B 30
    Goto See
   Death:
   Goto See
}
}
Have to note though that sometimes it seems to work, but it's more a miss than hit. I added A_Chase in the hopes that it'd set the velocity after the FaceTarget, perhaps triggering success. But that disn't do much either.

I really would like to know why, and I'd rather not use code that's not supported in Skulltag...
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Caco football help

Post by NeuralStunner »

InsaneFury wrote:do positives/negatives make the actor go forward/backward, i.e. x=-20 would mean backward and 20 would mean forward at speed 20?
Yes, this.
User avatar
InsaneFury
Posts: 105
Joined: Mon Nov 23, 2009 6:51 am

Re: Caco football help

Post by InsaneFury »

D'OH! +SOLID... :P
Works with either option now. I feel so stupid. :D
Locked

Return to “Editing (Archive)”