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
FlawlessHappiness Offline
Posting Freak

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

(07-15-2012, 06:40 PM)zergling50 Wrote:
(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?


Nonono... I know this. because you actually have 2 custom story folders! Try looking up what i gave you Wink

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

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

I thought I had finally solved the problem, as I realized I had named my .hps file the name of my custom story, not the name of the map. However after I renamed it it still wouldnt do anything. *Sigh* Still need help. If anyone can help me through this mess I would greatly appreciate it, I really want to make my custom story work. Thanks in advance!

(07-15-2012, 08:01 PM)beecake Wrote:
(07-15-2012, 06:40 PM)zergling50 Wrote:
(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?


Nonono... I know this. because you actually have 2 custom story folders! Try looking up what i gave you Wink
I did. I went to the exact path, and im back in the same folder that I just described to you.
(This post was last modified: 07-15-2012, 08:56 PM by zergling50.)
07-15-2012, 08:55 PM
Find
FlawlessHappiness Offline
Posting Freak

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

Oh well... Hmm

Trying is the first step to success.
(This post was last modified: 07-15-2012, 09:08 PM by FlawlessHappiness.)
07-15-2012, 09:07 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#24
RE: Custom Story Script Problems

(07-15-2012, 01:49 AM)Your Computer Wrote:
(07-15-2012, 01:01 AM)zergling50 Wrote: which paramater variable names do I have messed up?

SetSwingDoorLocked(entity, false);
PlaySoundAtEntity("", "unlock_door", entity, 0, false);
RemoveItem(item);

You should have received the AngelScript output telling you this.

BTW, i meant that the bold words were wrong, not right (see context).

Tutorials: From Noob to Pro
(This post was last modified: 07-15-2012, 09:10 PM by Your Computer.)
07-15-2012, 09:10 PM
Website Find
zergling50 Offline
Member

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

(07-15-2012, 09:10 PM)Your Computer Wrote:
(07-15-2012, 01:49 AM)Your Computer Wrote:
(07-15-2012, 01:01 AM)zergling50 Wrote: which paramater variable names do I have messed up?

SetSwingDoorLocked(entity, false);
PlaySoundAtEntity("", "unlock_door", entity, 0, false);
RemoveItem(item);

You should have received the AngelScript output telling you this.

BTW, i meant that the bold words were wrong, not right (see context).


My code right now is this:
////////////////////////////
// Run when starting map
void OnStart()
{
AddUseItemCallback("", "key_1", "castle_1", "KeyOnDoor", true);
SetEntityPlayerInteractCallback("key_1", "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", "KeyOnDoor", 0, false);
RemoveItem("key_1");
}
What should those values be changed to?
07-15-2012, 09:15 PM
Find
FlawlessHappiness Offline
Posting Freak

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

Actually this one:
PlaySoundAtEntity("", "unlock_door", "KeyOnDoor", 0, false);


You cannot call a function in this place. That is where you specify where the sound should be played.

In this case i guess it would be "castle_1"

PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);

But this would not solve the problem...

What if the script isn't done, if it is below OnLeave?

Then it should be:

////////////////////////////
// Run when starting map
void OnStart()
{
AddUseItemCallback("", "key_1", "castle_1", "KeyOnDoor", true);
SetEntityPlayerInteractCallback("key_1", "ActivateMonster", true);
}

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", "KeyOnDoor", 0, false);
RemoveItem("key_1");
}

////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Trying is the first step to success.
(This post was last modified: 07-15-2012, 09:20 PM by FlawlessHappiness.)
07-15-2012, 09:18 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#27
RE: Custom Story Script Problems

(07-15-2012, 09:15 PM)zergling50 Wrote: What should those values be changed to?

PHP Code: (Select All)
void KeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked(asEntityfalsetrue);
PlaySoundAtEntity("""unlock_door"asEntity0false);
RemoveItem(asItem);


Notice how the variable names reflect the parameters exactly.

Also, if your MAP is named 01.map, then the HPS should be named 01.hps. If nothing from the script works after making these changes, then check if C:\Users\<username>\AppData\Local\VirtualStore contains any of your custom story files. If so, then you're bound to have consistency issues with your custom story.

Tutorials: From Noob to Pro
07-15-2012, 09:23 PM
Website Find
zergling50 Offline
Member

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

(07-15-2012, 09:23 PM)Your Computer Wrote:
(07-15-2012, 09:15 PM)zergling50 Wrote: What should those values be changed to?

PHP Code: (Select All)
void KeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked(asEntityfalsetrue);
PlaySoundAtEntity("""unlock_door"asEntity0false);
RemoveItem(asItem);


Notice how the variable names reflect the parameters exactly.

Also, if your MAP is named 01.map, then the HPS should be named 01.hps. If nothing from the script works after making these changes, then check if C:\Users\<username>\AppData\Local\VirtualStore contains any of your custom story files. If so, then you're bound to have consistency issues with your custom story.

I made the changes you showed and then went to check out VirtualStore. This is what I found.
-VirtualStore
--Program Files
---ASCII (figured this had nothing to do with Amnesia)
--Program Files (x86)
---Bethesda Softworks
---E.M. Free Game Capture
---EA GAMES
---iWisoft Flash SWF to Video Converter
--Windows
---(Bunch (4 to be exact) of configuration settings files that I doubt have anything to do with my custom story along with an empty folder with a name that is a bunch of letters and numbers)

Seeing nothing that seemed to have anything to do with my custom story I tried it out and it still wouldnt work sadly... Im sorry for all the trouble.
Heres my current code:
////////////////////////////
// Run when starting map
void OnStart()
{
AddUseItemCallback("", "key_1", "castle_1", "KeyOnDoor", true);
SetEntityPlayerInteractCallback("key_1", "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("asEntity", false, true);
PlaySoundAtEntity("", "unlock_door", "asEntity", 0, false);
RemoveItem("asItem");
}
07-15-2012, 10:02 PM
Find
FlawlessHappiness Offline
Posting Freak

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

SetSwingDoorLocked("asEntity", false, true);
PlaySoundAtEntity("", "unlock_door", "asEntity", 0, false);
RemoveItem("asItem");


you have to specify and object in your world editor. Because i don't think you have objects in your editor called asEntity and asItem.
This will still not solve the problem

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

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

(07-15-2012, 10:09 PM)beecake Wrote: SetSwingDoorLocked("asEntity", false, true);
PlaySoundAtEntity("", "unlock_door", "asEntity", 0, false);
RemoveItem("asItem");


you have to specify and object in your world editor. Because i don't think you have objects in your editor called asEntity and asItem.
This will still not solve the problem

Sorry, Im getting confused now. I had them labeled as items in the game but then that guy said to switch them to that so I did and now I need to switch them back. But it didnt work either way before so im still stuck. Im sorry, I wish my question wasnt causing so much trouble but I cant make custom stories until I figure this out.
07-15-2012, 10:13 PM
Find




Users browsing this thread: 1 Guest(s)