Monster attack that shortly freezes player?

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
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Monster attack that shortly freezes player?

Post by Tormentor667 »

Can something like that be done?
User avatar
.+:icytux:+.
Posts: 2661
Joined: Thu May 17, 2007 1:53 am
Location: Finland

Re: Monster attack that shortly freezes player?

Post by .+:icytux:+. »

Tormentor667 wrote:Can something like that be done?
give the player a inventory item that executes a script that does SetPlayerProperty on the activator. and give the property PROP_TOTALLYFROZEN, Delay(35*6); or whatever you like then call SetPlayerProperty once more to deactivate it.
User avatar
Zhs2
Posts: 1301
Joined: Fri Nov 07, 2008 3:29 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Maryland, USA, but probably also in someone's mod somewhere
Contact:

Re: Monster attack that shortly freezes player?

Post by Zhs2 »

Perhaps a temporary item that calls a color change on the player's HUD, as well?
User avatar
Macil
Posts: 2529
Joined: Mon Mar 22, 2004 7:00 pm
Preferred Pronouns: He/Him
Location: California, USA. Previously known as "Agent ME".
Contact:

Re: Monster attack that shortly freezes player?

Post by Macil »

Make a new player actor that has a custom pain state which freezes the player. You might have to call an ACS script inside the pain state to do exactly what you want.
User avatar
.+:icytux:+.
Posts: 2661
Joined: Thu May 17, 2007 1:53 am
Location: Finland

Re: Monster attack that shortly freezes player?

Post by .+:icytux:+. »

Agent ME wrote:Make a new player actor that has a custom pain state which freezes the player. You might have to call an ACS script inside the pain state to do exactly what you want.
sounds like a better solution if you could freeze the player without acs.
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Monster attack that shortly freezes player?

Post by Tormentor667 »

I tried it but without any success... anyone able to give me a working example?
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Re: Monster attack that shortly freezes player?

Post by CaptainToenail »

The creeper stun balls from GvH and the Tazer from 007 Goldeneye TC both do this
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Monster attack that shortly freezes player?

Post by Tormentor667 »

The GvH scripts are only the as compiled versions and I don't have the 007 TC, links someone?
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Monster attack that shortly freezes player?

Post by XutaWoo »

Tormentor667 wrote:The GvH scripts are only the as compiled versions
Have you tried looking at the GLOBAL script that's in the main dictionary, not the scripts dictionary?
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Monster attack that shortly freezes player?

Post by Tormentor667 »

Yes, now I did but it doesn't seem to work for me... here is what Cutmanmike wrote for the Marine class:

Code: Select all

Pain.Creepstun:
PLAY G 0 A_Pain
PLAY G 18 ACS_ExecuteAlways(986,0)
Goto Spawn
...and the correspdonding script looks like this:

Code: Select all

script 986 (void) // Creeper stun blast effect
{
SetPlayerProperty (0, 1, 0);
fadeto(255, 255, 255, 0.03, 0.0);
Delay(48);
fadeto(255, 255, 255, 0.0, 0.0);
SetPlayerProperty (0, 0, 0);
}
If I put that up exactly the way Cutman did this in my own project, it doesn't work. I get the "fadeto" screen change but I do not get any change in terms of my movement.
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Monster attack that shortly freezes player?

Post by Tormentor667 »

Ah.. now I know why, I have this second script running:

Code: Select all

//Stop moving while aiming
script 800 ENTER
{
  int buttons;
  while (TRUE)
  {
    buttons = GetPlayerInput(-1, INPUT_BUTTONS);
    if (buttons & BT_ALTATTACK)
    {
      	GiveInventory("PlayerFreezer", 1);
      	SetPlayerProperty(0,1,PROP_FROZEN);
    }
    else
    {
    	TakeInventory("PlayerFreezer", 99999999);
    	SetPlayerProperty(0,0,PROP_FROZEN);
    }
    delay(1);
  }
}
Now, how to combine both? :(
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Monster attack that shortly freezes player?

Post by Tormentor667 »

Hm... tried it and it seems to be impossible... but what about spawning a dummy sector directly into the player that stops its movement for a while? Has something like that already been tried?

*EDIT*
Hah, that actually works ^^
User avatar
Chris
Posts: 2978
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Monster attack that shortly freezes player?

Post by Chris »

Try something like this:

Code: Select all

int freezecount;

//Stop moving while aiming
script 800 ENTER
{
  int buttons, lastbuttons;
  while (TRUE)
  {
    lastbuttons = buttons;
    buttons = GetPlayerInput(-1, INPUT_BUTTONS);
    if ((buttons & BT_ALTATTACK) && !(lastbuttons&BT_ALTATTACK))
    {
         GiveInventory("PlayerFreezer", 1);
         SetPlayerProperty(0,1,PROP_FROZEN);
         freezecount++;
    }
    else if(!(buttons & BT_ALTATTACK) && (lastbuttons&BT_ALTATTACK))
    {
       TakeInventory("PlayerFreezer", 99999999);
       freezecount--;
       if(freezecount == 0)
          SetPlayerProperty(0,0,PROP_FROZEN);
    }
    delay(1);
  }
}

script 986 (void) // Creeper stun blast effect
{
   SetPlayerProperty (0, 1, 0);
   freezecount++;
   fadeto(255, 255, 255, 0.03, 0.0);

   Delay(48);

   fadeto(255, 255, 255, 0.0, 0.0);
   freezecount--;
   if(freezecount == 0)
      SetPlayerProperty (0, 0, 0);
}
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: Monster attack that shortly freezes player?

Post by Tormentor667 »

Look above, I already found a much easier method :) But thanks though for your help
Locked

Return to “Editing (Archive)”