[DECORATE] VictimTID

Moderator: GZDoom Developers

User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom

[DECORATE] VictimTID

Post by Cutmanmike »

Would this be possible at all? Say if I shot a projectile at a monster which had Thing_Spawn(VictimTID, 98, 0, 0), it would spawn Archvileflames on the monster (Not the same effect as an archvile though, just an example).
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

You mean to place sprites over a monster like the Arch Vile attack?
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom

Post by Cutmanmike »

Not exactly. That was just an example. Another example could be Teleport_Other(VictimTID,100,1) to make a weapon sort of like the banishment device.
User avatar
Bio Hazard
Posts: 4019
Joined: Fri Aug 15, 2003 8:15 pm
Location: ferret ~/C/ZDL $

Post by Bio Hazard »

you want to be able to tag the player's target?

The player can't have a real "target" per se, because ZDoom doesn't know who you are looking at.

Although being able to "target" whatever is under the crosshair would enable some extremly cool tricks.
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom

Post by Cutmanmike »

I didn't mean that either!

ULTIMATE EXAMPLE:

New weapon.
Shoots a projectile which has Teleport_Other(VictimTID, 100, 1) on the death sequence.
If the projectile hits an actor with a TID the VictimTID picks it up and in this case, would teleport taht actor to the teleport spot 100.
User avatar
Enjay
 
 
Posts: 27393
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Post by Enjay »

So, you want to be able to have an attack that, if it hits a specified enemy, it does something clever, but if it hits another enemy it will have a different effect?

Or maybe your just looking for a way for things that can not normally target an action specifically on another thing to be able to do so?
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom

Post by Cutmanmike »

Damnit.

PROJECTILE HITS ACTOR

ACTION SPECIAL IS EXECUTED

ACTION SPECIAL EFFECTS THE VICTIM'S
User avatar
Caligari87
Admin
Posts: 6246
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Post by Caligari87 »

I get it. You want to have a special that assigns a VictimTid to the last actor that the projectile or weapon hits, so that later effects can be done on the victim, buy using victimTID in the projectile or weapon definition, right?

8-)
User avatar
Lumpy
Posts: 256
Joined: Tue Jul 15, 2003 5:29 pm
Location: Pa,USA

Post by Lumpy »

actually I think he is asking for a general VictimTID to be applied to the reciever of your punishment.

So that way if you kill a baron with tid 1, or 2, or 3, or etc... etc... The special applied to the weapon would not need to know the TID of every single enemy on every single map to do the special, cuz the tid of every shootable thing, that you would shoot with the gun would get generalized into VictimTID.

Boy explaining that almost confused ME! Anyway I hope that's what he is asking for, if not then I'm a blathering idiot.
User avatar
Caligari87
Admin
Posts: 6246
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Post by Caligari87 »

Basicly just a way of doing more effects to a victim without having to assign tids.

8-)
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed

Post by wildweasel »

If I understand this right, this could be used for a kind of EMP bolt that, upon impacting with an enemy, triggers a script that makes the enemy shoot sparks by setting a generic TID for the scripts to refer to?
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom

Post by Cutmanmike »

At last they get it! :lol:
User avatar
Enjay
 
 
Posts: 27393
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Post by Enjay »

Ahhh, so a projectile hits a victim and gets the tid of the victim as a variable that can then be passed to any scripts that use "victimtid"? Or am I still being thick?
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

Yep, you've got it.
User avatar
Caligari87
Admin
Posts: 6246
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Post by Caligari87 »

That's it, except the victim doesn't need a tid already. VictimTID just refers to whatever the projectile hit, and probably wouldn't be available outside of the code for the weapon, unless each victimTID was essentially unique and the DECORATE weapon/projectile called the script with VictimTID as a parameter. This might need a new "HitActor" state for projectiles, though.

The effect of this projectile would be spawning flames on the hit actor for a random length of time, through the Death state.

Code: Select all

ACTOR ElectroMissile :  DoomImpBall
{
Death:
 XXXX ABCDE 5
 XXXX E 0 A_jump(50, 1)
 XXXX E 35 Thing_Spawn("Fire", VictimTID) //I can't remember my syntax, but you get the idea
 Goto Death+6
 XXXX E 1
 Stop
}
this one would do the effects by calling an ACS script with VictimTID sent as a parameter.

Code: Select all

ACTOR ElectroMissile : DoomImpBall
{
Death:
    XXXX ABCDE 5
    XXXX E 1 ACS_Execute(1,0,VictimTID,0,0)//More syntax forgetfulness
    Stop
}

Script 1 (int Victim)
{
    int j=random(1,10);
    for(int i=1;i<j;i++)    {
        Thing_Spawn("Fire", VictimTID);
        delay(35);
    }
}
Please excuse my horrible syntax, it's just psudo-code.

Both would create flames on the hit actor for a random amount of time, although the script gives you greater control (1 to 10 seconds).This might require a HitActor deathstate on projectiles, or an A_JumpIfNoHit(x) action special, so that the effect isn't done with no target, creating an error.
8-)

Return to “Closed Feature Suggestions [GZDoom]”