Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Grey_Wolf

Make a projectile run a script from a new activator

Question

Hello there! I vanished for a couple of days to focus on other things, but here I am again, struggling with scripts. I'm still trying to get bleeding wound to work the way I want to, but as always, something goes wrong:

 

What I have:

Spoiler

Script "RUPTURE" (void)       //Open wound inflicted by monsters
{
    SetActivator(0, AAPTR_TRACER);
    int armorsave = GetArmorInfo(ARMORINFO_SAVEPERCENT);
    int i;
    
    If (CheckInventory("Canbleed") && armorsave < 32.0)
    {
        for (i=0;i<10;i++)
        {
        Thing_Damage2(0,2,"poisondamage");
        SetHudSize(640, 480, true);
        setfont("SCRATCH");
        HudMessage(s:"A"; HUDMSG_FADEINOUT, 202, CR_UNTRANSLATED, 100.0, 240.0,10.0);
        delay(35*3);
        }
    }
}

What I want:
I want the script to run from the player once the attack hits him. I added the +HITTRACER flag to said attack projectile, and put the ACS_namedexecute command on its death state, but it doesn't work. I even tried to change     SetActivator(0, AAPTR_TRACER); with AAPTR_PLAYER1 just to test things out, but nothing. And yes, the "canbleed" dummy item is in player's inventory.

Running out of idea at this point (again, as always... meh). What do you think?

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 1

How about having the projectile give an inventory item to the player, which then calls the script?

Share this post


Link to post
  • 1

I'd use a different approach. Give the projectile a damage mod (eg 'ouchy'), and Doomplayer a custom pain state for that damage mod ('pain.ouchy'). In this custom state you can call a script that does the wanted 'open wounds' stuff to its activator (tid = 0, the Doomplayer that called the script).

Share this post


Link to post
  • 0

Hmm, I need to make this script run with a variety of differents monster attacks, each with different damage types tied to other scripts...

 

EDIT: I made another  projectile inheriting from the imp melee attack, giving it the "rupture" damagetype. Then i put it in the Imp's "melee" state with the A_CustomMissile coomand, right after his standard custommissile for the melee attack. I created a Pain.rupture state in the playerpawn definition with a ACS_NamedExecute("rupture").

 

...aaaand it's not working.

Edited by Grey_Wolf

Share this post


Link to post
  • 0
Quote

How about having the projectile give an inventory item to the player, which then calls the script?

In the end, I solved with  a mix of your suggestion and editing the dummy item to inherit from "inventory", rather than "custominventory". For unknown reason, the latter wasn't considered in the condition check. I still don't understand why the HITTRACER + Setactivator solution didn't work though.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×