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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - HE-JAY

Pages: 1 ... 7 8 [9]
121
Scripting & Programming / Re: Getting targets inside a box
« on: Dec 13, 10, 02:17:51 PM »
The GetTargetsIn{Object} suite of external functions is world axis-aligned and thus should only be used to query for players or npcs from the perspective of the world (as opposed to that of the camera or the player).  These functions are most commonly used to gather information about what characters are 'in the general vicinity of' the point in question in order to establish a set of data points to work with.

In your particular case, it is likely that you will have to establish your own mapping using the camera's (or character's) orientation vector and the destination click location on the client, then sending this information to the server to be processed.

If your intention is to create a pathfinding or navigation system, note that HeroEngine does include NavMesh generation and this can be leveraged to assist in creating a point and click system.

Does this answer your question? If not, feel free to expand upon it.

122
Scripting & Programming / Re: inheritance vs glomming
« on: Dec 07, 10, 12:00:06 PM »
Two of the most compelling reason for choosing to GLOM a class onto a node rather than explicitly extend its functionality via a child class is the fact that GLOMming can be done dynamically at run-time and that GLOMMing allows a node to effectively 'inherit' from multiple classes without resorting to explicitly defining complex multiply-inherited child classes ahead of time.  This allows a node to gain additional functionality in response to some arbitrary logic (on the fly), and it also allows you to 'tack on' multiple sets of additional functionality to a node that it was not otherwise designed to handle (all without resorting to modifying the DOM or adding additional scripts).  GLOMming is - in essence - an expression of the 'Decorator' pattern of software design (http://en.wikipedia.org/wiki/Decorator_pattern).

The purpose of the Spec System is to both provide a means of storing immutable object definitions as well as instantiating objects from these definitions.  In order to provide robustness and extensibility, these 'spec definitions' may be decorated by additional classes - defined by you - to extend the definition.  This allows you to - for example - create a basic 'Item' spec, then extend it by glomming on additional functionality like 'StackableItemDecorator' or 'ConsumableItemDecorator' (to create a particular definition that describes an Item that is both Consumable and Stackable).  If you have a list of twenty decorator classes you'd like to use in creating complex composite spec definitions, creating 'Consumable Stackable Potions' or 'Throwable Stackable Knives' is as simple as glomming on the appropriate decorator class.  It would be impractical to use simple inheritance to accomplish this goal, as you would be unable to use a single base class for instantiating Item objects and would instead be forced to create explicit multiply-inherited child classes for each combination you'd like to use.

For a more complete description of how to use the spec system to accomplish this, please see both http://wiki.heroengine.com/wiki/Spec_System_-_Advanced_Usage#Spec_Decorators as well as http://wiki.heroengine.com/wiki/How_to_make_an_Inventory_System.

Pages: 1 ... 7 8 [9]