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
Script Help Wake up script
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#41
RE: Wake up script

(05-10-2012, 01:38 PM)Adrianis Wrote: Dude you need to tell us whats wrong. Is there a script error, is the thing just not happening, is it all happenin too fast or is just one part not working? Yes, OnStart should be at the top. TBH I've never tried having it elswhere but I don't think it would react too well, and for organisational purposes I recommend always having OnStart at the start of the script, as this is where the initial setup of variables and callbacks should take place.

It looks like there is still no callback in OnStart to actually start the WakeUp, which you may want. Also, all the stuff in your WakeUp function is going to be executed immediately and simultaneously, from whats in there you probably want some parts to be delayed. Things like the FadeIn/Out, SetPlayerActive/Crouching etc should be done in OnStart. If this wakeing up happens immediatly at the start of the game, then you will probably want all of it in OnStart.

If I was in your position right now, the best thing I could do to figure this out is find a working example of a script for this sort of 'waking up' sequence, study it, and replicate bit by bit till you understand all the parts that are going in. The problem is that this can be quite a complicated sequence to achieve, and if you are not familiar with the flow of logic and how to use functions/loops you may find it very difficult.
I did put it back on top... and I have looked at the wake up thing from the Nepsis story...... holy christ that makes no sense!!!! And... what makes even less sense... there's no calback! ANYWHERE.......
world.... Y U MAKE NO SENSE??

05-10-2012, 07:24 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#42
RE: Wake up script

There may be a way to do what you, I couldn't tell you because I haven't got Nepsis, but then if I look at scripts from people much much better than myself, there always seems to be crazy impossible shit, which actually makes perfect sense when you learn more about angel scripting in general.

However, there is a much easier and perfectly possible way to do what you want to do, and that is by taking those functions out of WakeUp and making them work in OnStart. Check this out...

This is a sample from one of my maps, at the start i wanted the player to be looking up, whilst crouched down. It's the closest approximation from what I've done to what your trying to do.

void OnStart()
{
//player settings for start
SetPlayerCrouching(true);
StartPlayerLookAt("ScriptArea_1", 1.5, 3, "StopLookingAtStart");
FadeOut(0);
AddTimer("", 1.5, "FadeInFunc");
PlayMusic("Opening Cut 1.ogg", false, 1, 1, 10, true);
}

// FUNCTIONS FOR PLAYER LOOKING AT START /////////////////

void StopLookingAtStart()
{
StopPlayerLookAt();
}

void FadeInFunc(string &in asTimer)
{
FadeIn(3);
}

Everything that needs to happen at the very moment the loading is finished and the game starts, goes into OnStart. At the outset, the player needs to crouch, look up, the screen needs to be black, music starts, and there's a timer to start a fade in once the player's view stops moving. I needed the Fade In delayed to cover the fact that the camera is moving at the start of the game, otherwise it looks dumb. The commented lines help me figure out which functions belong to which callbacks

If you apply that kind of thinking to your intro, then you can figure out what needs to be in OnStart, and what needs to be in functions called by timers and collide callbacks (depending on how you like your intro's). Once you can do that, you'll be in a better position to figure out what was done in Nepsis, and you might find it is better that way
05-10-2012, 09:38 PM
Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#43
RE: Wake up script

(05-10-2012, 09:38 PM)Adrianis Wrote: There may be a way to do what you, I couldn't tell you because I haven't got Nepsis, but then if I look at scripts from people much much better than myself, there always seems to be crazy impossible shit, which actually makes perfect sense when you learn more about angel scripting in general.

However, there is a much easier and perfectly possible way to do what you want to do, and that is by taking those functions out of WakeUp and making them work in OnStart. Check this out...

This is a sample from one of my maps, at the start i wanted the player to be looking up, whilst crouched down. It's the closest approximation from what I've done to what your trying to do.

void OnStart()
{
//player settings for start
SetPlayerCrouching(true);
StartPlayerLookAt("ScriptArea_1", 1.5, 3, "StopLookingAtStart");
FadeOut(0);
AddTimer("", 1.5, "FadeInFunc");
PlayMusic("Opening Cut 1.ogg", false, 1, 1, 10, true);
}

// FUNCTIONS FOR PLAYER LOOKING AT START /////////////////

void StopLookingAtStart()
{
StopPlayerLookAt();
}

void FadeInFunc(string &in asTimer)
{
FadeIn(3);
}

Everything that needs to happen at the very moment the loading is finished and the game starts, goes into OnStart. At the outset, the player needs to crouch, look up, the screen needs to be black, music starts, and there's a timer to start a fade in once the player's view stops moving. I needed the Fade In delayed to cover the fact that the camera is moving at the start of the game, otherwise it looks dumb. The commented lines help me figure out which functions belong to which callbacks

If you apply that kind of thinking to your intro, then you can figure out what needs to be in OnStart, and what needs to be in functions called by timers and collide callbacks (depending on how you like your intro's). Once you can do that, you'll be in a better position to figure out what was done in Nepsis, and you might find it is better that way
Fine... I'll try to look into it... AGAIN.... While I fuck up my story once again.. could you tell me whats wrong with this cute little door and key script? Cause I see nothing wrong... AT ALL
And yes, everything is named right, bla bla... it's simply stopped working outta NOWHERE..

AddUseItemCallback("", "MasterBedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("masterbedroomdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "masterbedroomdoor", 0, false);
PlaySoundAtEntity("", "03_puzzle_secret", "Player", 0, false);
RemoveItem("MasterBedroomkey");
}

05-10-2012, 10:33 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#44
RE: Wake up script

Ok, now when you say its 'simply stopped working', do you mean its now saying 'You cannot use this item this way' or is the door not just not opening, or are you getting an error?
Also, what function is AddUseItemCallback part of?
05-10-2012, 10:51 PM
Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#45
RE: Wake up script

(05-10-2012, 10:51 PM)Adrianis Wrote: Ok, now when you say its 'simply stopped working', do you mean its now saying 'You cannot use this item this way' or is the door not just not opening, or are you getting an error?
Also, what function is AddUseItemCallback part of?
I mean... suddenly it said Cannot use item this way... and nope, no error, and uh... that is part of a bigger group of callback... dunno if it makes any difference... I hardly think so...
//Callbacks
AddEntityCollideCallback("Player", "Spawnmusic", "PlayMusic", true, 1);
AddEntityCollideCallback("Player", "Stopmusic", "StopMusic", true, 1);
AddEntityCollideCallback("Player", "Missingstaff", "Message1", true, 1);
AddEntityCollideCallback("Player", "Guarddogthoughts", "Message2", true, 1);
AddUseItemCallback("", "MasterBedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide2", "MonsterFunction2", true, 1);
}

05-10-2012, 11:19 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#46
RE: Wake up script

Sorry but I mean the function, not just whether its in a group. Are those all in OnStart?
05-11-2012, 12:01 AM
Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#47
RE: Wake up script

(05-11-2012, 12:01 AM)Adrianis Wrote: Sorry but I mean the function, not just whether its in a group. Are those all in OnStart?
Oh right.... sry, getting tired here... but yup

(This post was last modified: 05-11-2012, 12:06 AM by Saren.)
05-11-2012, 12:05 AM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#48
RE: Wake up script

Well, I can't see anything wrong with that. Something must have changed between when it was working and now that it is not. Without knowing what you've done, sadly, I don't think I can be much help. You know what needs to happen for that to work, so run over all the parts. If you really can't figure it out, redo the door, and the key, and rewrite the script
05-11-2012, 09:37 AM
Find
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#49
RE: Wake up script

(05-11-2012, 09:37 AM)Adrianis Wrote: Well, I can't see anything wrong with that. Something must have changed between when it was working and now that it is not. Without knowing what you've done, sadly, I don't think I can be much help. You know what needs to happen for that to work, so run over all the parts. If you really can't figure it out, redo the door, and the key, and rewrite the script
Yeah... I was afraid you'd say that... lol.... oh well..

05-11-2012, 10:31 AM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#50
RE: Wake up script

(05-11-2012, 10:31 AM)Saren Wrote:
(05-11-2012, 09:37 AM)Adrianis Wrote: Well, I can't see anything wrong with that. Something must have changed between when it was working and now that it is not. Without knowing what you've done, sadly, I don't think I can be much help. You know what needs to happen for that to work, so run over all the parts. If you really can't figure it out, redo the door, and the key, and rewrite the script
Yeah... I was afraid you'd say that... lol.... oh well..
No need to fear, it won't take a sec to rewrite it now that you know what is required. Just check the names of the items, comment out your previous lines and write out some new ones
05-11-2012, 01:35 PM
Find




Users browsing this thread: 19 Guest(s)