A few Decorate questions - More Questions

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
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

A few Decorate questions - More Questions

Post by Amuscaria »

1) I wanna make a weapon that fires a splitting projectile. The Original projectile will fly for a certain distance, then split into a bunch of small ones that preserves the original's direction and pitch before applying their own offsets and pitch to that. Can this be done? I was thinking about using A_SpawnItemEX, but wasn't sure how to do that.

2) The FireResist and FireDamage flags in decorate, is that it's own damage type or is it general "fire" type? Lets say I wanted to make a powerup that cuts the damage from "fire" attacks. Would i need to replace all the "firedamage" flags with a new damagetype property "damagetype "fire""?
Last edited by Amuscaria on Sat Oct 06, 2007 10:41 am, edited 1 time in total.
User avatar
Unknown_Assassin
Posts: 2468
Joined: Wed Apr 12, 2006 5:17 pm
Location: Where dead carcasses lie
Contact:

Post by Unknown_Assassin »

1) Yes. An example is to define 2 actors. One for the main shot, and the other for the split.

Please do note that this code I have given you is a rough code (not finalized), but it indeed does work. The spawning is just executed poorly. Also, yes, I use the FireWand code from the ZWRW to test.

Code: Select all

ACTOR FireWand : Weapon 25000
{
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "You got the Fire Wand!"
   Weapon.AmmoType "Ember"
   Weapon.AmmoGive 20
   Weapon.AmmoUse 1
   Scale 0.5
   States
   {
   Spawn:
      FWDW A -1
      Loop
   Ready:
      FWND A 1 A_WeaponReady
      Loop
   Deselect:
      FWND A 1 A_Lower
      Loop
   Select:
      FWND A 1 A_Raise
      Loop
   Fire:
      FWND A 3
      FWND B 0 A_GunFlash
      FWND B 0 A_PlayWeaponSound("weapons/firewand")
      FWND C 4 A_FireCustomMissile("FireShot",0,1,0,0)
      FWND C 5
      FWND A 3 A_ReFire
      Goto Ready
   Hold:
      FWND C 0 A_PlayWeaponSound("weapons/firewand")
      FWND C 4 A_FireCustomMissile("FireShot",0,1,0,0)
      Goto Ready
   }
}

ACTOR FireShot
{
   Radius 3
   Height 3
   Speed 15
   Damage 2
   Scale 0.5
   PROJECTILE
   RENDERSTYLE ADD
   ALPHA 0.67
   +FIREDAMAGE
   States
   {
   Spawn:
      FSHT AAAAAAAAAAAAAAAAAAAAA 2 Bright //Stating a sprite name a couple of times will get you the duration
      FSHT A 0 Bright A_SpawnItemEx(FireShot2,0,0,48,5,5,5,135,1,0)  
      FSHT A 2 Bright A_SpawnItemEx(FireShot2,0,0,48,5,5,5,45,1,0) //If I wanted three Fireshots, I would make one more line of A_SpawnItemEx
      Loop
   Death:
      FSHT A 0 Bright A_Explode
      FSHT B 0 Bright
      FSHT B 3 Bright
      FSHT C 3 Bright
      FSHT D 3 Bright
      FSHT E 3 Bright
      Stop
   }
}

ACTOR FireShot2
{
   Radius 3
   Height 3
   Speed 30
   Damage 2
   Scale 0.5
   PROJECTILE
   RENDERSTYLE ADD
   ALPHA 0.67
   +FIREDAMAGE
   States
   {
   Spawn:
      FSHT A 2 Bright
      FSHT A 2 Bright
      FSHT A 2 Bright
      FSHT A 2 Bright
      FSHT A 2 Bright
      FSHT A 2 Bright
      Loop
   Death:
      FSHT A 0 Bright A_Explode
      FSHT B 0 Bright
      FSHT B 3 Bright
      FSHT C 3 Bright
      FSHT D 3 Bright
      FSHT E 3 Bright
      Stop
   }
}
2) I think, if you ever define a projectile as a fire type by saying Damagetype Fire or +FireDamage, the flag +Fireresist would cut the damage (i.e. Weapon having +FireDamage, monster having +Fireresist). You don't necessarily have to change all the +FireDamage flags, but since the wiki did say it was deprecated, I think it would be wise to do so.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Using Damagetype is the preferred method, and the one you should use. The other flags are only supported for compatibility with older WADs.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

A few other questions.

1) If I set a monster to take 0 damage from a certain damagetype, will it still go into the painstate?

2) Is it possible to make a enemy teleport instantyly infront of it's target? I have a monster that acts kinda like the wraith from Doom3. I put the SeekerMissile Flag on the guy, and used the A_Fire action for it's ranged attack. But it doesn't seem to be working. Am I doing something wrong? O_o
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Post by Matt »

How do you preserve the pitch?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Post by Gez »

Eriance wrote:1) If I set a monster to take 0 damage from a certain damagetype, will it still go into the painstate?
I think not. If I remember correctly, Cutmanmike tried to get around this for his portal gun.
Eriance wrote:2) Is it possible to make a enemy teleport instantyly infront of it's target? I have a monster that acts kinda like the wraith from Doom3. I put the SeekerMissile Flag on the guy, and used the A_Fire action for it's ranged attack. But it doesn't seem to be working. Am I doing something wrong? O_o
I don't think A_Fire can work on a monster. I remember someone else trying to emulate the Doom3 wraith and ending up using a mix of FastChase and phasing out and in to achieve a somewhat similar, but not perfect, result.
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Post by Risen »

Gez wrote:I think not. If I remember correctly, Cutmanmike tried to get around this for his portal gun.
I've experimented with this myself, and you are correct.
Eriance wrote:2) Is it possible to make a enemy teleport instantyly infront of it's target?
It should be possible using ACS, but it might require unique TIDs on the actors involved.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

I've got a small question about A_Recoil. I understand that putting a negative force makes something got forward, but does the speed at which the actor moves dependent on its mass also?

Say I got 2 actors, one with a mass of 100 and another with 500. I gave them both an A_Recoil Action of 64, do the that pushed around at the same speed? If not how does the speed get calculated (I need to throw a monster with a mass of 320 at a speed of 16 with A_Recoil).
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

I'm pretty sure the mass is taken into account, but I don't know the exact calculation either.

My guess is there is no easy calculation for this -- a force simply gets applied and then the game engine calculates the appropriate speed and direction, as well as the momentum falloff, over the next several tics.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Post by Gez »

Mr Sourcecode says:

Code: Select all

void A_Recoil(AActor * actor)
{
	int index=CheckIndex(1, NULL);
	if (index<0) return;
	fixed_t xymom = fixed_t(EvalExpressionF (StateParameters[index], actor) * FRACUNIT);

	angle_t angle = actor->angle + ANG180;
	angle >>= ANGLETOFINESHIFT;
	actor->momx += FixedMul (xymom, finecosine[angle]);
	actor->momy += FixedMul (xymom, finesine[angle]);
}
I don't see the mass here...
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

See how it adjusts the actor->momx/y variables? Those are used to store the actor's current momentum. When the actor's movement processes during the next tic, this momentum will be translated into a given amount of distance, then they will be adjusted downward based on its mass and location to represent speed falloff due to friction.

It's not just a simple case of "Pushing a monster this hard results in this much distance."


... At least that's my theory without having the source code handy to look at. ;)

If there is no mass taken into account, this would seem to be a mistake; a heavier player class should not experience as much recoil as a lighter player class wielding the same weapon.
Doorhenge
Posts: 85
Joined: Tue Apr 11, 2006 1:08 pm
Location: San Antonio, Texas
Contact:

Post by Doorhenge »

Is there a way to make something like the firewand keep its parent in memory for the kill in DM?

I got a gun that does this but when one of the offshoot projectiles kills the opponent in DM it doesn't count it as a kill from the shooter, I think it thinks the projectile killed him instead.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

Ok, 2 more questions. Though, they are not all decorate related.

1) How do I make Barrels move on a the Scrolling floors? They used to move with the floors in Boom but in Zdoom-Hexen Format they just sit there. What sector special do I need to achieve the same effect?

2) How do I make a powerup last forever. Right now, I just give it a rediculously big Tic-duration. Putting 0 doesnt seem to work. Putting a -1 (like those in a monsters last death frame) crashes the game.

3) How do I make the acs-function Spawn telefrag something if that thing is standing in the teleport destination? Right now, if there is something standing there, the object to be spawned simply wont spawn.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Post by Gez »

Eriance wrote:Ok, 2 more questions. Though, they are not all decorate related.
I count three. :P
Eriance wrote:1) How do I make Barrels move on a the Scrolling floors? They used to move with the floors in Boom but in Zdoom-Hexen Format they just sit there. What sector special do I need to achieve the same effect?
Use action function 223 on a linedef rather than a sector type. And if that's already what you're doing, then use one of the sector effect 225 to 244 instead.

At least one of them should work!
Eriance wrote:2) How do I make a powerup last forever. Right now, I just give it a ridiculously big Tic-duration. Putting 0 doesnt seem to work. Putting a -1 (like those in a monsters last death frame) crashes the game.[/url]
Have you tried something like this?

Code: Select all

Pickup:
Use:
// whatever effect should go there
TNT1 350 A_GiveInventory("Item", 1)
Stop
In theory, if it works, then the item would keep regiving itself to the player, so that it'd never run out.
Eriance wrote:3) How do I make the acs-function Spawn telefrag something if that thing is standing in the teleport destination? Right now, if there is something standing there, the object to be spawned simply wont spawn.
A_SpawnItemEx with the telefrag option (flag 64).
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

A_SpawnItemEx is not an ACS function. :P

You could try spawning the item somewhere else and then teleport it to the right location -- then it should telefrag the offending actor.
Locked

Return to “Editing (Archive)”