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
Need help with custom story
japanesewhisky Offline
Junior Member

Posts: 12
Threads: 3
Joined: Apr 2018
Reputation: 0
#1
Need help with custom story

Im making a custom story and on the 3rd map I made, it will not let me transition to the 4th map.

this is my code:

void OnStart()
{  
AddUseItemCallback("Opendoor", "hehexd", "door69", "UnlockLevelDoor", true);
}


void UnlockLevelDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked ("door69", false);
ChangeMap("Level4","PlayerStartArea_1","","");
}

anyone halp?
01-12-2019, 02:33 PM
Find Reply
Mudbill Offline
Muderator

Posts: 3,807
Threads: 59
Joined: Apr 2013
Reputation: 177
#2
RE: Need help with custom story

What do you mean?

Why are you calling ChangeMap? It looks like the function is supposed to unlock a door, but it also immediately changes the map.

If you can explain in more detail what you're trying to do, what you expect to happen, and what is actually happening, that would help us.

01-13-2019, 03:36 AM
Find Reply
japanesewhisky Offline
Junior Member

Posts: 12
Threads: 3
Joined: Apr 2018
Reputation: 0
#3
RE: Need help with custom story

(01-13-2019, 03:36 AM)Mudbill Wrote: What do you mean?

Why are you calling ChangeMap? It looks like the function is supposed to unlock a door, but it also immediately changes the map.

If you can explain in more detail what you're trying to do, what you expect to happen, and what is actually happening, that would help us.

This is what I wanted.

Initially I wanted to create a short map that just had 1 door that led to my 4th map. But it didn't lead to anything and the error message was that it couldn't load the world and then the file location, but it didn't say my lvl name, it just said could not load world file ..../.map. I am calling ChangeMap but i thought that a lvl door somehow needs a key to work so I wrote this too. But I want an unlocked door that leads to my 4th map. Though when I open it it displays the generic message (as previously mentioned) when a lvl door isn't linked to a particular level. Better?
(This post was last modified: 01-13-2019, 11:51 AM by japanesewhisky.)
01-13-2019, 11:49 AM
Find Reply
japanesewhisky Offline
Junior Member

Posts: 12
Threads: 3
Joined: Apr 2018
Reputation: 0
#4
RE: Need help with custom story

(01-13-2019, 03:36 AM)Mudbill Wrote: What do you mean?

Why are you calling ChangeMap? It looks like the function is supposed to unlock a door, but it also immediately changes the map.

If you can explain in more detail what you're trying to do, what you expect to happen, and what is actually happening, that would help us.

void UnlockLevelDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked ("door69", false);
ChangeMap("Level4","PlayerStartArea_1","","");
}

basically this is the only part that I want. The one part that tells the one door to lead me to another level. Do I need to add more, or is it a syntax error?
01-13-2019, 11:53 AM
Find Reply
Mudbill Offline
Muderator

Posts: 3,807
Threads: 59
Joined: Apr 2013
Reputation: 177
#5
RE: Need help with custom story

But why do you use script for this? Is it not enough to add the next level in the "Level" box for the door in the editor?

You might need to add the .map extension to your ChangeMap function if you want that to work.

(This post was last modified: 01-13-2019, 04:20 PM by Mudbill.)
01-13-2019, 04:20 PM
Find Reply
japanesewhisky Offline
Junior Member

Posts: 12
Threads: 3
Joined: Apr 2018
Reputation: 0
#6
RE: Need help with custom story

(01-13-2019, 04:20 PM)Mudbill Wrote: But why do you use script for this? Is it not enough to add the next level in the "Level" box for the door in the editor?

You might need to add the .map extension to your ChangeMap function if you want that to work.

Dude please don't ask me. The only type of coding I do is front end web dev. I'm a complete rookie when it comes to this. Thanks for the advice I will let you know whether it works.
01-13-2019, 04:32 PM
Find Reply
japanesewhisky Offline
Junior Member

Posts: 12
Threads: 3
Joined: Apr 2018
Reputation: 0
#7
RE: Need help with custom story

(01-13-2019, 04:20 PM)Mudbill Wrote: But why do you use script for this? Is it not enough to add the next level in the "Level" box for the door in the editor?

You might need to add the .map extension to your ChangeMap function if you want that to work.

Well I just realized the mistake and fixed it. Thanks!
01-13-2019, 04:38 PM
Find Reply
Mudbill Offline
Muderator

Posts: 3,807
Threads: 59
Joined: Apr 2013
Reputation: 177
#8
RE: Need help with custom story

Apologies if I sounded condecending. Would you like to share the solution?

01-14-2019, 06:01 PM
Find Reply
japanesewhisky Offline
Junior Member

Posts: 12
Threads: 3
Joined: Apr 2018
Reputation: 0
#9
RE: Need help with custom story

(01-14-2019, 06:01 PM)Mudbill Wrote: Apologies if I sounded condecending. Would you like to share the solution?
There were 2 in fact.
1. Hence I didn't know that when you press ''save game'' and then go to update the level in lvl editor, it doesn't change when you load your saved game so thats why it wast working the script was correct im just retarded. I didnt want to replay the whole thing again, even though its super short its just a  really bad screw around custom ''story''.
2. I realized that you can make doors go to other levels in the level editor itself, I thought you had to script for it. Which I did for the 1st 3 lvls, but because I didnt know that you could just do it in the level editor. 
Overall, I'm releasing the map next week on the forums just as a joke. I started like several years ago but never bothered to continue. Now I started getting into coding and do this just as an experiment. And I'm also a loyal fan of the game and Frictional Games :3.
01-15-2019, 09:39 PM
Find Reply




Users browsing this thread: 1 Guest(s)