| 
		
	
		| rean2   Junior Member
 
 Posts: 6
 Threads: 1
 Joined: Nov 2013
 Reputation: 
1
 | 
			|  Entity + Texture Question and Script problem 
 
				Hi! 
Amnesia is an awesome game and as a fan of horror, it has inspired me to create some new custom stories. While working on 'Lights and Sounds' (working title), I have a few questions:
 
Some custom stories have custom entities, however they are not in the main game's entity folder, but in the custom story folder. I have placed my custom models in the main game because they show up in the editor. How do I place my entity models in the custom story folder and still place them in the level editor?
 
I also had a similar problem with textures. I think the textures disappeared if they weren't in the main game's textures folder.
 
I also have a problem with the script. I have a an object that can be created using the combine callback (which is in inventory.hps):
 /////////////////////////////////////SECOND FLOOR - COMBINE COPPER TUBE AND NEEDLE
 void createBloodKey(string &in asItemA, string &in asItemB)
 {
 PlayGuiSound("15_make_hammer", 0.7f);
 
 RemoveItem("hollow_needle"); RemoveItem("copper_tube");
 
 GiveItem("", "copper_tube_and_needle", "copper_tube_and_needle", "copper_tube_and_needle.tga", 1);
 
 SetMessage("Message", "createdbloodkey", 4);
 }
 
 //END SECOND FLOOR - COMBINE COPPER TUBE AND NEEDLE
 ///////////////////////////////////
 
 
 
 
 ////////////////////////////
 // Run at the start of the game.
 void OnGameStart()
 {
 //SECOND FLOOR//
 AddCombineCallback("", "hollow_needle", "copper_tube", "createBloodKey", true);
 }
but when i tried to use the created copper_tube_and_needle on a door to unlock
 void OnStart(){
 AddUseItemCallback("usebloodkeyondoor", "copper_tube_and_needle", "room207door", "bloodkeyondoor", true);
 }
 
 void bloodkeyondoor(string &in asItem, string &in asEntity)
 {
 SetMessage("Message", "debug0", 4);
 SetSwingDoorLocked("room207door", false, true);
 PlaySoundAtEntity("", "unlock_door", "room207door", 0, false);
 RemoveItem("copper_tube_and_needle");
 }
It doesn't work, I even set a debug message to show if that function was called but it doesnt show up! 
 
Thanks for the help!
			 |  |  
	| 11-26-2013, 07:19 PM |  |  
	
		| The chaser   Posting Freak
 
 Posts: 2,486
 Threads: 76
 Joined: Jun 2012
 Reputation: 
113
 | 
			| RE: Entity + Texture Question and Script problem 
 
				Don't put anything in your CS folder yet. Put all your custom resources in your Amnesia. When the story is done, put every custom thing in a folder in your mod. 
No idea about the latest thing, sorry   
                               THE OTHERWORLD (WIP) ![[Image: k6vbdhu]](http://tinyurl.com/k6vbdhu)  
Aculy iz dolan. |  |  
	| 11-26-2013, 08:51 PM |  |  
	
		| Daemian   Posting Freak
 
 Posts: 1,129
 Threads: 42
 Joined: Dec 2012
 Reputation: 
49
 | 
			| RE: Entity + Texture Question and Script problem 
 
				For the item problem, if you want to get a message when you try the key on the door, you should put the debug message in your function bloodkeyondoor.
 Have in mind, also, that the SetMessage function may fail if your language file has an error.
 
 About the custom entities and alike, doing as TheChaser said should work fine.
 However, if you still want to have the files in your custom story's folder now, you gotta include that directory in your resources.cfg in order to let the editor find them.
 
 |  |  
	| 11-27-2013, 02:25 AM |  |  
	
		| rean2   Junior Member
 
 Posts: 6
 Threads: 1
 Joined: Nov 2013
 Reputation: 
1
 | 
			| RE: Entity + Texture Question and Script problem 
 
				 (11-26-2013, 08:51 PM)The chaser Wrote:  Don't put anything in your CS folder yet. Put all your custom resources in your Amnesia. When the story is done, put every custom thing in a folder in your mod.
 
 No idea about the latest thing, sorry :(
 
Oh, ok. I was just worried that I would have to rearrange everything when i was done so i can have a proper install package.
  (11-27-2013, 02:25 AM)Amn Wrote:  For the item problem, if you want to get a message when you try the key on the door, you should put the debug message in your function bloodkeyondoor.
 Have in mind, also, that the SetMessage function may fail if your language file has an error.
 
 About the custom entities and alike, doing as TheChaser said should work fine.
 However, if you still want to have the files in your custom story's folder now, you gotta include that directory in your resources.cfg in order to let the editor find them.
 Ahh, ok, didn't know about resource.cfg
 
I do have the message in funct bloodkeyondoor, but no message comes up. It just says "cannot use item this way". Its like the useitemcallback doesnt exist. However when i switched 'copper_tube_and_needle' with 'hollow_needle' it worked fine.
			 |  |  
	| 11-27-2013, 04:01 AM |  |  
	
		| rean2   Junior Member
 
 Posts: 6
 Threads: 1
 Joined: Nov 2013
 Reputation: 
1
 | 
			| RE: Entity + Texture Question and Script problem 
 
				Well I found my problem, In Inventory.hps,  GiveItem("", "copper_tube_and_needle", "copper_tube_and_needle", "copper_tube_and_needle.tga", 1);
should be
 GiveItem("copper_tube_and_needle", "Puzzle", "copper_tube_and_needle", "copper_tube_and_needle.tga", 1);
My callback function didn't work because there was no item called "copper_tube_and_needle" because i didn't give it a asName  value
			
				
(This post was last modified: 12-05-2013, 06:19 PM by rean2.)
 |  |  
	| 12-05-2013, 06:19 PM |  |  |