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
How to make Candle Go out?
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#11
RE: How to make Candle Go out?

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Start", "CollideStart", true, 1);
}

void CollideStart(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candlestick_floor_1", false, true);
}

Theres my script... It's just a test so I can do this later on.

And what do you mean just put it in the void OnStart Parameters

////////////////////////////
// Run first time starting map
void OnStart(Here?)
{
Or Here?
}

Thanks
-Grey Fox

Current Project
Forgotten
11-22-2011, 02:51 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#12
RE: How to make Candle Go out?

(11-22-2011, 02:10 AM)GreyFox Wrote: Mind Posting your Script real quick? Very odd, and I have a second question if you wouldn't mind.

Can you Make something happen When you enter the Map. IE The way I've been doing it is, I Want a Timer right at the start of the map I Make a Script area (At the 1st playerstartarea) and Name it Start

Is there a way where I don't need that and Can just add anything? (it gets quite alot of scripting when you have to type similar things 15 times)

All my script had was SetLampLit in OnStart.

As for your other question, why not just add the timer in OnEnter?

(11-22-2011, 02:51 AM)GreyFox Wrote: Theres my script... It's just a test so I can do this later on.

In that case you may want to add a debug message in the collide callback to see if it gets triggered. Is "Start" a Script area or PlayerStart area? PlayerStart areas don't "support" entity collisions.

Tutorials: From Noob to Pro
11-22-2011, 05:28 AM
Website Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#13
RE: How to make Candle Go out?

debug messages only show up in a dev enviorment correct?

and "Start" is a Script/Trigger Area.

Thanks
-Grey Fox

Current Project
Forgotten
11-22-2011, 12:36 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#14
RE: How to make Candle Go out?

(11-22-2011, 12:36 PM)GreyFox Wrote: debug messages only show up in a dev enviorment correct?

and "Start" is a Script/Trigger Area.

Thanks
-Grey Fox
Type something like this in your .hps:
//______________________

void OnStart()
{
AddTimer("", TIME, "CALLBACK_FUNC_NAME");
}

void CALLBACK_FUNC_NAME(string &in asTimer)
{
//What happens after the time runs out.
}
11-22-2011, 10:27 PM
Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#15
RE: How to make Candle Go out?

I Found out why it wasn't work.

My .HPS was named Entance, instead of Entrance... Damn do I feel retarded. haha

I Have another question though.

I Don't use levers alot, and I Have a Bathroom, and I though it'd be cool if you could turn the water on and off.

So I go the lever turning the water on just not off. would you mind helping me get it so when I pull up on the leave the particle system disappears.

////////////////////////////
// Run first time starting map
void OnStart()
{
AddTimer("", 5, "Light");
SetEntityConnectionStateChangeCallback("Button1", "StartWater");
}

void Light(string &in asTimer)
{
    SetLampLit("modern_mine_flour_light_shadowH_6", false, false);
}

void StartWater(string &in asEntity, int alState)
{
    if (alState == 1)
    {
    CreateParticleSystemAtEntity("", "ps_water_stream.ps", "WaterPS1", false);
        return;
    }
}

Thanks
-Grey Fox

Current Project
Forgotten
11-23-2011, 02:09 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#16
RE: How to make Candle Go out?

(11-23-2011, 02:09 AM)GreyFox Wrote: I Don't use levers alot, and I Have a Bathroom, and I though it'd be cool if you could turn the water on and off.

So I go the lever turning the water on just not off. would you mind helping me get it so when I pull up on the leave the particle system disappears.

One thing you should get used to doing is providing an internal name where allowed. You can't destroy a particle system if you don't have any way of differentiating it from the rest.

PHP Code: (Select All)
void StartWater(string &in asEntityint alState)
{
    
/* 
     *  You should consider naming your areas asEntity + "_area" like i have done with
     *     the particle systems. You should be able to understand what i mean by that.
     *  In this way you can use this function for all bathroom "levers."
     */
    
if (alState == 1)
        
CreateParticleSystemAtEntity(asEntity "_ps""ps_water_stream.ps"asEntity "_area"false);
    else
        
DestroyParticleSystem(asEntity "_ps");


Tutorials: From Noob to Pro
(This post was last modified: 11-23-2011, 04:00 AM by Your Computer.)
11-23-2011, 03:58 AM
Website Find




Users browsing this thread: 1 Guest(s)