On Screen Simple Effects, possible?

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
Karnizero
Posts: 84
Joined: Fri Mar 23, 2007 9:42 am

On Screen Simple Effects, possible?

Post by Karnizero »

I mean the effect of "flashing screen", same when you pick up a item, or Red Flash effect when you are being hurted with a great damage (Ex. by a Cyberdemon Missile).

How can i simulate those flashings via scripting? Is it possible?
Just the required function for ASC or a pretty link for a tutorial, will be accepted. :wink:

I looked for a function at the ZDoom Wiki, but i found nothing...

Thanks for help. :D
User avatar
The NUtcracker
Posts: 843
Joined: Sun Jan 14, 2007 9:12 pm
Location: South Dakota
Contact:

Post by The NUtcracker »

Not yet. It's still in Feature Suggestions.
User avatar
Karnizero
Posts: 84
Joined: Fri Mar 23, 2007 9:42 am

Post by Karnizero »

The NUtcracker wrote:Not yet. It's still in Feature Suggestions.
I see. Thanks anyway.

Then, is it possible to make player "blind" for a few?
I mean with blind that player wont see anything for a moment.
Any idea?
User avatar
The NUtcracker
Posts: 843
Joined: Sun Jan 14, 2007 9:12 pm
Location: South Dakota
Contact:

Post by The NUtcracker »

You could use this:

Code: Select all

fadeto(0, 0, 0, 1.0, 0.0);
delay(35);
fadeto(0, 0, 0, 0.0, 0.0);
This makes the screen flash black for 1 second.
User avatar
DrewbieDoobie007
Posts: 171
Joined: Thu Jul 24, 2003 8:12 pm
Location: Shelton, Nebraska, USA

Post by DrewbieDoobie007 »

you can do this through the console by changing r_visibility to a large negative value like -50 to -100, you could bind it to an alias and activate it by a keystroke but other than that it is beyond my expertise, dunno if you could implement such a thing via ACS. I use an increased r_visibility and change the testcolor to green attached to a console alias to get a nightvision scope effect.
User avatar
The NUtcracker
Posts: 843
Joined: Sun Jan 14, 2007 9:12 pm
Location: South Dakota
Contact:

Post by The NUtcracker »

DrewbieDoobie007 wrote:you can do this through the console by changing r_visibility to a large negative value like -50 to -100, you could bind it to an alias and activate it by a keystroke but other than that it is beyond my expertise, dunno if you could implement such a thing via ACS. I use an increased r_visibility and change the testcolor to green attached to a console alias to get a nightvision scope effect.
He means in ACS, not console.
User avatar
Isle
Posts: 687
Joined: Fri Nov 21, 2003 1:30 am
Location: Arizona, USA

Post by Isle »

if you want to just make the screen white or black you can have a big white texture then show it with hudmessage.
User avatar
jallamann
Posts: 2271
Joined: Mon May 24, 2004 8:25 am
Location: Ålesund, Norway
Contact:

Post by jallamann »

fadeto() is far easier and more compact than using a texture...
User avatar
Karnizero
Posts: 84
Joined: Fri Mar 23, 2007 9:42 am

Post by Karnizero »

Yes, the FadeTo() fuction idea works fine.

I was thinking about the sprite idea, but the FadeTo() is easy and faster.

Thanks for help. :D
User avatar
Karnizero
Posts: 84
Joined: Fri Mar 23, 2007 9:42 am

Post by Karnizero »

Yet another question:

I need a function to set max player health to a certain quantity. Is that possible?

Because SetActorProperty(PlayerNumber(), aprop_Health, 50) [for example), gives the player 50 points, but that is not the maximun allowed.

Thanks.
User avatar
The NUtcracker
Posts: 843
Joined: Sun Jan 14, 2007 9:12 pm
Location: South Dakota
Contact:

Post by The NUtcracker »

You'd either have to edit the source code, or define a custom player class in decorate.
User avatar
JacKThERiPPeR
Posts: 203
Joined: Tue Jul 06, 2004 11:45 am
Location: España / Spain

Post by JacKThERiPPeR »

Karnizero wrote:Yet another question:

I need a function to set max player health to a certain quantity. Is that possible?

Because SetActorProperty(PlayerNumber(), aprop_Health, 50) [for example), gives the player 50 points, but that is not the maximun allowed.

Thanks.
Offtopic (Spanish): ¡Qué pasa tío!

Ontopic: You should do something on DEHACKED, but I don't think that should work for Heretic as I've seen your work.
User avatar
Virtue
Posts: 919
Joined: Sun Nov 19, 2006 8:15 am
Location: Manchester UK

Post by Virtue »

i got rounnd this in my TC by using an invisible pickup that triggers a screen effect
User avatar
Karnizero
Posts: 84
Joined: Fri Mar 23, 2007 9:42 am

Post by Karnizero »

JacKThERiPPeR wrote:
Offtopic (Spanish): ¡Qué pasa tío!

Ontopic: You should do something on DEHACKED, but I don't think that should work for Heretic as I've seen your work.
[Offtopic (Spanish): ¿Tío, dónde estás metido que ya no te pasas por Arcades3D? Venga, un saludo y cuidate.]

Well, Dehacked dont gives me the solution that i need, because i need to change the player health in "real time". This is, in-game. :P

The Source code idea... mmmm..... Better i will learn C programming language sintaxis later. :lol:

The custom PlayerClass actor is a good idea, but i don have idea how to modify that Actor. Somenone can give me a short description of that Actor?
Or maybe how to modify some ascpects of that actor in game?

I was thinking about any solution for that problem, and i have this:

1.- First, create a new actor fo Healing Vials. This actor should be pickable by the player, for example, a QuestItem. When player picks it up, we execute a script.

2.- Now we create a script, who will be called from the Actor. When this script is called, it will look for the player's health at this moment, and will comparate this amount, with the maximun health allowed. If the player has less than maximun, then the script will heal player. Otherwise, we create a new Healing Vial Actor at the current position of the player.
In both cases (player needs heal or not), we just remove the item from the inventory.
The script could be something like this:

Code: Select all

int MaxHP = 25;
inf CurrentHP = 0;
scrip 1 (void) {
     CurrentHP = GetActorProperty (PlayerNumber(), aprop_Health);
     if ( CurrentHP < MaxHP ) { /*actual HP is lower than MaxHP*/
          if ( (CurrentHP + 15) > MaxHP ) { /*lets see if the healing vial gives us more than MaxHP*/
               SetActorProperty (PlayerNumber(), aprop_Health, MaxHP);
          } else {
               SetActorProperty (PlayerNumber(), aprop_Health, CurrentHP + 15);
          }
     } else { /*actual hp is more or equal to max allowed*/
          print (s:"You take the vial, but you see that you dont need"); /*optional line*/
          Thing_SpawnSpot("MyHealingVialActor", PlayerPosX, PlayerPosY); /***Insert code for spawn item at player location***/
     }
     TakeInventory ("MyHealingVialActor", 1); /*remove the item from inventory*/
}
I think this should work good. The unique problem that i see is that the new created Healing Vial Actor (if player is at max life, i mean), i think that will be picked again for player if he dont move from the position, but we can make a small time delay. If after that delay, we test player coords, and they are same that before, then, wait again, and this will repeat until player coords have changed. Well, we need also to validate the Healing Vial Radius, to not allow player to pick up the item if he is a "pickable distance".

What do you think about this?
Any (other) suggestion?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

jallamann wrote:fadeto() is far easier and more compact than using a texture...
The one drawback is that fadeto fades the entire screen, including the HUD, console, etc. For a brief flash this is fine, however if you want the user to still be able to see chat messages, console, etc while "blinded" for a longer period of time, a simple blank graphic being hudmessage'd to the screen is a better solution.
Locked

Return to “Editing (Archive)”