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

Author Topic: [Resolved] HSL externals vs. included script functions  (Read 930 times)

Absolver

  • General Accounts
  • *
  • Posts: 6
    • View Profile
[Resolved] HSL externals vs. included script functions
« on: Apr 25, 12, 04:04:19 PM »

Hey folks! Well, color me silly after I painstakingly crafted a Capitalize function to handle proper capitalization of strings, and then found upon submit that there was another function called Capitalize lurking about in a standard script file? (Which I can't find in the organizer, by the way).

Question is, why aren't string utilities like Capitalize* and Trim* HSL externals rather than HSL scripts? And also, is there a definite function list that includes both included script-created functions meant to extend HSLs functionality, as well as externals?
« Last Edit: Nov 01, 12, 11:10:56 PM by HE-Cooper »
Logged
Best regards,
Kenneth Aalberg
Periscope Games

TGSRofar

  • General Accounts
  • *
  • Posts: 153
    • View Profile
Re: HSL externals vs. included script functions
« Reply #1 on: Apr 25, 12, 04:55:35 PM »

Excellent question. I have implemented several helper functions like that only to find out later that an implementation already exists in the standard scripts somewhere.
Logged
Ron Farrell
Lead Programmer
Triad Game Studios

JMurdick

  • General Accounts
  • *
  • Posts: 54
    • View Profile
Re: HSL externals vs. included script functions
« Reply #2 on: Apr 26, 12, 07:42:25 AM »

A really good place to locate functions is right here:  http://wiki.heroengine.com/wiki

There are a couple other good places:

1) _ExternalFunctions script.  This is present on both Server and Client (and different on each).

2) Search for "utils" in the HeroScript Editor on both Client and Server.  Be sure and check "Show Engine".  You'll find quite a few that have useful functions, such as ListUtils, DebugUtils, and ObserverUtilities.
Logged

HE-Cooper

  • *****
  • Posts: 2221
    • View Profile
Re: HSL externals vs. included script functions
« Reply #3 on: Apr 27, 12, 08:48:45 AM »

Additional answer is we try to document everything, but even some external functions go unofficially documented. As for HSL functions that could be external functions, sometimes there's reason for them, so they can be easily duplicated and modified, or because they were written on the fly, or because they are easier to use inline, etc.

Short answer, there's no good answer exactly. :-)

BUT! Since it happened to you, make sure you modify the wiki in a way so it won't happen to others! :-D
Logged