Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to end custom story as a Demo?
Author Message
Snuffalofagus Offline
Member

Posts: 94
Joined: Jul 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Vackert Kreatur Offline
Senior Member

Posts: 308
Joined: Jan 2011
Reputation: 5
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
Snuffalofagus Offline
Member

Posts: 94
Joined: Jul 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Vackert Kreatur Offline
Senior Member

Posts: 308
Joined: Jan 2011
Reputation: 5
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
Snuffalofagus Offline
Member

Posts: 94
Joined: Jul 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
convolution223 Offline
Member

Posts: 79
Joined: Jul 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Vackert Kreatur Offline
Senior Member

Posts: 308
Joined: Jan 2011
Reputation: 5
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
Snuffalofagus Offline
Member

Posts: 94
Joined: Jul 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
xtron Offline
Senior Member

Posts: 402
Joined: May 2011
Reputation: 2
Post: #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 all posts by this user Quote this message in a reply
Snuffalofagus Offline
Member

Posts: 94
Joined: Jul 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)