A few Decorate questions - More Questions
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.
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.
A few Decorate questions - More Questions
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""?
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.
- Unknown_Assassin
- Posts: 2468
- Joined: Wed Apr 12, 2006 5:17 pm
- Location: Where dead carcasses lie
- Contact:
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.
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.
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
}
}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
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
I think not. If I remember correctly, Cutmanmike tried to get around this for his portal gun.Eriance wrote:1) If I set a monster to take 0 damage from a certain damagetype, will it still go into the painstate?
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.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've experimented with this myself, and you are correct.Gez wrote:I think not. If I remember correctly, Cutmanmike tried to get around this for his portal gun.
It should be possible using ACS, but it might require unique TIDs on the actors involved.Eriance wrote:2) Is it possible to make a enemy teleport instantyly infront of it's target?
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).
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).
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.
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.
Mr Sourcecode says:
I don't see the mass here...
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]);
}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.
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.
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.
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.
I count three.Eriance wrote:Ok, 2 more questions. Though, they are not all decorate related.
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.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?
At least one of them should work!
A_SpawnItemEx with the telefrag option (flag 64).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?In theory, if it works, then the item would keep regiving itself to the player, so that it'd never run out.Code: Select all
Pickup: Use: // whatever effect should go there TNT1 350 A_GiveInventory("Item", 1) Stop
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.
