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
[Updated thread] Need help
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#91
RE: [Updated thread] Need help

Your AddTimers end up stacking, since your timer checks each if-statement, and say, your health and sanity are 100, then the code adds two AmountOfHealth timers. Then 3 seconds later, they both execute, and once again, adds 2 timers but does so twice because the two AmountOfHealth timers run, four timers run next time, etc.

So what we do, is we remove all the AddTimers, except one which will execute at the end of the whole Timer. This will keep the one looping timer.

Then we remove the last GetPlayerSanity(), because it doesn't do anything.

We end up with this:
Spoiler below!
PHP Code: (Select All)
void AmountOfHealth(string &in asTimer)
{
if(
GetPlayerHealth() < 51.0f)
{
PlaySoundAtEntity("Player""woman_breath.snt""Player"0false);
FadeSepiaColorTo(1,1);
}
if(
GetPlayerHealth() > 51.0f)
{
FadeSepiaColorTo(0,1);
}
if(
GetPlayerSanity() < 45.0f)
{
PlaySoundAtEntity("Player""insanity_whispers.snt""Player"0false);
}
AddTimer(""3"AmountOfHealth");



You can also "lower" the number of if-checks by using an else statement.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 03-24-2015, 08:53 AM by Romulator.)
03-24-2015, 08:49 AM
Find
Catalyst Offline
Member

Posts: 213
Threads: 32
Joined: Aug 2014
Reputation: 3
#92
RE: [Updated thread] Need help

Thank you Romulator, welcome back Smile

Egypt CS
[Image: 27003.png]
03-24-2015, 04:34 PM
Find
Catalyst Offline
Member

Posts: 213
Threads: 32
Joined: Aug 2014
Reputation: 3
#93
RE: [Updated thread] Need help

Greetings again...

I need a example of script, of changing state of entity or something else. I need for elevator activation rods. Something like ifEntityState==then, I don't know, you are pro at these scripts. Example, when I put first guilding rod, or one of them then state is 1 if 2/3 of them are in guilding machine, the state is 2, when all rods are placed, state is 3, and something, ifGetEntityState==3 then (bla bla, there I know what to do, when it's done, I can create some particles, sounds and then unblock elevator lever and proceed to next gameplay event)

Thank you

Egypt CS
[Image: 27003.png]
03-26-2015, 08:09 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#94
RE: [Updated thread] Need help

Use a local variable.

When you place a rod, run AddLocalVarInt("Rods", 1);
When you remove a rod, run AddLocalVarInt("Rods", -1);

Then run after those, the check:
PHP Code: (Select All)
if(GetLocalVarInt("Rods") == 3) {
    
//Do something


03-26-2015, 08:29 PM
Find
Catalyst Offline
Member

Posts: 213
Threads: 32
Joined: Aug 2014
Reputation: 3
#95
RE: [Updated thread] Need help

Hm, it's really working, but you can give a example of Sanityboost screen effect? Sure if it's exists.
This blue effect, but with changed color R G B A amount, or such kind of effect doesnt exist? I have some ideas how to use it. Can you help me? Thanks.

Egypt CS
[Image: 27003.png]
03-27-2015, 02:05 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#96
RE: [Updated thread] Need help

You can give the sanity effect using GiveSanityBoost(); or GiveSanityBoostSmall();

The color is defined in the game.cfg file and can only be modified with a FC mod.

03-27-2015, 02:08 PM
Find
Catalyst Offline
Member

Posts: 213
Threads: 32
Joined: Aug 2014
Reputation: 3
#97
RE: [Updated thread] Need help

People, I have an question about models, it is possible to export model, with two textures per object and show them both? Everytime only one of texture is shown... To split these objects in two is almost impossible for noobie like me, so is possible to save both textures, is there a way out ? Confused

Egypt CS
[Image: 27003.png]
(This post was last modified: 03-27-2015, 06:43 PM by Catalyst.)
03-27-2015, 05:50 PM
Find
Traggey Offline
is mildly amused

Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation: 185
#98
RE: [Updated thread] Need help

NOPE!
03-27-2015, 07:43 PM
Find
Catalyst Offline
Member

Posts: 213
Threads: 32
Joined: Aug 2014
Reputation: 3
#99
RE: [Updated thread] Need help

(03-27-2015, 07:43 PM)Traggey Wrote: NOPE!

Bad, bad, bad, BAD :/

Egypt CS
[Image: 27003.png]
03-28-2015, 09:13 AM
Find
Traggey Offline
is mildly amused

Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation: 185
RE: [Updated thread] Need help

3D's Max has a function called ''Select by material ID'' making the splitting you want super easy, maya does not have this and I don't know about blender, but you could try googling for it.
03-28-2015, 03:33 PM
Find




Users browsing this thread: 1 Guest(s)