HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: Dynamic inventory -not a tutorial-  (Read 2400 times)

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Dynamic inventory -not a tutorial-
« on: Dec 15, 13, 04:13:56 AM »

Hi! The dynamic inventory GUI window that i presented in this video:
https://community.heroengine.com/forums/index.php/topic,3311.msg28222.html#msg28222
gained some interest so i'm going to share the code.

WARNING: THIS IS NOT A TUTORIAL. THESE ARE JUST SCRIPTS TAKEN OUT OF MY GAME AND OUT OF THE CONTEXT, IN CASE SOMEONE WOULD WANT TO REVERSE ENGINEER THEM.

IF YOU RUN INTO ANY PROBLEMS; I PROBABLY WON'T HAVE TIME TO HELP YOU TROUBLESHOOT THEM.


Here are the most important scripts:
https://dl.dropboxusercontent.com/u/79625595/MUD_GUIInventoryWindow.txt
https://dl.dropboxusercontent.com/u/79625595/MUD_GUIInventoryIconHolder.txt
https://dl.dropboxusercontent.com/u/79625595/MUD_GUIInventoryContextPanelLabelPanel.txt
« Last Edit: Dec 15, 13, 04:22:13 AM by AWW_boss »
Logged

DragonFist

  • General Accounts
  • *
  • Posts: 140
    • View Profile
Re: Dynamic inventory -not a tutorial-
« Reply #1 on: Dec 15, 13, 09:22:07 PM »

Thanks, this kind of help is always appreciated in my opinion.  I did similar with my over-the-shoulder camera implementation and the community expanded it.  So, thanks.
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1160
  • Never stop learning
    • View Profile
Re: Dynamic inventory -not a tutorial-
« Reply #2 on: Dec 19, 13, 10:20:19 PM »

Thought I would add some ideas for those who might be new to scripting.

In a function like:

function colorGreen (control as NodeRef of Class GUIControl) 
  control.defaultStatePresentation.color.r = 0
  control.defaultStatePresentation.color.g = 1
  control.defaultStatePresentation.color.b = 0
  control.defaultStatePresentation.color.a = 1
.

we can shorten the screen spaced used to display the same functionality. By using this function:

function colorGreen (control as NodeRef of Class GUIControl) 
  control.defaultStatePresentation.color = MiscUtils:MakeRGBA( 0, 1, 0, 1 )      // (red, green, blue, alpha)
.

as function MakeRGBA is defined in client side script MiscUtils.
Logged
Lead scripter for EO, Repop helper.
HSL Video tutorials:
https://community.heroengine.com/forums/index.php/topic,1719.msg36858.html#msg3685