| 
		
	
		| JesterTone   Junior Member
 
 Posts: 7
 Threads: 3
 Joined: Jun 2012
 Reputation: 
0
 | 
			| Scripting Queries 
 
				Basically, as I suck at the moment with scripting and it's a touch too confusing - even though I've read the script tutorials on the wiki.frictionalgames webpage - so I'll be sticking my confusion all in here to keep it together.
 1 Solved; 1 Unsolved
 
 #2 - Language - Here is the scripting I'm using to rename my key and give it a bit of a description;
 
 <LANGUAGE>
 <CATEGORY Name="CustomStoryMain">
 <Entry Name="Description">
 My description.. basic..
 </Entry>
 </CATEGORY>
 <CATEGORY Name="Inventory">
 <Entry Name="ItemDesc_Key_1">
 A key to be used within the corridor.
 </Entry>
 <Entry Name="ItemName_Key_1">
 Corridor Key
 </Entry>
 </CATEGORY>
 </LANGUAGE>
 
 Again - just let me know the tweaks or whatever I need to do to have my Key_1 be renamed 'Corridor Key' and the description become - 'A key to be used within the corridor'.
 
 Thank you and if I have anymore, I'll be sure to change this first post and bump up.
 
 Thanks all.
 
				
(This post was last modified: 06-24-2012, 03:51 PM by JesterTone.)
 |  |  
	| 06-24-2012, 03:27 PM |  |  
	
		| bored2tears   Member
 
 Posts: 56
 Threads: 6
 Joined: Jun 2012
 Reputation: 
3
 | 
			| RE: Scripting Queries 
 
				 (06-24-2012, 03:36 PM)bored2tears Wrote:   (06-24-2012, 03:27 PM)JesterTone Wrote:  Basically, as I suck at the moment with scripting and it's a touch too confusing - even though I've read the script tutorials on the wiki.frictionalgames webpage - so I'll be sticking my confusion all in here to keep it together.Use this instead:
 First up; locked doors and keys. I have my key and door and such set up. Now heres the script I have -
 
 void OnStart()
 {
 AddUseItemCallback("", "Key_1", "corridor_door1", "open_CD1", true);
 }
 
 void open_CD1(string &in asItem, string &in asEntity)
 {
 SetSwingDoorLocked(asEntity, false, true);
 PlaySoundAtEntity("", "unlock_door", "corridor_door1", 0, false);
 RemoveItem(asItem);
 }
 
 void OnEnter()
 {
 }
 
 void OnLeave()
 {
 }
 
 Now is there something I need to change or delete or add?
 
 A second much smaller question - I have a painting I want to make moveable. Is there a specific painting I need to use?
 
 Thank you and if I have anymore, I'll be sure to change this first post and bump up.
 
 Thanks all.
 
 void open_CD1(string &in asItem, string &in asEntity)
 {
 SetSwingDoorLocked("corridor_door1", false, true);
 PlaySoundAtEntity("", "unlock_door", "corridor_door1", 0, false);
 RemoveItem("Key_1");
 }
 
 
 
 You need to set asEntity and asItem as the names of the entity/item, I believe.
 
				
(This post was last modified: 06-24-2012, 03:37 PM by bored2tears.)
 |  |  
	| 06-24-2012, 03:36 PM |  |  
	
		| JesterTone   Junior Member
 
 Posts: 7
 Threads: 3
 Joined: Jun 2012
 Reputation: 
0
 | 
			| RE: Scripting Queries 
 
				Thanks very much, solved my problem.
 I've put a new query up.
 |  |  
	| 06-24-2012, 03:51 PM |  |  
	
		| bored2tears   Member
 
 Posts: 56
 Threads: 6
 Joined: Jun 2012
 Reputation: 
3
 | 
			| RE: Scripting Queries 
 
				 (06-24-2012, 03:27 PM)JesterTone Wrote:  #2 - Language - Here is the scripting I'm using to rename my key and give it a bit of a description;
 <LANGUAGE>
 <CATEGORY Name="CustomStoryMain">
 <Entry Name="Description">
 My description.. basic..
 </Entry>
 </CATEGORY>
 <CATEGORY Name="Inventory">
 <Entry Name="ItemDesc_Key_1">
 A key to be used within the corridor.
 </Entry>
 <Entry Name="ItemName_Key_1">
 Corridor Key
 </Entry>
 </CATEGORY>
 </LANGUAGE>
 Hmm, odd. I cannot see anything wrong with it. Try this:
 <LANGUAGE><CATEGORY Name="Inventory">
 <Entry Name="ItemDesc_Key_1">A key to be used within the corridor.</Entry>
 <Entry Name="ItemName_Key_1">Corridor Key</Entry>
 </CATEGORY>
 
 <CATEGORY Name="CustomStoryMain">
 <Entry Name="Description">Basic Description! Yippee!</Entry>
 </CATEGORY>
 
 </LANGUAGE>
Everything seems fine, so try it set up like that. That's how mine is set up, and it works, so maybe yours will too?
			 |  |  
	| 06-24-2012, 04:24 PM |  |  
	
		| JesterTone   Junior Member
 
 Posts: 7
 Threads: 3
 Joined: Jun 2012
 Reputation: 
0
 | 
			| RE: Scripting Queries 
 
				Yeah, I thought I had done it right.The description of the game is fine and works - but I tried it your way and it still didn't work. Still comes up "Rusty Key" and it's usual description.
 |  |  
	| 06-24-2012, 04:39 PM |  |  
	
		| bored2tears   Member
 
 Posts: 56
 Threads: 6
 Joined: Jun 2012
 Reputation: 
3
 | 
			| RE: Scripting Queries 
 
				 (06-24-2012, 04:39 PM)JesterTone Wrote:  Yeah, I thought I had done it right.The description of the game is fine and works - but I tried it your way and it still didn't work. Still comes up "Rusty Key" and it's usual description.
 Did you set the name and the CustomSubItemTypeEntity name? (I keep them both the same name)
			 |  |  
	| 06-24-2012, 04:41 PM |  |  
	
		| JesterTone   Junior Member
 
 Posts: 7
 Threads: 3
 Joined: Jun 2012
 Reputation: 
0
 | 
			| RE: Scripting Queries 
 
				I'd like to say firstly; I'm an idiot.Heh.
 I read that so many times and just never did it I guess. Thats another problem solved.
 
 Quick question; I want to hide my key behind a painting - is there a specific painting I can use that is moveable or is it another scripting job?
 
 Thanks very much to you both!
 |  |  
	| 06-24-2012, 05:00 PM |  |  
	
		| bored2tears   Member
 
 Posts: 56
 Threads: 6
 Joined: Jun 2012
 Reputation: 
3
 | 
			| RE: Scripting Queries 
 
				 (06-24-2012, 05:00 PM)JesterTone Wrote:  I'd like to say firstly; I'm an idiot.Heh.
 I read that so many times and just never did it I guess. Thats another problem solved.
 
 Quick question; I want to hide my key behind a painting - is there a specific painting I can use that is moveable or is it another scripting job?
 
 Thanks very much to you both!
 I am not sure about that. I know some of the static object walls have cubbies in them. I'm sure that there is a painting that can be moved or set through the options when you click on it.
			 |  |  
	| 06-24-2012, 05:14 PM |  |  
	
		| Cruzore   Senior Member
 
 Posts: 301
 Threads: 2
 Joined: Jun 2012
 Reputation: 
37
 | 
			| RE: Scripting Queries 
 
				Make sure the painting you choose in the level editor has something with dyn or dynamic in it. To make it not fall off, place it slightly inside the wall. Just test it out.
			 |  |  
	| 06-24-2012, 06:24 PM |  |  |