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.

Topics - TGSRofar

Pages: [1]
1
Scripting & Programming / Social System
« on: Apr 13, 13, 10:04:05 AM »
Has anyone leveraged the social system yet?  I have started to look into it to implement a simple friends list and I'm a little unsure about the way to use it right now.  The wiki does a good job of explaining how the system works but doesn't really provide an example of how to use it for something like this.  It does indicate that implementing a friends list is easily done with the base implementation of the social system.

My first thought was to check out the Social Game and see how the friends list is implemented there. Although it does appear to utilize the social system, it appears to deviate somewhat by using custom classes for social data that do not use the Foundation Framework social data classes as parents.

I want to get a clear handle on how to approach using this system before I jump in and head down the wrong path. Do I create a social circle spec for a friends list? Do I need to extend the _SocialPlayerCharacterPublicDataObject class?

Any guidance here would be appreciated.

2
Scripting & Programming / Dynamic Physics replication
« on: Apr 06, 13, 10:17:50 AM »
When you have an asset in the world that is set to dynamic physics and can be interacted with on the client.  (e.g. a box that the character can collide with and move around).  How can the interaction and movement of the asset be replicated to other clients?

I think I have an understanding of the concept of physics node and how that works.  That can allow for activating a known physics simulation.  But that does not help with the dynamic interaction case.

3
Code: [Select]
method _DoesAccountOwnThisContainer( account as NodeRef of Class _PlayerAccount ) as Boolean
  player_character as NodeRef of Class _PlayerCharacter = account._playerCharacterRef
  if player_character != me._GetItemContainerOwner()
    return true
  .
  return false
.

Either the return values need to be swapped or the equality check needs to change from "!=" to "==".
Or just simply return (player_character == me.GetItemContainerOwner())

4
Scripting & Programming / [Resolved] $CHARDRIVER
« on: Aug 04, 12, 02:40:15 PM »
The clean engine _CharDriver class does not appear to work correctly.  I attempted to use it to move an NPC from one position to another.  This did not work.  The NPC does rotate towards the destination but does not move.  When the time to complete the move has elapsed, the NPC simply teleports to the new position.

When using $E_CharDriver it works just fine.

I am curious why the E_CharDriver is it's own prototype.  Why wasn't this just glommed onto the $CHARDRIVER system node, overriding with the HE_ callback methods?

Also, in looking through the _CharDriver script, I notice what appears to be an error in the method _DriverAddPointsWithEndRotation.

Code: [Select]
  if HasMethod(me, "HE_DriverAddPointsWithEndRotation")
    if me.HE_DriverAddPoints(character, positions, style, clearPoints)
      return
    .
  .
should be...
Code: [Select]
  if HasMethod(me, "HE_DriverAddPointsWithEndRotation")
    if me.HE_DriverAddPointsWithEndRotation(character, positions, style, rotation, clearPoints)
      return
    .
  .


5
What is the purpose of these external functions?  I can't find a reference in the wiki to them and there is no comment in the script regarding them.

6
Scripting & Programming / [Resolved] character rotations
« on: Aug 13, 11, 03:46:11 PM »
I'm working on my character creation camera and character interaction.  I have it setup so that clicking and dragging will rotate the character.  This works as intended, however when I release the mouse, the character wants to return to it's previous heading (180 degrees).  I've played around with trying to stop this behavior but not having any luck.  I intend to continue to try and figure out how to handle this ( I want the character to stay rotated when the drag is complete).  In the meantime, if anyone has any advice, it may save me some digging around time.

7
Scripting & Programming / [Resolved] Deleting Specs
« on: Feb 21, 11, 08:01:37 PM »
What is the correct way to delete specs?

This question is related to development of a SpecOracle and its related Editors.  During this development, I will always create some dummy specs for testing everything out but will want to get these cleaned up when the system is complete.

It appears to me that this could be accomplished by deleting the server prototypes (created specs, specoracle, and specoracleDataCache) and deleting the repository spec definitions for created specs.  Then re-create the SpecOracle server prototype.

Is this correct or is there some other way to "clean" up the junk created during development?

8
Scripting & Programming / [Resolved] Character Selection data
« on: Jan 10, 11, 04:34:54 PM »
I'm trying to create a character selection system that can display all valid characters on the account with information about those characters.  This is similar to the HJ character selection so I attempted to use the HJ reference as a guide for doing this.  At first glance, I thought it to be simple enough. 

I created a child class of _PlayerConnection and put basically the same code in it that is in HJ_playerConnectionClassMethods.  This code loads all the character nodes for the account and adds associations for them.

Then, of course I had to create a child class of _Account in order to Factory my child PlayerConnection.  Then I added my _Account class to the ACCOUNT system node.

Then in my character Selection class methods script, I override _CSSInvokeGUI by implementing HE_CSSInvokeGUI and override _CSSMarshalCharacterData by implementing HE_CSSMarshalCharacterData.  Again, very similar to the HJ code.

The only other thing on the server that it looked like I needed to do anything with is the _PlayerAccount class.  In HJ reference, there is a HJplayer_account class and one method in that class is called to get the last character selected. This became a little confusing to me because instead of creating a child of _PlayerAccount, in HJ reference, the HJplayer_account is Glommed to the _PlayerAccount node instead.  Not sure I understand why it's done that way. So I just created a child of _PlayerAccount instead.

When I first implemented these classes, I think it kind of worked. I was getting the desired data to the client for the characters on the account. However, I could not select and send a character to the world.
 
I have tried a lot of different things now and in the process have experienced numerous problems in my attempts.  I have reverted back to the E_CharcterSelectionSystem and E_Account several times in order to get to a state where I could create a character and enter the world again.  Then back to my system to try some things again. Often I have been in a situation where I would get a list of characters, select one, try to enter the world and get an immediate disconnection. I assume there is some mismatch between account\player connection nodes that the characters were created with and the ones active at the time. In those cases, I could only delete the characters and start clean. These issues seem very difficult for me to debug because often it appears as if the errors are occuring in required system scripts and I can't mess around with those to do any debug. 

In summary, I think I can get back to a state where I get the data I need sent to the client character selection GUI, but with that combination of account and playerConnection, attempting to send the character to the world fails (and I haven't determined where/why this is failing yet). There is no error, just nothing happens.

Is this the wrong way to go about this? Is there an easier way?  Is there just additional things I need to implement on the server before this will work?

Also, I'm not sure if this is something that has started happening due what I have done up to this point or not...I don't recall if this was always happening or not...but whenever I enter the character selection area and the character selection system is initializing, I get a good number of messages in the console (Got event: CSSERROR02 but I don't know what to do now?).  This would indicate that a character is found that doesn't belong to the account. Almost seems as if deleting characters doesn't completely get rid of all references to them in the account or something.

9
Scripting & Programming / [Resolved] Character Naming
« on: Dec 30, 10, 12:58:03 PM »
Calling UpdateCharacterName will fail if the name is already used.  I'm wondering how to handle character naming for allowing both a first name and a last name.  My first thought was to concatenate to make a full name.  However, the validation would pass for identical first names with different last names and vice versa.  Any thoughts on how to approach character naming with a First and Last name?

10
Scripting & Programming / [Resolved] Loading Specs on Client
« on: Dec 18, 10, 10:50:54 AM »
I feel like this should be something rather straightforward but I find myself struggling to figure out how to do this.

I have a spec oracle that I need to load the spec data on the client for.  Calling requestSpecByKey should do the trick.  But here comes my first issue.  How do I know on the client what spec keys exist for a spec oracle?  Let's just assume for now that I know I have a key = 1.

Calling requestSpecByKey attempts to find that spec but since it hasn't been loaded yet, it doesn't exist and it creates it (createSpecWithKey).  At this point, the number of elements in the collection is 1 and the spec that was just created is index 1 in the collection, as expected.

The listener is added to the spec and since the spec is still not loaded, it gets set to a state of REQUESTING and requestSpecData is called.

The spec is requested from the repository and onRepositoryDataDownloaded is called.  Spec was downloaded successfully.  But at this point, the collection is now empty.  Why? what happened between the time the spec was created in requestSpecByKey and requestSpecData that removed the created spec from the collection?

So now there is no spec instance and onRepositoryDataDownloaded creates a new instance again.  However, this new instance does not have a listener so there is no notification.

Furthermore, the script goes on to create another instance from the Data downloaded.  It removes the one it just created and adds this new one. Why did it create one, add it to the collection, just to remove that and add the final one?

What am I missing here? What is the correct way to load the specs on the client? 

11
GUI Creation / [Resolved] Spec GUI customization
« on: Nov 27, 10, 10:00:19 AM »
I have been fumbling through extending the Spec Oracle Editor for a SpecOracle I created.  I used HJ reference as a guide for this and managed to customize the Spec Editor Control as needed.  However, I struggled to figure out how to customize the Spec Selector control to display the columns I wanted to display.

Using the HJ implementation for RaceSpecOracle as an example, the Spec Selector control shows columns SpecKey and Race Name.  Mine was showing the defaults (SpecKey and PrototypeName).  I do understand that these columns are defined in the collectionHeaders list and there is a list mapping header name to display name.  I also found reference in the wiki on how to add columns by calling method AddCollectionHeader.

I spent a good deal of effort exploring the scripts in HJ for the RaceSpecOracle, but never could find where the column headers are being defined/customized.  I also looked at implemenation for other Spec Oracles in HJ and could not find anything that provided the custom headers for their Spec Selector Controls.

Finally, I just figured out a way I could accomplish this.  So I was able to customize the columns and add other columns I wanted.  Still, I would really like to know how this is being done in HJ.  Just because I found a way to do it, doesn't necessarily mean I am doing it the best/correct way.

Does anyone know how this is being done in HJ?

Pages: [1]