Okay this is gonna be a tricky one (or perhaps not i'm not sure), but i am currently figuring out how to make the item shop of my mod provide enough information to the player so he knows what the hell he is buying and if he has this items and what upgrades he has or not.
So my idea was to make a script activated by a floor that displays the image for either if he has this item or not and displays the prices and stuff and disappears once the player leaves the floor in question. But problem is i have no clue how to proceed. Either i end up with a hud message that stays here and dissappears after a few seconds or stays forever without leaving the screen. I was expecting to make the floor activator loop the script for as long as the player stays here but apparently its not how it works.
Can you guys help? (I'm kinda bad at ACS so sorry if this sounds like a really dumb question)
[ACS] question about hud messages images and activation
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[ACS] question about hud messages images and activation
Last edited by FranckyFox2468 on Sat Dec 17, 2016 5:41 pm, edited 1 time in total.
-
- Retired Staff / Community Team Member
- Posts: 2558
- Joined: Sat Jun 02, 2012 2:44 am
[ACS] Re: question about hud messages images and activation
When you do a hudmessage, set an ID that's not 0 and set the time to 0. To make it go away, simply print the message again with the same ID and set the msg to a blank space, like this: " ", and the time to something low like 0.1Either i end up with a hud message that stays here and dissappears after a few seconds or stays forever without leaving the screen.
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[ACS] Re: question about hud messages images and activation
Okay, but what if i wanna make it so it automatically switches once the item as been purchased to a "sold" version of the image?
-
- Retired Staff / Community Team Member
- Posts: 2558
- Joined: Sat Jun 02, 2012 2:44 am
[ACS] Re: question about hud messages images and activation
Just print a message with the same id as the message you want to disappear.FranckyFox2468 wrote:Okay, but what if i wanna make it so it automatically switches once the item as been purchased to a "sold" version of the image?
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[ACS] Re: question about hud messages images and activation
okay but how do i make so the process is automatic without delay? Like update the info the moment it happens? Cause i only want the message to display while the player is around the vendor of the specific item and it updates the ammounts and pictures the moment you buy the thing in question and fades out the moment you go somewhere else
EDIT: I think i may have figured something, but i need to figure how to make a script break the loop of another script. Ima try to make a hudmessage that loops very rapidly and stops once another sector is hit
EDIT 2: Okay i think i solved it, thanks for the help!
EDIT 3: Nevermind, my idea was to make a sector with another sector inside of it. The exterior sector would terminate the script and the inner sector would execute it. Problem is that the inner sector's script only executes once i have touched another face/corner of it instead of working directly. Executealways and executewithresult makes the loop never go away despite telling it to stop, im running outta ideas :(
Here's the script in question:
It works pretty well, but problem is either it doesn't start correctly or simply won't stop
EDIT: I think i may have figured something, but i need to figure how to make a script break the loop of another script. Ima try to make a hudmessage that loops very rapidly and stops once another sector is hit
EDIT 2: Okay i think i solved it, thanks for the help!
EDIT 3: Nevermind, my idea was to make a sector with another sector inside of it. The exterior sector would terminate the script and the inner sector would execute it. Problem is that the inner sector's script only executes once i have touched another face/corner of it instead of working directly. Executealways and executewithresult makes the loop never go away despite telling it to stop, im running outta ideas :(
Here's the script in question:
Code: Select all
#include "zcommon.acs"
script 1 (void)
{
SetFont("BIGFONT");
HudMessage(s:"you currently own ",
d:CheckInventory("Shell"),
s:" of these!";
HUDMSG_PLAIN, 1, CR_YELLOW, 0.1, 0.1, 0.1);
delay(1);
Restart;
}