FlawlessHappiness 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 3,980 
	Threads: 145 
	Joined: Mar 2012
	
 Reputation: 
171
		
	 | 
	
		
			
RE: Use item in other levels 
			 
			
				I tried what you did, with no luck... Now there is only the use script in the level where it is used 
I looked in the engine scripts and in the: Quote:GiveItem("", "glass_container_mix_done", "fiskeolie", "glass_container_mix_done.tga", 1);  
I made the subItemType "fiskeolie" and that was what i used in the scripts... guess that was wrong... i tried with "glass_container_mix_done" and made it look like this: Quote:void OnStart ();  
{ 
AddUseItemCallback("", "glass_container_mix_done", "gryde1", "UseItemOnArea", true); 
} 
 
void UseItemOnArea(string &in asItem, string &in asEntity) 
{ 
SetEntityActive("Fiskeolie_static_1", true); 
SetSwingDoorLocked("mansion_5", true, true); 
StartPlayerLookAt("mansion_8", 10, 10, ""); 
AddTimer("", 0.3, "LookAtDoor_1"); 
RemoveItem("glass_container_mix_done "); 
} 
Still it doesnt work... 
			 
			
			
 
Trying is the first step to success. 
			
		 |  
	 
 | 
 
	| 04-24-2012, 06:51 PM  | 
	
		
	 | 
 
 
	
		
		Cranky Old Man 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 986 
	Threads: 20 
	Joined: Apr 2012
	
 Reputation: 
38
		
	 | 
	
		
			
RE: Use item in other levels 
			 
			
				 (04-24-2012, 06:51 PM)beecake Wrote:  Quote:void OnStart*1()*2 
{ 
AddUseItemCallback("", "glass_container_mix_done", "gryde1", "UseItemOnArea", true); 
} 
 
void UseItemOnArea(string &in asItem, string &in asEntity) 
{ 
SetEntityActive("Fiskeolie_static_1", true); 
SetSwingDoorLocked("mansion_5", true, true); 
StartPlayerLookAt("mansion_8", 10, 10, ""); 
AddTimer("", 0.3*3, "LookAtDoor_1"); 
RemoveItem("glass_container_mix_done*4"); 
} 
Still it doesnt work...  *1 = Remove space. 
*2 = Remove the semi-colon here! 
*3 = Add f when dealing with floating numbers. 
*4 = Remove space.
			  
			
			
 
			
		 |  
	 
 | 
 
	| 04-24-2012, 07:08 PM  | 
	
		
	 | 
 
 
	
		
		FlawlessHappiness 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 3,980 
	Threads: 145 
	Joined: Mar 2012
	
 Reputation: 
171
		
	 | 
	
		
			
RE: Use item in other levels 
			 
			
				Sorry 1, 2 and 4 was just fails i did when i wrote it here... I changed the 3... it still says: "Cannot use item this way"...
			 
			
			
 
Trying is the first step to success. 
			
		 |  
	 
 | 
 
	| 04-24-2012, 07:37 PM  | 
	
		
	 | 
 
 
	
		
		Cranky Old Man 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 986 
	Threads: 20 
	Joined: Apr 2012
	
 Reputation: 
38
		
	 | 
	
		
			
RE: Use item in other levels 
			 
			
				 (04-24-2012, 07:37 PM)beecake Wrote:  Sorry 1, 2 and 4 was just fails i did when i wrote it here... I changed the 3... it still says: "Cannot use item this way"... You WROTE it here?? Have you heard of Ctrl-C and Ctrl-V?
 
Edit: I can't figure out what's wrong. If it says that you can't use the item that way, then that means that the parameters in the callback is wrong. Grammatically they check out, so I'm thinking it has to be that you haven't named the entities "glass_container_mix_done" or "gryde1".
 
Edit 2: Are you sure that the callback works for interacting with an AREA? It's mainly designed for entities.
			  
			
			
 
			
				
(This post was last modified: 04-24-2012, 08:19 PM by Cranky Old Man.)
 
				
			 
		 |  
	 
 | 
 
	| 04-24-2012, 08:12 PM  | 
	
		
	 | 
 
 
	
		
		FlawlessHappiness 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 3,980 
	Threads: 145 
	Joined: Mar 2012
	
 Reputation: 
171
		
	 | 
	
		
			
RE: Use item in other levels 
			 
			
				No no i didn't write it all... Just the top thingy, void OnStart() 
Anyway i solved in another way. By making a pickup-able item appear when you use the item on an entity, instead of making the script give the item to the player... then i could add an item name, and subtype name myself   
EDIT: Okay i got what i did wrong. 
My script was: 
GiveItem("", "glass_container_mix_done", "fiskeolie", "glass_container_mix_done.tga", 1); 
But hey i missed a spot! 
GiveItem("[MISSING SPOT]", "glass_container_mix_done", "fiskeolie", "glass_container_mix_done.tga", 1);
 
I should have put the internal name in there... then the function would work!   
			 
			
			
 
Trying is the first step to success. 
			
		 |  
	 
 | 
 
	| 04-24-2012, 08:18 PM  | 
	
		
	 | 
 
 
	 
 |