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


Thread Rating:
  • 4 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Anyone need help?
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#91
RE: Anyone need help?

Yup, no "if" statements involved. Any more questions? Tongue

05-11-2011, 10:57 PM
Find
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
#92
RE: Anyone need help?

(05-11-2011, 10:55 PM)Ge15t Wrote: Oh wow that is easy! Also really simple, I cant believe I didnt think of that lol. Thanks heaps!

Wow! nice one kyle, i never thought of that! I use a different method xD
{
AddEntityCollideCallback("Player", "Area_1", "Func1", true, 1);
AddEntityCollideCallback("Player", "Area_2", "Func2", true, 1);
}
void Func1(string &in asParent, string &in asChild, string intalState)
{
SetEntityActive("Area_2", true);
}
void Func2(string &in asParent, string &in asChild, string intalState)
{
What you want to happen here
}



Using this method i set the entity (the area) inactive in the editor so it only becomes active when i walk into Area_1 =)
Similar idea though ^_^
05-11-2011, 11:01 PM
Find
Ge15t Offline
Junior Member

Posts: 48
Threads: 8
Joined: Feb 2011
Reputation: 0
#93
RE: Anyone need help?

Hi there, another problem!

void OnStart()
AddEntityCollideCallback("Player", "PianoArea_1", "PianoPlayCallback", true, 1);

void PianoPlayCallback(string &in asParent, string &in asChild, int alState)
{

    PlaySoundAtEntity("", "03_waking_up.snt", "Player", 0, false);
    AddPropImpulse("piano_1", 0, 100, 0, "World");
    AddPropImpulse("piano_2", 0, 100, 0, "World");
    AddPropImpulse("piano_3", 0, 100, 0, "World");
    SetLampLit("CandleActivate_1", true, false);
    SetLampLit("CandleActivate_2", true, false);
    SetLampLit("CandleActivate_3", true, false);
    SetLightVisible("PointLightActivate_1", true);
    SetLightVisible("PointLightActivate_2", true);
    SetLightVisible("PointLightActivate_3", true);
    
}

So when I hit the area, it calls this function which activates point lights and candles, and the sound effect, so its like as i touch the bottom of the stairs, lights activate at the top and haunting piano music starts playing to phantom pianos..

But what happens is the lights are off and DONT come on, and the point lights STAY on, even though I deactivated both the candles and the pointlights.

Any tips?
05-12-2011, 09:46 AM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#94
RE: Anyone need help?

One time, I was designing a light time system that is like a full day that then switched every 10 minutes to the next hour. But when I tried it, it didn't work and nothing happened.

Suggestions:

1. If there is a .mapcache file, delete it.

2. Check to see if you actually did deactive the lights.

3. Check the script in case you somehow set them active before you wanted to.

05-12-2011, 10:55 AM
Find
Ge15t Offline
Junior Member

Posts: 48
Threads: 8
Joined: Feb 2011
Reputation: 0
#95
RE: Anyone need help?

(05-12-2011, 10:55 AM)Kyle Wrote: One time, I was designing a light time system that is like a full day that then switched every 10 minutes to the next hour. But when I tried it, it didn't work and nothing happened.

Suggestions:

1. If there is a .mapcache file, delete it.

2. Check to see if you actually did deactive the lights.

3. Check the script in case you somehow set them active before you wanted to.

Yeah theres a .map_cache file but its 20mb.. are you sure I should delete it?
05-12-2011, 11:16 AM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#96
RE: Anyone need help?

You can delete it. It just makes the level load faster. It will get replaced by an updated one later on.

05-12-2011, 11:21 AM
Find
Dominic0904 Offline
Member

Posts: 63
Threads: 14
Joined: Apr 2011
Reputation: 0
#97
RE: Anyone need help?

Sorry to basically be reposting this, dunno if you missed it Kyle but it was about the doors that the grunt was hitting

Quote:Aha, thanks again dude...one minor other thing...Testing the map, I hid in a cabinet after the monster saw me. He started to hit the doors, but the doors don't seem to be breaking. He's hit them a good ten times roughly now. I haven't got "DisableBreakable" box checked, maybe he's just a weakling...Tongue

While the door he breaks down seems rather weak. He takes two hits and it's down. While I remember it usually took at least 3-4 hits beforehand...is it something do to with the pathnodes he is assigned too? Makes him stronger?


that's what I said, dunno if you just didn't know or missed it Tongue
(This post was last modified: 05-12-2011, 01:11 PM by Dominic0904.)
05-12-2011, 01:10 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#98
RE: Anyone need help?

Oops, sorry. I think the monster hits random damages between it's low and high. Or it just depends on the health of the door. It also might depend if he seen you not.

05-12-2011, 08:00 PM
Find
Ge15t Offline
Junior Member

Posts: 48
Threads: 8
Joined: Feb 2011
Reputation: 0
#99
RE: Anyone need help?

void PianoPlayCallback(string &in asParent, string &in asChild, int alState)
{

    PlaySoundAtEntity("", "03_waking_up.snt", "Player", 0, false);
    AddPropImpulse("piano_1", 0, 100, 0, "World");
    AddPropImpulse("piano_2", 0, 100, 0, "World");
    AddPropImpulse("piano_3", 0, 100, 0, "World");
    SetLampLit("CandleActivate_1", true, true);
    SetLampLit("CandleActivate_2", true, true);
    SetLampLit("CandleActivate_3", true, true);
    SetLightVisible("PointLightActivate_1", true);
    SetLightVisible("PointLightActivate_2", true);
    SetLightVisible("PointLightActivate_3", true);
    
}

Ok so i managed to get the lights to come on, but the point lights either stay active (if they are checked 'active' in the editor) or stay off (if they are unchecked). I deleted my cache, but no luck so far with the point lights.
05-13-2011, 12:21 AM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
RE: Anyone need help?

Ge15t:

Alternative 1 (not sure of this one):
Spoiler below!

OnStart()
{
SetLightVisible("PointLightActivate_1", false);
SetLightVisible("PointLightActivate_2", false);
SetLightVisible("PointLightActivate_3", false);
}

void PianoPlayCallback(string &in asParent, string &in asChild, int alState)
{

PlaySoundAtEntity("", "03_waking_up.snt", "Player", 0, false);
AddPropImpulse("piano_1", 0, 100, 0, "World");
AddPropImpulse("piano_2", 0, 100, 0, "World");
AddPropImpulse("piano_3", 0, 100, 0, "World");
SetLampLit("CandleActivate_1", true, true);
SetLampLit("CandleActivate_2", true, true);
SetLampLit("CandleActivate_3", true, true);
SetLightVisible("PointLightActivate_1", true);
SetLightVisible("PointLightActivate_2", true);
SetLightVisible("PointLightActivate_3", true);

}


Alternative 2 (Will work for sure):
Spoiler below!

void PianoPlayCallback(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "03_waking_up.snt", "Player", 0, false);
AddPropImpulse("piano_1", 0, 100, 0, "World");
AddPropImpulse("piano_2", 0, 100, 0, "World");
AddPropImpulse("piano_3", 0, 100, 0, "World");
SetLampLit("CandleActivate_1", true, true);
SetLampLit("CandleActivate_2", true, true);
SetLampLit("CandleActivate_3", true, true);
FadeLightTo("PointLightActivate_1", float afR, float afG, float afB, float afA, -1.0f, float afTime);
FadeLightTo("PointLightActivate_2", float afR, float afG, float afB, float afA, -1.0f, float afTime);
FadeLightTo("PointLightActivate_3", float afR, float afG, float afB, float afA, -1.0f, float afTime);
}

afR = red amount
afG = green amount
afB = blue amount
afA = alpha amount
afTime = time in seconds of change (I'm guessing set to 0 in your case, as the pointlights represents the candles)
the -1.0f means that the pointlights should keep their previous radius.

What you do now is go into the mapeditor - have all lights active.
Then check their color R,G,B and A. Copy these numbers (amount of R,G,B and A) into the script.
Then back into the mapeditor and set all of the pointlights R,G,B and A to 0. Thus they will not project any light/color until told to by the script.


[Image: mZiYnxe.png]


(This post was last modified: 05-13-2011, 12:36 AM by Acies.)
05-13-2011, 12:35 AM
Find




Users browsing this thread: 1 Guest(s)