cook Posted March 10, 2010 Author Share Posted March 10, 2010 I am using Eclipse Stable and all I want is to be able to have an item creation aspect to my game, however every single script tutorial out there does not seem to be for Stable. And even if there was one out there made with Stable in mind it doesnt give good enough instructions on how and where to put all the code as well as testing it out. Could somebody please give me some detailed instructions on how to incorporate this into my game or maybe even a preconfigured main.txt for me to use? Link to comment Share on other sites More sharing options...
Godlord Posted March 10, 2010 Share Posted March 10, 2010 ```Case U If CountPlayerInvItem(Index, X, 1) And CountPlayerInvItem(Index, Y, 1) Then Call RemovePlayerInvItem(Index, X, 1) Call RemovePlayerInvItem(Index, Y, 1) Call AddPlayerInvItem(Index, Z, -1) End If```Add that code to ScriptedItems.ess, somewhere in the ScriptedItems procedure, replace U with the proper case number, X and Y with the item numbers and Z with the item number of the product to be formed. Then you should create two scripted items with the numbers you specified for X and Y and you should configure them to use that script.I really recommend you to take a look at some scripting tutorials before messing around with the scripts though.Regards, Godlord. Link to comment Share on other sites More sharing options...
cook Posted March 10, 2010 Author Share Posted March 10, 2010 That sounds simple enough, I'll test it out as soon as I get a chance. I have read a bunch of different script tuts and feel like I got the just of it, I just have a hard time with placement. Thanks for your help though, I cant wait to test this out. Link to comment Share on other sites More sharing options...
cook Posted March 14, 2010 Author Share Posted March 14, 2010 There seems to be 2 item scripts. One in the client and one in the server folder. Am I suppose to put that code in the same spot in both of them or just in one of them? Also where exactly in the code do I put it?This is where Im at…D:\Games\Eclipse\Eclipse-Stable\Server\Scripts\Events\ScriptedItemWhere in this code do I put your code? And once its in how do I check to see if it works? Is it as simple as right clicking on one of the items or will it automatically create the desired item once I get the needed items in my inventory?Sub ScriptedItem(Index, Script, Slot)Select Case ScriptCase 0Call PlayerMsg(Index, "This scripted item has no apparent use.", WHITE)Exit SubCase ElseCall PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE)Exit SubEnd SelectEnd Sub Link to comment Share on other sites More sharing options...
Godlord Posted March 14, 2010 Share Posted March 14, 2010 The client doesn't have any scripts, normally. Unless you're talking about the DAT-files, which are just the items not the scripts.```Sub ScriptedItem(Index, Script, Slot) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted item has no apparent use.", WHITE) Exit Sub Case 1 If CountPlayerInvItem(Index, X, 1) And CountPlayerInvItem(Index, Y, 1) Then Call RemovePlayerInvItem(Index, X, 1) Call RemovePlayerInvItem(Index, Y, 1) Call AddPlayerInvItem(Index, Z, -1) End If Exit Sub Case Else Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```Replace X and Y with the numbers of the items to be replaced and replace the Z with the number of the item with what to replace them with. You should make three items using those three item numbers you specified (in your item editor). Two of them (X and Y) should be a scripted item and should be using script 1\. You can fill in the rest as you desire. The third item could be anything you want.How to use it in the game: get item X and get item Y, click on either of them, doesn't matter which, you'll normally get item Z and item X and item Y will disappear.Regards, Godlord. Link to comment Share on other sites More sharing options...
cook Posted March 15, 2010 Author Share Posted March 15, 2010 Ok please be patient with me. Im doing something wrong, please help. Im getting this error:TYPE: Type mismatch: 'CountPlayerInvItem'LINE:7CLOUMN:0CODE:I'm attempting to use items number 8 and 9 to create item 10\. Now correct me if Im wrong but shouldnt I make items 8 and 9 script items, each being script number 1, an then make item 10 just a normal item?This is what my code looks like:Sub ScriptedItem(Index, Script, Slot) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted item has no apparent use.", WHITE) Exit Sub Case 1 If CountPlayerInvItem(Index, 8, 1) And CountPlayerInvItem(Index, 9, 1) Then Call RemovePlayerInvItem(Index, 8, 1) Call RemovePlayerInvItem(Index, 9, 1) Call AddPlayerInvItem(Index, 10, -1) End If Exit Sub Case Else Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub Link to comment Share on other sites More sharing options...
Lam3r Posted March 16, 2010 Share Posted March 16, 2010 Firstly, use code tags, it's really annoying when you don't.Now to fix your problem, CountPlayerInvItem is a boolean value i believe, so try doing this:```'###################'Fixed by Lam3r'###################Sub ScriptedItem(Index, Script, Slot) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted item has no apparent use.", WHITE) Exit Sub Case 1 If CountPlayerInvItem(Index, 8, 1) = True And CountPlayerInvItem(Index, 9, 1) = True Then Call RemovePlayerInvItem(Index, 8, 1) Call RemovePlayerInvItem(Index, 9, 1) Call AddPlayerInvItem(Index, 10, -1) End If Exit Sub Case Else Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub``` Link to comment Share on other sites More sharing options...
cook Posted March 16, 2010 Author Share Posted March 16, 2010 Sorry but still nothing happens except for the same error message popping up. Just to make sure you know I am using Stable, incase that helps. Link to comment Share on other sites More sharing options...
cook Posted March 16, 2010 Author Share Posted March 16, 2010 I also wanted to repeat that my version of eclipse stable does indeed have a client\scripts\scripteditem ess file. Now with that being said is it necessary for me to copy that line of code into both the client scripteditem ess file and the server scripteditem ess file? Link to comment Share on other sites More sharing options...
Lam3r Posted March 16, 2010 Share Posted March 16, 2010 No it only needs to be in the server, it shouldn't be in the client at all. Link to comment Share on other sites More sharing options...
cook Posted March 16, 2010 Author Share Posted March 16, 2010 ok, well so far Ive only attempted to put scripts into the server folder which is good except i still cant get it to work. Link to comment Share on other sites More sharing options...
cook Posted March 16, 2010 Author Share Posted March 16, 2010 still haven't received any help that works. Please, there has to be somebody out there that knows a little about stable item + item = item scripts that actually work… Link to comment Share on other sites More sharing options...
Lam3r Posted March 16, 2010 Share Posted March 16, 2010 Yeah Godlord and I both know what we're talking about, YOU screwed something up on your end, because the script i posted works. Link to comment Share on other sites More sharing options...
Godlord Posted March 16, 2010 Share Posted March 16, 2010 ```Sub ScriptedItem(Index, Script, Slot) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted item has no apparent use.", WHITE) Exit Sub Case 1 If CountPlayerInvItem(Index, 8) > 0 And CountPlayerInvItem(Index, 9) > 0 Then Call RemovePlayerInvItem(Index, 8, 1) Call RemovePlayerInvItem(Index, 9, 1) Call AddPlayerInvItem(Index, 10, -1) End If Exit Sub Case Else Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```Regards, Godlord. Link to comment Share on other sites More sharing options...
cook Posted March 16, 2010 Author Share Posted March 16, 2010 I just deleted and reinstalled the game from scratch, didnt change or touch anything except for input the code you gave me and I still get the error:```TYPE: Type mismatch: 'CountPlayerInvItem'LINE:7CLOUMN:0CODE:```This is exactly what Im doing…1\. Put in your code so it looks like this```'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Module: ScriptedItem.ess '' Author: Stephan J.R. van Schaik '' Date: August 30th, 2009. '' Version: 1.0.0 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function: ScriptedItem '' Brief: executes when somebody uses an item. '' Parameters: '' Index: the index of the player. '' Script: the script to execute. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Sub ScriptedItem(Index, Script, Slot) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted item has no apparent use.", WHITE) Exit Sub Case 1 If CountPlayerInvItem(Index, 8, 1) > 0 And CountPlayerInvItem(Index, 9, 1) > 0 Then Call RemovePlayerInvItem(Index, 8, 1) Call RemovePlayerInvItem(Index, 9, 1) Call AddPlayerInvItem(Index, 10, -1) End If Exit Sub Case Else Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```2\. Then I create 2 scripted items both of which use script 1. I use the eighth and ninth item spots for these items.3\. Then I create a normal weapon item in the tenth item spot.4\. Then I place items 8 and 9 on my map, pick them up, and try to use them. This is when I get the error. Link to comment Share on other sites More sharing options...
Lam3r Posted March 16, 2010 Share Posted March 16, 2010 No the item slot on the player has nothing to do with it..By item# we mean the 8th item you created in your game. Items actually have a number, and if you look through a list of all your items they are all numbered, the item that you want to use needs to be #8/9/10 Link to comment Share on other sites More sharing options...
cook Posted March 16, 2010 Author Share Posted March 16, 2010 Yes I knew that. I didn't mean to make it sound like I was talking about the actual slots in the inventory. The items are items numbers 8,9, and 10\. I wish that was the mistake I made cuz then I would be that much closer to finding a fix. Link to comment Share on other sites More sharing options...
Godlord Posted March 16, 2010 Share Posted March 16, 2010 @Cook:> I just deleted and reinstalled the game from scratch, didnt change or touch anything except for input the code you gave me and I still get the error:> > ```> TYPE: Type mismatch: 'CountPlayerInvItem'> LINE:7> CLOUMN:0> CODE:> ```> This is exactly what Im doing…> > 1\. Put in your code so it looks like this> ```> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''> ' Module: ScriptedItem.ess '> ' Author: Stephan J.R. van Schaik '> ' Date: August 30th, 2009. '> ' Version: 1.0.0 '> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''> > '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''> ' Function: ScriptedItem '> ' Brief: executes when somebody uses an item. '> ' Parameters: '> ' Index: the index of the player. '> ' Script: the script to execute. '> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''> Sub ScriptedItem(Index, Script, Slot)> Select Case Script> Case 0> Call PlayerMsg(Index, "This scripted item has no apparent use.", WHITE)> > Exit Sub> > Case 1> If CountPlayerInvItem(Index, 8, 1) > 0 And CountPlayerInvItem(Index, 9, 1) > 0 Then> Call RemovePlayerInvItem(Index, 8, 1)> Call RemovePlayerInvItem(Index, 9, 1)> Call AddPlayerInvItem(Index, 10, -1)> End If> > Exit Sub> > Case Else> Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE)> > Exit Sub> End Select> End Sub> ```> 2\. Then I create 2 scripted items both of which use script 1. I use the eighth and ninth item spots for these items.> > 3\. Then I create a normal weapon item in the tenth item spot.> > 4\. Then I place items 8 and 9 on my map, pick them up, and try to use them. This is when I get the error.You used the code before I edited and fixed some issue.Regards, Godlord. Link to comment Share on other sites More sharing options...
Lam3r Posted March 16, 2010 Share Posted March 16, 2010 Use this, I'm sure godlord edited after u pasted:```Sub ScriptedItem(Index, Script, Slot) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted item has no apparent use.", WHITE) Exit Sub Case 1 If CountPlayerInvItem(Index, 8) > 0 And CountPlayerInvItem(Index, 9) > 0 Then Call RemovePlayerInvItem(Index, 8, 1) Call RemovePlayerInvItem(Index, 9, 1) Call AddPlayerInvItem(Index, 10, -1) End If Exit Sub Case Else Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub``` Link to comment Share on other sites More sharing options...
skulper34 Posted March 16, 2010 Share Posted March 16, 2010 I tried this script and it worked perfectly, so it might be a thing on your side. Link to comment Share on other sites More sharing options...
cook Posted March 18, 2010 Author Share Posted March 18, 2010 I am still getting that error every time I go to click on the items.```TYPE: Type mismatch: 'CountPlayerInvItem'LINE:7CLOUMN:0CODE:```Does anybody know what this code means?What could I possibly be doing wrong? Ive tried everything. I go into server, scripts, events, scripteditem ess, place the correct code there in the correct spot and I still get the error. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now