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 end custom story as a Demo?
Zypherzemus Offline
Member

Posts: 94
Threads: 7
Joined: Jul 2011
Reputation: 0
#11
RE: How to end custom story as a Demo?

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?
07-14-2011, 04:08 AM
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#12
RE: How to end custom story as a Demo?

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

Creator of The Dark Treasure.
07-14-2011, 05:16 AM
Website Find
Zypherzemus Offline
Member

Posts: 94
Threads: 7
Joined: Jul 2011
Reputation: 0
#13
RE: How to end custom story as a Demo?

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?
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
07-14-2011, 06:26 AM
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#14
RE: How to end custom story as a Demo?

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

Creator of The Dark Treasure.
07-14-2011, 06:57 AM
Website Find
Zypherzemus Offline
Member

Posts: 94
Threads: 7
Joined: Jul 2011
Reputation: 0
#15
RE: How to end custom story as a Demo?

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
Find
convolution223 Offline
Member

Posts: 78
Threads: 15
Joined: Jul 2011
Reputation: 0
#16
RE: How to end custom story as a Demo?

(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)?
07-14-2011, 07:13 AM
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#17
RE: How to end custom story as a Demo?

In your UseItem script, put:

SetLocalVarInt("CreditVar", 1);

And at your If statement:

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 ^^

Creator of The Dark Treasure.
07-14-2011, 07:13 AM
Website Find
Zypherzemus Offline
Member

Posts: 94
Threads: 7
Joined: Jul 2011
Reputation: 0
#18
RE: How to end custom story as a Demo?

(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:
void OnGameStart()
{

}
07-14-2011, 07:26 AM
Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#19
RE: How to end custom story as a Demo?

Did you try my code? 'cuz a friend used it and it worked...

[Image: 44917299.jpg]Dubstep <3
07-14-2011, 12:30 PM
Find
Zypherzemus Offline
Member

Posts: 94
Threads: 7
Joined: Jul 2011
Reputation: 0
#20
RE: How to end custom story as a Demo?

(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.
07-14-2011, 05:44 PM
Find




Users browsing this thread: 2 Guest(s)