Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help HUD Problem
SSEAlexander Offline
Senior Member

Posts: 422
Threads: 26
Joined: Feb 2014
Reputation: 1
#1
HUD Problem

I have problem with my hud.
My entire sanity events .txt :

<InsanityEvents>

<SoundStream
Name = "event_1a"
Set = "PHONE"
MaxSanity = "95"

File = "silence.ogg"
Volume = "1"
SoundDelayTime = "0.2"

FadeScreen = "true"
FadeColor = "1 1 1 1"
FadeInTime = "0"
FadeOutTime = "1000000000"

FadeImageFile = "cbradio.tga"

DisablePlayer = "false"
/>
<SoundStream
Name = "event_1b"
Set = "PHONE"
MaxSanity = "95"

File = "silence.ogg"
Volume = "1"
SoundDelayTime = "0.2"

FadeScreen = "true"
FadeColor = "1 1 1 1"
FadeInTime = "0"
FadeOutTime = "1000000000"

FadeImageFile = "cbradio.tga"

DisablePlayer = "false"
/>
<SoundStream
Name = "event_1c"
Set = "PHONE"
MaxSanity = "95"

File = "silence.ogg"
Volume = "1"
SoundDelayTime = "0.2"

FadeScreen = "true"
FadeColor = "1 1 1 1"
FadeInTime = "0"
FadeOutTime = "1000000000"

FadeImageFile = "cbradio.tga"

DisablePlayer = "false"
/>


<SoundStream
Name = "event_m4"
Set = "M4A4"
MaxSanity = "95"

File = "silence.ogg"
Volume = "0"
SoundDelayTime = "0.2"

FadeScreen = "true"
FadeColor = "1 1 1 1"
FadeInTime = "0"
FadeOutTime = "1000000000"

FadeImageFile = "m4a4.tga"

DisablePlayer = "false"
/>

</InsanityEvents>

Script that i use:

To enable :

void GoCheckthehud(string &in Timer)
{
SetLocalVarInt("PHONEHUD", 1);
SetInsanitySetEnabled("HUD2", false);
SetInsanitySetEnabled("HUD3", false);
SetInsanitySetEnabled("HUD4", false);
SetInsanitySetEnabled("PHONE", true);
AddTimer("reconfigure", 0, "reconfigure");
AddTimer("startevent", 0.1, "startevent");
SetEntityActive("stopradio",true) ;
SetEntityActive("stopradio_1",true) ;
PlaySoundAtEntity("radko", "scpradio0r.snt", "Player", 0, true);
}

void reconfigure(string &in asTimer)
{
SetInsanitySetEnabled("HUD1", false);
SetInsanitySetEnabled("HUD2", false);
SetInsanitySetEnabled("HUD3", false);
SetInsanitySetEnabled("PHONE", true);
}

void startevent(string &in asTimer)
{
StartRandomInsanityEvent();
}

To Disable :

void GoStoptheHud(string &in entity)
{
SetInsanitySetEnabled("PHONE", false);
GiveItemFromFile("syr_2", "radio.ent");
SetEntityActive("stopradio",false) ;
SetEntityActive("stopradio_1",false) ;
SetGlobalVarInt("picked", 1);
AddTimer("config1", 0.1, "config1");
AddTimer("Used_timer", 1, "Used_timer");
StopSound("radko", 0.1);
}


void config1(string &in asTimer)
{
SetInsanitySetEnabled("Default", false);
SetInsanitySetEnabled("PHONE", false);
StartRandomInsanityEvent();
}

The problem is,It enables radio hud but...It also enables event_m4.
I want it to use radio only.But everytime it uses radio or m4 hud.
05-07-2014, 06:27 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#2
RE: HUD Problem

Well..
You are doing it the OLD way...
This way you should DISABLE all the other events you can fine in your sanityevent.cfg
You should DE_ACTIVATE \ DISABLE them in your YOURMAP.hps
on OnSTART or OnENTER
-
BUT in the NEW (beta) patch there is an actual script that calls for the event itself.
so you do NOT need to DE_ACTIVATE \ DISABLE the other events!
Only 1 line :
PHP Code: (Select All)
StartInsanityEvent("YOUREVENTHERE"); 
to STOP the event :
PHP Code: (Select All)
StopCurrentInsanityEvent(); 
(This post was last modified: 05-07-2014, 07:19 PM by DnALANGE.)
05-07-2014, 07:16 PM
Find
SSEAlexander Offline
Senior Member

Posts: 422
Threads: 26
Joined: Feb 2014
Reputation: 1
#3
RE: HUD Problem

well,I have The new Patch ,I used the script and...Poop...Nothing appears.
Nothing works,Just nothing.
Well,I need the old way to work.
Right?
05-07-2014, 07:18 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#4
RE: HUD Problem

Take a look at an Example from my Original PREMONITION mod.
Here take a look and try to understand.
PHP Code: (Select All)
////////Scripts made by DnALANGE ///////////

void OnStart()
{
/////HudShowsKeyInGarden/////
AddEntityCollideCallback("Player""HudMagnifierglass""MagnifierKeyGarden"false0);


                                 
/////Magnifierglass/////
    
void MagnifierKeyGarden(string &in asParentstring &in asChildint alState)
{
if(
alState == 1)
{
StartInsanityEvent("MagnifierGlass_1");
}

if(
alState == -1)
{
StopCurrentInsanityEvent();
}
}
                                          
/////EndHud///// 
-----
What this does is when your are INSIDE a SCRIPTAREA (HudMagnifierglass) the event is there, when you LEAVE the SCRIPTAREA the event will STOP.
(This post was last modified: 05-07-2014, 07:27 PM by DnALANGE.)
05-07-2014, 07:20 PM
Find
SSEAlexander Offline
Senior Member

Posts: 422
Threads: 26
Joined: Feb 2014
Reputation: 1
#5
RE: HUD Problem

(05-07-2014, 07:20 PM)DnALANGE Wrote: Take a look at an Example from my Original PREMONITION mod.
Here take a look and try to understand.

i need to download your mod?
Eh...

(05-07-2014, 07:20 PM)DnALANGE Wrote: Take a look at an Example from my Original PREMONITION mod.
Here take a look and try to understand.
PHP Code: (Select All)
////////Scripts made by DnALANGE ///////////

void OnStart()
{
/////HudShowsKeyInGarden/////
AddEntityCollideCallback("Player""HudMagnifierglass""MagnifierKeyGarden"false0);


                                 
/////Magnifierglass/////
    
void MagnifierKeyGarden(string &in asParentstring &in asChildint alState)
{
if(
alState == 1)
{
StartInsanityEvent("MagnifierGlass_1");
}

if(
alState == -1)
{
StopCurrentInsanityEvent();
}
}
                                          
/////EndHud///// 
-----
What this does is when your are INSIDE a SCRIPTAREA (HudMagnifierglass) the event is there, when you LEAVE the SCRIPTAREA the event will STOP.

Doeessnt work.
I used StartInsanityEvent("M4A4");
to the
"OnStart"
and nothing happened.Just tell me old script...
(This post was last modified: 05-07-2014, 07:30 PM by SSEAlexander.)
05-07-2014, 07:21 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: HUD Problem

Well, DNA got his script working.
I recall he had to use the script line twice some times, if i'm correct?

Maybe your HUD is actually appearing, but the image file is not shown.
Make sure everything about the image is made correctly. I'm not sure what "Correctly" is, but if you can make it correct, there's gotta be mistakes to make too!

Trying is the first step to success.
(This post was last modified: 05-07-2014, 08:23 PM by FlawlessHappiness.)
05-07-2014, 08:23 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#7
RE: HUD Problem

Dont use it onstart... should work tho...
please, if you can download premonition. Play it, learn from what i did, and look how i done it.
not behind my pc, sorry.
itshould 1000% work.
remember touse 32x32 64x64 512x512 etcetcc...
be sure to look if your pictures are good. And they have a pow2 size.
(This post was last modified: 05-07-2014, 09:23 PM by DnALANGE.)
05-07-2014, 09:20 PM
Find
SSEAlexander Offline
Senior Member

Posts: 422
Threads: 26
Joined: Feb 2014
Reputation: 1
#8
RE: HUD Problem

they do not have pow2 size.But they work.
And i do have 512x512.
05-09-2014, 03:31 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#9
RE: HUD Problem

(05-09-2014, 03:31 PM)stenclowskimat Wrote: they do not have pow2 size.But they work.
And i do have 512x512.

IIRC, any images you use have to use a POW2 size.

"Veni, vidi, vici."
"I came, I saw, I conquered."
05-09-2014, 04:20 PM
Find
SSEAlexander Offline
Senior Member

Posts: 422
Threads: 26
Joined: Feb 2014
Reputation: 1
#10
RE: HUD Problem

Well,
I cannot work with knolewge to do the hud.
Just tell me how to MAKE THAT SCRIPT WORK.
Not how it works.How to make it.
05-10-2014, 03:41 PM
Find




Users browsing this thread: 1 Guest(s)