The following warnings occurred:
Warning [2] Undefined variable $search_thread - Line: 60 - File: showthread.php(1617) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1617) : eval()'d code 60 errorHandler->error_callback
/showthread.php 1617 eval
Warning [2] Undefined variable $forumjump - Line: 89 - File: showthread.php(1617) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1617) : eval()'d code 89 errorHandler->error_callback
/showthread.php 1617 eval




GHI item a requirement for a GHI item Tutorial
#1
How to make a GHI item a requirement for a GHI item

((Another chapter in the DuskWolf GHI tutorials, I would have posted this in the articles and guides but it would not let me do pictures there))

This would be useful to make things like a lock and key, tobacco for a pipe, and thousand other uses.

First we must make an Item ID finder. Every item has an ID normally you would have to get into the code to find it but with this nifty little device you can find the ID right in game. This would be more of an OCC item.

To make the device we need to make a new item, name it, pick icon. I named mine ID finder and picked a telescope for a icon. Then hit next to get to the next screen, now in the drop down box select “Script” and click “Add new”. You will get big empty box.

[Image: ID.jpg]
In that box put this code

Code:
GHI_ID ={};
GHI_ID.cursorFeedback = function(id)  
    if id then      
      local name = GHI_GetItemInfo(id);    
      GHI_Message(name..": "..id);    
    end
end

GHI_SetCursor("choose_item",GHI_ID);

Click ok then Finish and you are done.
Now you can right click the ID finder, it will turn you curser blue and then you click on any GHI Item and it will print out its ID in the chat frame.

Now it is time to make the GHI item requirement, I am going to make a Chest with a key.

First make the key it dose not need any thing special just a name and a icon. Of coarse you can add what ever you want to it.

Now use your ID finder and find the ID.
Next make a new item you want the requirement for, your locked chest. Name, icon and what ever else you want and go to the next screen. There you can make it a bag by selecting “bag” in the drop down menu and clicking “add new”. You may choose how many slots you want in the bag and hit ok.

Now comes the important part of clicking the “Run Always” so it changes to “Is Fulfilled”

Last we make the requirement. Select Requirement from the Drop down menu and Click “Add New”. When the Requirement frame shows up select Lua Statement from the drop down menu. In the requirement filter box put this code

Code:
GHI_CountItem("Corwin_42671262") > 0

[Image: LuaState2.jpg]

This checks sees how many items with that ID do you have and if it is greater than 0 then you have fulfilled the requirement. Replace Corwin_42671262 with what ever you items ID is. Make sure you put the ID is quotes. Click finish and you are done.

[Image: end2.jpg]

And that's it, not too hard and the uses are limitless.

Let me know if you have any questions
Reply
#2
Holy Hell!
I was looking for this thing for quite a while, thanks a lot for making it look easy. I'll definitelly give it a try next time I get on. Gonna save the page for now on my PC. Exactly what I needed. ^^
Thank you.
"Educate yourself in the art of true metal."
"From the Heaven of My Heart" & "Silver Bride" - Amorphis (Skyforger)

"Beyond the Stars"
~ Head over to our own subforum on CotH Worlds and enjoy. ^^
Reply
#3
Woosh, made my first GHI map with this with a requirement. Now that I actually did something more complicated, I enjoyed it more. Thanks for the guide :)
Quote:Perhaps one day, at a new sight,
We will search again for that light.
Hold it close, between our arms,
Listen again, to the priestess her charms.
- Me, in a poetry named "The Priestess."
Reply
#4
Woosh, made my first GHI map with this with a requirement. Now that I actually did something more complicated, I enjoyed it more. Thanks for the guide :)
Quote:Perhaps one day, at a new sight,
We will search again for that light.
Hold it close, between our arms,
Listen again, to the priestess her charms.
- Me, in a poetry named "The Priestess."
Reply
#5
But how do you make a GHi buff requirement?
Reply
#6
But how do you make a GHi buff requirement?
Reply
#7
In the requirement Type drop down menu there is GHI Buff as one of the choices
Reply
#8
Yeah... But when I make a GHI buff requirement, I can still use the item wether I have the required buff or not.
Reply
#9
You need to hit the button next to the right click action till it says "Is Fulfilled"
Reply
#10
mmmmm, sticky, this deserves!
[Image: badge.jpg]
[Image: badge.jpg]
The unholy army of Arthas the Lich King, you will not rest until you rule all.
Reply
#11
All of Duskwolf's guides should be sticky-ed, but then we would have too many stickies.

And thanks for yet another great GHI guide, this'll be really useful for me.
It's also given me a fiendishly evil idea for a player-built quest... But I won't tell anyone until I try this out.
"... And we're off to another exciting adventure!"
[Image: 8LlaM.jpg]
"No we are not!"
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  GHI Missions Tutorial DuskWolf 14 5,931 09-18-2009, 07:50 AM
Last Post: sepheris



Users browsing this thread: 1 Guest(s)