Frictional Games Forum (read-only)

Full Version: How to end custom story as a Demo?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Would an InteractiveCallback work?
If so how? I'm pretty sure "If" statements are gonna be used Tongue
Ex: In the beginning, the level door is locked and cannot be opened without a key. you go into 2 other maps and retrieve the key, you come back, you unlock the door then the credits start.
Catch my drift?
Make an "if" statement to check if the door is unlocked, and in that case, fade out and set a timer to start credits after your fade out is complete. Smile
bool GetSwingDoorLocked(string& asName);
bool GetSwingDoorClosed(string& asName);

Checks whether a swing door is locked/closed.

Ok, so I found this.. Would it work if instead of "Swing" you put "Level"?
I'm using this on a level door.
and What would the command look like?
Code:
If (GetLevelDoorLocked("labdoor") == false)
{
FadeOut(2.0f)
AddTimer("", 2.0f, "DemoCredits");
}

void DemoCredits(string &in asTimer)
{
StartCredits("01_Vicarious.ogg", false, "Ending", "MainCredits", 1);
}

I'm only guessing on this, I don't know if it's correct
Hmm, I suppose you can use a local variable.

When you use the key on the door, set a local variable to 1, and then make an if-statement; if local_variable is equal to 1, fade out, roll credits. Wink
EEK, I'm not very good with variables and such.
Hmm...
AddLocalVarInt? or SetLocalVarInt?
and would I need to make a new .hps file strictly for local variables? (kinda like global variables)
and If not, where would the command(s) go? OnStart, or OnEnter?
sorry for all the questions, I'd rather ask them now and not bug you later y'know?
(07-14-2011, 07:08 AM)Snuffalofagus Wrote: [ -> ]EEK, I'm not very good with variables and such.
Hmm...
AddLocalVarInt? or SetLocalVarInt?
and would I need to make a new .hps file strictly for local variables? (kinda like global variables)
and If not, where would the command(s) go? OnStart, or OnEnter?
sorry for all the questions, I'd rather ask them now and not bug you later y'know?

:o wait... you need to make a new .hps file for global variables? I was trying to use global variables I set up in one map in a different map and it wasn't working, but are you sure you set up another .hps file? what would it be called and what would it look like (or just point me to where i can find an example from the main game, please)?
In your UseItem script, put:

Code:
SetLocalVarInt("CreditVar", 1);

And at your If statement:

Code:
if (GetLocalVarInt("CreditVar") == 1)
{
FadeOut(2.0f)
AddTimer("", 2.0f, "DemoCredits");
}

void DemoCredits(string &in asTimer)
{
StartCredits("01_Vicarious.ogg", false, "Ending", "MainCredits", 1);
}

I only quickly made this, could be an error or two, but try that ^^
(07-14-2011, 07:13 AM)convolution223 Wrote: [ -> ]
(07-14-2011, 07:08 AM)Snuffalofagus Wrote: [ -> ]EEK, I'm not very good with variables and such.
Hmm...
AddLocalVarInt? or SetLocalVarInt?
and would I need to make a new .hps file strictly for local variables? (kinda like global variables)
and If not, where would the command(s) go? OnStart, or OnEnter?
sorry for all the questions, I'd rather ask them now and not bug you later y'know?

:o wait... you need to make a new .hps file for global variables? I was trying to use global variables I set up in one map in a different map and it wasn't working, but are you sure you set up another .hps file? what would it be called and what would it look like (or just point me to where i can find an example from the main game, please)?

It's very simple. You use the "(Add, Set, etc.)GlobalVar(Int, Float, String, etc.) and place it in the .hps file. It's supposed to be named "global.hps"
and it's only one section.
Here:
Code:
void OnGameStart()
{

}
Did you try my code? 'cuz a friend used it and it worked...
(07-14-2011, 12:30 PM)xtron Wrote: [ -> ]Did you try my code? 'cuz a friend used it and it worked...

I kinda want it to be interactive because, I f you use a script area, it could be triggered at any time, which I don't want, unless there's another script for that, wow this is so much for me just wanting to end the damn demo :/
I don't know why it doesn't work when I load the credits map.. Its full of nothing but credits, yet it doesn't work. ugh.

@junkfood2121 It didn't work.
Pages: 1 2 3 4 5