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
Can anyone help me? :)
Projektamensia Offline
Junior Member

Posts: 16
Threads: 3
Joined: Oct 2012
Reputation: 0
#1
Can anyone help me? :)

Hello there guys!

We are almost finished with out school project - Setting up our own amnesia custom story.

Now I need some help, I want to know how to reset a map.
With other words:
1. I got and scriptarea inside the map
2. When the players collides with the scriptarena box I want the map to reset to the state when I entered it for the first time. Change to OnEnter() did not work.


I tried this but it did not work:
void OnStart/(OnEnter)
{
AddEntityCollideCallback("Wall2", "Dead", "Deadd", true, 0);
}

void Deadd(string &in asParent, string &in asChild, int alState)
{
FadeOut(2);
AddTimer("", 3.0f, "ChaMap2");
}

void ChaMap2(string &in asTimer)
{
ChangeMap("10_Crushwall.map", "start", "", "");
}

I would be glad if someone could help me as fast as possible since we need to be done with the Beta soon. The Beta will include an Full conversion mod!

Thank you for all the answers, Alexander.
http://www.moddb.com/mods/the-horrors-of...reenborogh
12-24-2012, 09:48 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Can anyone help me? :)

(12-24-2012, 09:48 PM)Projektamensia Wrote: Hello there guys!

We are almost finished with out school project - Setting up our own amnesia custom story.

Now I need some help, I want to know how to reset a map.
With other words:
1. I got and scriptarea inside the map
2. When the players collides with the scriptarena box I want the map to reset to the state when I entered it for the first time. Change to OnEnter() did not work.


I tried this but it did not work:
void OnStart/(OnEnter)
{
AddEntityCollideCallback("Wall2", "Dead", "Deadd", true, 0);
}

void Deadd(string &in asParent, string &in asChild, int alState)
{
FadeOut(2);
AddTimer("", 3.0f, "ChaMap2");
}

void ChaMap2(string &in asTimer)
{
ChangeMap("10_Crushwall.map", "start", "", "");
}

I would be glad if someone could help me as fast as possible since we need to be done with the Beta soon. The Beta will include an Full conversion mod!

Thank you for all the answers, Alexander.
http://www.moddb.com/mods/the-horrors-of...reenborogh

I'm not sure exactly how the whole hps is written, or what the exact error is (what's wrong), but from looking at what you gave, try this:

void OnStart()
{
AddEntityCollideCallback("Player", "Dead", "Deadd", false, 1);
}

void Deadd(string &in asParent, string &in asChild, int alState)
{
FadeOut(2);
AddTimer("", 3.0f, "ChaMap2");
}

void ChaMap2(string &in asTimer)
{
ChangeMap("10_Crushwall.map", "start", "", "");
}
(This post was last modified: 12-24-2012, 09:52 PM by Statyk.)
12-24-2012, 09:52 PM
Find
Projektamensia Offline
Junior Member

Posts: 16
Threads: 3
Joined: Oct 2012
Reputation: 0
#3
RE: Can anyone help me? :)

(12-24-2012, 09:52 PM)Statyk Wrote:
(12-24-2012, 09:48 PM)Projektamensia Wrote: Hello there guys!

We are almost finished with out school project - Setting up our own amnesia custom story.

Now I need some help, I want to know how to reset a map.
With other words:
1. I got and scriptarea inside the map
2. When the players collides with the scriptarena box I want the map to reset to the state when I entered it for the first time. Change to OnEnter() did not work.


I tried this but it did not work:
void OnStart/(OnEnter)
{
AddEntityCollideCallback("Wall2", "Dead", "Deadd", true, 0);
}

void Deadd(string &in asParent, string &in asChild, int alState)
{
FadeOut(2);
AddTimer("", 3.0f, "ChaMap2");
}

void ChaMap2(string &in asTimer)
{
ChangeMap("10_Crushwall.map", "start", "", "");
}

I would be glad if someone could help me as fast as possible since we need to be done with the Beta soon. The Beta will include an Full conversion mod!

Thank you for all the answers, Alexander.
http://www.moddb.com/mods/the-horrors-of...reenborogh

I'm not sure exactly how the whole hps is written, or what the exact error is (what's wrong), but from looking at what you gave, try this:

void OnStart()
{
AddEntityCollideCallback("Player", "Dead", "Deadd", false, 1);
}

void Deadd(string &in asParent, string &in asChild, int alState)
{
FadeOut(2);
AddTimer("", 3.0f, "ChaMap2");
}

void ChaMap2(string &in asTimer)
{
ChangeMap("10_Crushwall.map", "start", "", "");
}

It did not work Sad Any other ideas? Smile
(This post was last modified: 12-24-2012, 10:02 PM by Projektamensia.)
12-24-2012, 09:58 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: Can anyone help me? :)

What exactly is going wrong?
12-24-2012, 10:02 PM
Find
Projektamensia Offline
Junior Member

Posts: 16
Threads: 3
Joined: Oct 2012
Reputation: 0
#5
RE: Can anyone help me? :)

(12-24-2012, 10:02 PM)Statyk Wrote: What exactly is going wrong?

Okay so the thing is that on the map it is some puzzles that i want to reset. If you do something wrong i want the player to be forced so teleport back to the starting point and be forced to do everything again on the map.

So how do I reset the map so all the puzzles are back to its normal state? Smile
12-24-2012, 10:04 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#6
RE: Can anyone help me? :)

Your best bet is to use local variables to set objects in places for this puzzle. Then when they enter this script area, it checks the local variable amount. If it does not match a specific amount, have the player go back to the spawn and set the local variable back to it's original amount. This will place all objects back in their original place.
12-24-2012, 10:08 PM
Find
Projektamensia Offline
Junior Member

Posts: 16
Threads: 3
Joined: Oct 2012
Reputation: 0
#7
RE: Can anyone help me? :)

(12-24-2012, 10:08 PM)Statyk Wrote: Your best bet is to use local variables to set objects in places for this puzzle. Then when they enter this script area, it checks the local variable amount. If it does not match a specific amount, have the player go back to the spawn and set the local variable back to it's original amount. This will place all objects back in their original place.

So if i set my moving wall to variable, AddLocalVarInt(""Wall", 1);
and my door, AddLocalVarInt(""Wall", 1);.

Then in my,
void OnLeave();
{
if(GetLocalVarInt("Wall") == 2)
{
//Nothing happens...
}
else
{
ChangeMap("10_Crushwall.map", "start", "", "");
}
}

Is this what you mean?
12-24-2012, 10:15 PM
Find
Projektamensia Offline
Junior Member

Posts: 16
Threads: 3
Joined: Oct 2012
Reputation: 0
#8
RE: Can anyone help me? :)

Thank you for all of your advises but I came up with an solution.
Smile
12-25-2012, 12:51 PM
Find




Users browsing this thread: 2 Guest(s)