[-]
Main Menu
Portal
Forums
Wiki
Rules
FAQs
Events Calendar
Downloads

[-]
Kreets

[-]
Latest Threads
What is glistening
Last Post: Geoni
07-04-2018 01:24 AM
» Replies: 1
» Views: 74
"Years of Service" Awards
Last Post: Maulbane
05-26-2018 09:58 PM
» Replies: 100
» Views: 2925
Introduction Memphis
Last Post: Maulbane
05-26-2018 05:09 AM
» Replies: 11
» Views: 3352
Hello Everyone
Last Post: Maulbane
05-26-2018 04:59 AM
» Replies: 1
» Views: 189
RL Picture thread #2 (No vulgar this tim...
Last Post: Maulbane
04-10-2018 02:09 AM
» Replies: 2493
» Views: 98207

[-]
Who's Online
There are currently no members online.

[-]
Google AdStuff

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
[-] The following 1 user Likes DuskWolf's post:
  • KrevSekera
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. ^^
PM
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?
PM
Reply
#6
But how do you make a GHi buff requirement?
PM
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.
PM
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.
PM
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!"
PM
Reply


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



Users browsing this thread: 1 Guest(s)

youth-backhand
This forum uses Lukasz Tkacz MyBB addons.