Jump to content

  • Log In with Google      Sign In   
  • Create Account


mk1x86

Member Since 16 May 2007
Offline Last Active Jun 02 2014 04:35 PM

Posts I've Made

In Topic: Question on conversion functions

30 August 2013 - 01:38 AM

If I understand you correctly, all you want to do is to distinguish between direction vectors and positions for sake of better readability of your code. Since points and vectors are essentially the same I propose to write one vector class and add a typedef for points. That way everything works out of the box but you can still use "Point2D" so the reader knows you refer to a point rather than a direction vector.

 

While you're at it you should consider writing a template class so you can have other than float vectors.

template<class T> vector2d


In Topic: External functions?

07 August 2013 - 06:31 AM

As the previous poster already stated, you're looking for an embedded scripting language. To use it you need to bind portions of your game to the scripting engine. To get started, take a look at these two scripting languages:

The latter has its own subforum here on gamedev and it's fairly easy to bind C(++) functions to it.

 

I don't recommend you to write your own parser/lexer, as you need quite some knowledge to do that and it seems you're a beginner.


In Topic: Sandbox MMO Game

07 August 2013 - 06:27 AM

Sounds like you are an idea guy, though you don't even have a game idea and name. If you want to build up a team you need substantial knowledge in at least one of those categories:

  • programming
  • 2d/3d art
  • music & sound

In any other case you probably can't contribute to your own game and ppl tend to stop working if they figure out that their project leader isn't capable of doing so. Also MMOs of all kind have the reputation of never getting finished, due to various reasons (some of them being server costs, lack of testers, sloppy engine design, you name it).

 

Consider working on a small game and finish it before you attempt to create such an ambitious game.


In Topic: RegisterGlobalFunction returning script class

17 July 2013 - 12:29 PM

Using an interface worked perfectly. Thanks a lot :)


In Topic: Dynamically compile classes

10 July 2013 - 09:26 AM

I have a few different C++ classes in my game, that can interact. "Props" like exploding barrels, vending machines, "Doors", "Lights" and "SoundSources". Each object shall react on certain events (being clicked, being "used" by a player, ...). To describe the object's internal states and reactions I'd like to use an angelscript class. For a vending machine it can hold data for the cans left, and the amount of money it has received. It should also be able to add a coke can to the player's inventory, via a line like this: player.add(createItem("coke can"));

An instance of the angelscript class is assigned to the actual C++ instance. Events are processed by calling a method of the as instance, which can only access other as instances (the c++ classes are not exposed). AS classes are derived from a base class. For example class VendingMachine : Prop { ... }

Subclasses only need to interact with the base classes. During the course of the game new objects may be created. A flare "Item" class could for example spawn a new "Light" class. This light is loaded on the fly and it may use a sub class of "Light" that is not yet built into the module.

 

Currently adding new objects is only possible if ALL classes, that MAY be used, are built in a single build call. I'd like to add new classes only when an object is loaded that uses a class not yet built into the module.

 

I hope I could clarify my problem. If there is an easier way to achieve this, please enlighten me. :)


PARTNERS