Jump to content

Concept Idea For My Game - LUA or C++ for Coding?


Defranco
 Share

Recommended Posts

Hey guys;

 

So been learning basic LUA via all the scripts & tutorials provided on youtube, and on this site. And there's a specific thing I'm interested in eventually implementing into my game. I'm curious if its better to arrange for this feature to happen with either LUA, or C++, I have the upgraded standard version, so I believe I can do both.

 

So what I'm interested in having done is: adding a inventory to a packmule donkey NPC (i have the model already) - then I want to make this donkey eventually obtainable in the game, and I want it to be able to follow/unfollow the player when the player wants it do, and then additionally, I want to setup areas where the packmule can't follow the player, like into buildings, etc.

 

 

So I have extreme limited knowledge of coding right now, but I have faith that I'll be eventually able to do the above.

 

I'm assuming that LUA can handle this; (I'm going to just give a bit of a breakdown of 'how' I think the code would work - mechanical wise)

 

1)

- Create a inventory for the donkey mule; (same as how tutorial #16 & 17 of of project saturn by Jorn Theunissen was done) except calling it something else so it doesn't mix with the player inventory)

- Then I'll need some sort of function where if the player uses a hotkey (e) on the donkey, and ensure that the donkey is really the donkey, check also if the donkey is in range, then it would need to display a inventory on the player screen

 

(I'm assuming using a inventory table that the inventory will exist everywhere, but only accessible/shown when the player uses a key on said donkey, and that its in range to be used)

 

2)

- Create a AIscript for the donkey that is "good team" and will follow - unfollow the player when the player uses a certain hotkey. I assume this script will need to have included the check that player is really the player, and that the player is in range of the donkey.

 

- Create within the script that the donkey will then unfollow the player automatically when the donkey has collision with certain invisible collision trigger block.

 

(I assume I will need to make a collision block - invisible - at each area I want to block off the donkey) and use some sort of call or check function to link the donkey AI script together with the collision block.

 

3)

- Create an enable clause that only allows the donkey to do all this only after the player has completed a certain quest. So I'll need to have this donkey start out disabled, and put in an activation function in another quest script?

 

 

-------------

 

All in all, I am curious if my train of thought is in the right direction. I would like to start experimenting. I think there's enough in a few of the tutorials for me to get at least one of these functions working, or close to.

 

Let me know what you guys think, if I should be doing it with C++, or LUA.

 

EDIT: Forgot to mention, I'm planning on using Neosis GUI Engine for the GUI & inventory - so I think part of it needs to be C++ if Im not mistaken?

Link to comment
Share on other sites

Get the C++ version and code as much of the logic as you can in LUA then use C++ for the bits that you cannot solve in LUA. ( if you just compile a new C++ project with no changes you bascially create the LUA client )

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...