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

Author Topic: Few start-up questions.  (Read 1119 times)

Awexo-Production

  • General Accounts
  • *
  • Posts: 1
    • View Profile
Few start-up questions.
« on: Sep 04, 16, 05:11:08 PM »

Hallo a little indie company here!

I am new here I just finished watching and reading countless of tutorials on youtube and on the wiki. However the example  that I feel is left out on is, or haven't found, is that I am unsure how to go about editing what happens on start-up and where objects call scripts from.

Let's for example say I wanted to make a login screen once you open your game. You login and directs you to the character selection screen. Where you can create a character and blah blah blah eventually you end up in the game.
Where would I make changes to make my login GUI show up to start this giant chains of events?
I am not asking about code directly but atleast the methods that is called upon startup.

Last question is about how scripts are called say we are in the game how do I instantiate my NPC's, Spawn points and such?

I be very happy if anyone could pin-point me towards a wiki article which covers these topics or even write out answers if it's necessary :).  I look forward to see the power of hero engine!

Best regards from:
Awexo Production
Head-programmar: Zanaj Saki.

P.S I really am sorry if this have been answered!
Logged

ToY-Krun

  • General Accounts
  • *
  • Posts: 677
  • Support Volunteer
    • View Profile
Re: Few start-up questions.
« Reply #1 on: Sep 05, 16, 03:48:41 PM »


First off, due to the impossible task of determining how everyone will create their game, implement character creation, spawn their characters , implement combat... etc etc, there are no set in stone ways to do such things, and won't be.

What you will find are articles on the Forums by others with examples of "how they did it".  Your questions have came up yes, and you can find alot more info than I can give you in one post, by searching the forums, however you'll have more luck being more pointed in your search.

For example:
search for character selection or CharacterSelection on the forums.

Yes it will take some weeding out to get the information you want, but there is simply alot of info on most subjects.
and thus alot of different threads.

I'll try to address your individual questions in a way to get you started.

First, your questions cover such a broad spectrum...  there are several different systems considered here, each with its own challenges in building.

Quote
I am unsure how to go about editing what happens on start-up and where objects call scripts from.

1) What happens on startup depends on what is starting up
PlayerConnection Node
Account Node
PlayerCharacter Node
NonPlayerCharacter Node
AiAgent Node
Area Node
World Node
GUI node
Model Instance Node
Trigger node

.. you get the picture :)
Every object is a node (once instantiated) and every object has some function or method that is automatically
called when that node is created.  These functions or methods are usually found within the ClassMethods script for that class (for a player character one place this happens is  the _RootNodeLoadedNotification() method within the E_playerCharacterClassMethods script depending on when/where the player character is being loaded)

by default all character nodes call the InitCommonCharacter() method within the E_CommonCharacterClassMethods script.  this is where character setup takes place.

After this, where and when the node is called on to act/be changed depends on your design.
E_RegenTimer_Tick() is a timer that constantly watches for change and regens the characters health for example.
For NonPlayerCharacters, the E_AiAgent constantly runs a timer to check for any actions the npc needs to carry out.

Npc's and Players both share the E_CommonCharacter Class, as the E_CommonCharacter Class contains fields which are.. "common" to both, thus the name.


Quote
where objects call scripts from
objects call methods or functions, not scripts (although a particular method or functions within a script may be called by using a "ScriptRef", however thats alot deeper than this will get into)
Example:
PlayerA.SetLevel(someInteger)

Some methods Must be called by the node:
PlayerA.SomeMethod()

Other methods are called using a system node, to act on another node
$CharDriver._ClearDriverPoints(PlayerA)

Functions are called without a pointer to Act on a Node(s)

Functions are called from within their script like this:
DoMyFunction()

shared or public functions are called from outside their script like this:
SomeScript:DoMyFunction()

Some links to consider:
http://wiki.heroengine.com/wiki/Nodes
http://wiki.heroengine.com/wiki/Class_methods
http://wiki.heroengine.com/wiki/Functions
http://wiki.heroengine.com/wiki/Character_functions


Quote
Let's for example say I wanted to make a login screen once you open your game. You login and directs you to the character selection screen. Where you can create a character and blah blah blah eventually you end up in the game.

You are provided with this by default.  Its expected that you alter it to your needs, but it is fully functional.
To get a better idea of how it works, its best to open the scripts involved and follow the flow of method/function calls.  This has been discussed at great length on the forums.
See:
http://wiki.heroengine.com/wiki/$CHARACTERCREATIONSYSTEM
http://wiki.heroengine.com/wiki/$CHARACTERSELECTIONSYSTEM
Study the CharacterSelection class scripts both client and server, as well as the
E_CharacterSelectionGUI class script on the client.
The "login GUI" is the E_CharacterSElectionGUI class, and within it you can find what takes place/when.
The process begins on the Server in the connection and account classes... its a huge network of calls being made, which is part of the MMO framework. 

You might find some useful information regarding this in the following thread:
https://community.heroengine.com/forums/index.php/topic,6122.0.html

Errors in these systems can cause serious headaches, so I would recommend the study of other systems first , to get the hang of HSL and HE.

Since you have access to every system, via HSL, it is very possible to break your world so take care how you approach certain systems :)  The Login system being one of the most apparent in this regard (even a small problem could render you unable to login to your world and thus unable to fix the problem)

Quote
Last question is about how scripts are called say we are in the game how do I instantiate my NPC's, Spawn points and such?
You would create a system from scratch to generate and manage spawns.  such as an object which acts as a
"spawn point" containing information about what to spawn/when/how.

You can "spawn" npcs for testing using the F5 key, select tools, then character registry.
Alternatively you can use the /henpc chat command.
For details type /henpc and hit enter, a help list will be printed out in the "chat panel" tool.

Prometheus2012

  • General Accounts
  • *
  • Posts: 651
    • View Profile
    • Exile-Online
Re: Few start-up questions.
« Reply #2 on: Sep 27, 16, 09:00:02 AM »

Welcome to HE.

Feel free to join up to the skype group we have set up for HE developers. It is a great resource and we can help you with any questions you may have. Cheers.

Thazager

  • General Accounts
  • *
  • Posts: 1138
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: Few start-up questions.
« Reply #3 on: Sep 27, 16, 07:15:52 PM »

Once you have a basic idea of how your game will work and look, then start with some small examples of coding, possibly in the dev tutorial section. Get to know the different sections, like the DOM where class and fields are defined, then how scripts are created, and how they should be named. How the client calls server functions and how the server calls client functions.

From there, try a few of the bigger more challenging tutorials, and then once you feel confident, try the Spec system. The specs are a built in method for adding data to the game, they also save data on server side while providing the data for client side. They allow non programmers (your team devs) to enter data into the game and have it work thru the use of specs.

Here's a small list I put together for GUIs, Dev tutorials
and the Data storage Spec system
Logged