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
Custom Story Script Problems
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#11
RE: Custom Story Script Problems

(07-15-2012, 04:01 PM)beecake Wrote: PlaySoundAtEntity("", "unlock_door", entity, 0, false);
SetSwingDoorLocked(entity, false, true);


I dont think you can write 'entity' in there, without having an object in your map called: entity.

If you have an object called: entity, then you have to put these "" around the word.

SetSwingDoorLocked("entity", false, true);
PlaySoundAtEntity("", "unlock_door", "entity", 0, false);


In this case: [ SetSwingDoorLocked("entity", false, true); ] you are using a door. If you haven't changed your door name then it would be something like "mansion_1" or "castle_1".

Something like that, instead of entity
The guy I saw in the tutorial said that it was more efficient to do this because then you can reuse the code and not have to make a new code for each door and key you make. Ill try though and tell you in a second if it works.

(07-15-2012, 04:43 PM)zergling50 Wrote:
(07-15-2012, 04:01 PM)beecake Wrote: PlaySoundAtEntity("", "unlock_door", entity, 0, false);
SetSwingDoorLocked(entity, false, true);


I dont think you can write 'entity' in there, without having an object in your map called: entity.

If you have an object called: entity, then you have to put these "" around the word.

SetSwingDoorLocked("entity", false, true);
PlaySoundAtEntity("", "unlock_door", "entity", 0, false);


In this case: [ SetSwingDoorLocked("entity", false, true); ] you are using a door. If you haven't changed your door name then it would be something like "mansion_1" or "castle_1".

Something like that, instead of entity
The guy I saw in the tutorial said that it was more efficient to do this because then you can reuse the code and not have to make a new code for each door and key you make. Ill try though and tell you in a second if it works.


It still did not work, although I had a feeling this would be so as I did not change it to the entity and item thing until after it wasnt working originally. Anyone else? I have no idea whats going on and it is quite confusing, I just want to be able to make games. Any support or help is greatly appreceated! Thanks!
CURRENT CODE:
////////////////////////////
// Run when starting map
void OnStart()
{
AddUseItemCallback("OpenDoor", "key", "castle_1", "KeyOnDoor", true);
SetEntityPlayerInteractCallback("key", "ActivateMonster", true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}
void ActivateMonster(string &in asItem)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "Idle");
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("key");
}
(This post was last modified: 07-15-2012, 04:46 PM by zergling50.)
07-15-2012, 04:43 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#12
RE: Custom Story Script Problems

Show me a picture of the door you want to script unlocked, with the door settings too

Trying is the first step to success.
07-15-2012, 04:55 PM
Find
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#13
RE: Custom Story Script Problems

(07-15-2012, 04:43 PM)zergling50 Wrote:
(07-15-2012, 04:01 PM)beecake Wrote: PlaySoundAtEntity("", "unlock_door", entity, 0, false);
SetSwingDoorLocked(entity, false, true);


I dont think you can write 'entity' in there, without having an object in your map called: entity.

If you have an object called: entity, then you have to put these "" around the word.

SetSwingDoorLocked("entity", false, true);
PlaySoundAtEntity("", "unlock_door", "entity", 0, false);


In this case: [ SetSwingDoorLocked("entity", false, true); ] you are using a door. If you haven't changed your door name then it would be something like "mansion_1" or "castle_1".

Something like that, instead of entity
The guy I saw in the tutorial said that it was more efficient to do this because then you can reuse the code and not have to make a new code for each door and key you make. Ill try though and tell you in a second if it works.

(07-15-2012, 04:43 PM)zergling50 Wrote:
(07-15-2012, 04:01 PM)beecake Wrote: PlaySoundAtEntity("", "unlock_door", entity, 0, false);
SetSwingDoorLocked(entity, false, true);


I dont think you can write 'entity' in there, without having an object in your map called: entity.

If you have an object called: entity, then you have to put these "" around the word.

SetSwingDoorLocked("entity", false, true);
PlaySoundAtEntity("", "unlock_door", "entity", 0, false);


In this case: [ SetSwingDoorLocked("entity", false, true); ] you are using a door. If you haven't changed your door name then it would be something like "mansion_1" or "castle_1".

Something like that, instead of entity
The guy I saw in the tutorial said that it was more efficient to do this because then you can reuse the code and not have to make a new code for each door and key you make. Ill try though and tell you in a second if it works.


It still did not work, although I had a feeling this would be so as I did not change it to the entity and item thing until after it wasnt working originally. Anyone else? I have no idea whats going on and it is quite confusing, I just want to be able to make games. Any support or help is greatly appreceated! Thanks!
CURRENT CODE:
////////////////////////////
// Run when starting map
void OnStart()
{
AddUseItemCallback("OpenDoor", "key", "castle_1", "KeyOnDoor", true);
SetEntityPlayerInteractCallback("key", "ActivateMonster", true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}
void ActivateMonster(string &in asItem)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "Idle");
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("key");
}
I just double checked my code with someone else's code in their custom story that I have played and know works and it is pretty much the exact same. Is there a possibility that it is something wrong with something I did in the editor and not the coding? But then again, I dont know if that would make sense as even the grunt code will not work. I am completely clueless, its as if my computer refuses to read the file and is ignoring it. I get absolutely no errors but nothing happens. Did I miss a download or do I need something else? I am completely clueless. Please help!
EDIT: I can provide screenshots of leveleditor if needed
(This post was last modified: 07-15-2012, 05:00 PM by zergling50.)
07-15-2012, 04:58 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#14
RE: Custom Story Script Problems

I don't know if it will work, but have you tried deleting your map.cache?
A lot of people do so, and then something works... I don't know if this is the right, but there must be something wrong since it ain't working

Trying is the first step to success.
07-15-2012, 05:01 PM
Find
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#15
RE: Custom Story Script Problems

(07-15-2012, 04:55 PM)beecake Wrote: Show me a picture of the door you want to script unlocked, with the door settings too
The maximum size for a file it will let me upload is 500 kilobytes -_-
so sorry, I couldnt show you a picture unless you know of another way.

(07-15-2012, 05:01 PM)beecake Wrote: I don't know if it will work, but have you tried deleting your map.cache?
A lot of people do so, and then something works... I don't know if this is the right, but there must be something wrong since it ain't working

wheres the map cache?
(This post was last modified: 07-15-2012, 05:39 PM by zergling50.)
07-15-2012, 05:38 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#16
RE: Custom Story Script Problems

My map.cache is in:
C:\Users\[USERNAME]\AppData\Local\VirtualStore\Program Files (x86)\Amnesia - The Dark Descent
\redist\custom_stories\[CUSTOMSTORY]\maps\

i don't know about the Steam version.

What i do when i post pictures is:
Go to the level editor where you want to post the picture>Press "PrtSc SysRq">Go to paint>Ctrl+v>
Crop the most important>Save>There you go Wink

Trying is the first step to success.
(This post was last modified: 07-15-2012, 06:27 PM by FlawlessHappiness.)
07-15-2012, 06:26 PM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#17
RE: Custom Story Script Problems

Or upload it to an imagehoster like http://www.imgur.com

[Image: 18694.png]
07-15-2012, 06:36 PM
Find
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#18
RE: Custom Story Script Problems

(07-15-2012, 06:26 PM)beecake Wrote: My map.cache is in:
C:\Users\[USERNAME]\AppData\Local\VirtualStore\Program Files (x86)\Amnesia - The Dark Descent
\redist\custom_stories\[CUSTOMSTORY]\maps\

i don't know about the Steam version.

What i do when i post pictures is:
Go to the level editor where you want to post the picture>Press "PrtSc SysRq">Go to paint>Ctrl+v>
Crop the most important>Save>There you go Wink
If you are saying that it is in my custom story folder than I can assure you I see no such thing. This is all I have in my folder:
Test
-maps
--01.map
--Test.hps
-custom_story_settings.cfg
-extra_english.lang
-story.png
That is all of the files I have.
also with the picture, that is exactly what I did but it said t was still too big. 500 kilobytes is insanely small, my picture alone was 1.02 mb. Sorry for the inconveniences! but i appreciate the help!
So what do I do now, and am I missing something here with the map_cache?
07-15-2012, 06:40 PM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#19
RE: Custom Story Script Problems

No, the map_cache saves some parts of your level in order to shorten the loading times. Sometimes static objects get messed up because of the cache. If this is the case, just delete the cache. If you don't have a cache this problem can't occur Wink

[Image: 18694.png]
07-15-2012, 06:44 PM
Find
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#20
RE: Custom Story Script Problems

(07-15-2012, 06:36 PM)Ongka Wrote: Or upload it to an imagehoster like http://www.imgur.com
I tried uploading it to imgur (I have an account) and it also constantly says it failed to upload (reason it gave was because the file was over their 2mb limit) but my file is 1.02 mb. So I guess it just doesnt like my files.

(07-15-2012, 06:44 PM)Ongka Wrote: No, the map_cache saves some parts of your level in order to shorten the loading times. Sometimes static objects get messed up because of the cache. If this is the case, just delete the cache. If you don't have a cache this problem can't occur Wink
Then why is it practically ignoring my code? Its the exact same as everone elses that I cheked, but my computer doesnt seem to even execute it.
(This post was last modified: 07-15-2012, 06:48 PM by zergling50.)
07-15-2012, 06:47 PM
Find




Users browsing this thread: 3 Guest(s)