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
WHAT IS WRONG?!!!!!!!!!!!!!
ProyectV Offline
Junior Member

Posts: 19
Threads: 6
Joined: Apr 2014
Reputation: 0
#11
RE: WHAT IS WRONG?!!!!!!!!!!!!!

(06-07-2014, 12:36 PM)Mudbill Wrote: eSpeed1 is defined as a float in the parameter of Again. The other Again that uses a string parameters does not conflict with the float one. Only constructors with the same parameters can conflict. For example, you can make OnStart("Answer") and OnStart(42) and neither of them will cause any issues for the normal OnStart() with no parameters.

@OP
So you're trying to reset the level if the player dies? I don't think OnEnter is called again when you respawn. You should use the CheckPoint script. It has a callback for when the player dies and where to respawn them.

PHP Code: (Select All)
CheckPoint (stringasNamestringasStartPosstringasCallbackstringasDeathHintCatstringasDeathHintEntry); 

Yeah, but the problem is that if i use a checkpoint function the monster will disappear and so far i know that if you use a checkpoint function you'r progress on the level will be saved and i want to start all the CS from the beginning. At least that's what i'be seen so far on the game... Btw. I already checked the possibility of the dead script, the function Again doesn't interfere with the rest of the script, so we can set that aside
(This post was last modified: 06-07-2014, 03:51 PM by ProyectV.)
06-07-2014, 03:41 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#12
RE: WHAT IS WRONG?!!!!!!!!!!!!!

You can use a CheckPoint and then in the asCallback (which is made by just adding a void Respawn() if you name it Respawn), you can reset the monster by reactivating it. SetEntityActive("MonsterName", true); will re-enable the monster after you respawn, and it should be re-enabled from its original location. If you use any variables, you can reset those by just setting them back to the initial value.

Whatever you put in OnStart will not happen again when you respawn or re-enter the level. You can, however, add all these checks to OnEnter (which it kinda looks like you've done already) and have them re-execute by reloading the map. I'd prefer to reset the level as much as possible without loading another map, but if you want, you can reload it.

In the CheckPoint callback, do a ChangeMap script to a small and empty map that just simply has a ChangeMap within its OnEnter block to return you to the previous level. It's a bit awkward perhaps to change levels twice in a row, but it should reset mostly anything in the map (except things that use FullGameSave).

(This post was last modified: 06-07-2014, 05:58 PM by Mudbill.)
06-07-2014, 05:58 PM
Find




Users browsing this thread: 2 Guest(s)