Giter Site home page Giter Site logo

jetscript's People

Contributors

matt-attack avatar stefantrifunovic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jetscript's Issues

Negative function parameter

When you add negative function parameter to a script command, I lost some values in c++. Here's an example :

I have a script command, and second parameter of that command is negative number(-100).

effect_move("bat",-100,120,6);

The output returns first parameter, which is a string as number, same as second parameter.

(*_ScriptContext)["effect_move"] = [](Jet::JetContext* context, Jet::Value* arguments, int numarguments)
{
        Jet::Value a = arguments[0];   // Number , -100 <- Lost string value
        Jet::Value b = arguments[1];   // Number , -100
        Jet::Value c = arguments[2];   // Number , 120
        Jet::Value d = arguments[3];   // Number , 6
};

But when you use negative number as variable(num), everything works ok.

    num = -100;
    effect_move("bat",num,120,6);
(*_ScriptContext)["effect_move"] = [](Jet::JetContext* context, Jet::Value* arguments, int numarguments)
{
        Jet::Value a = arguments[0];   // String, "bat" <- OK 
        Jet::Value b = arguments[1];   // Number , -100
        Jet::Value c = arguments[2];   // Number , 120
        Jet::Value d = arguments[3];   // Number , 6
};

ps. keep up the good work, this scripting language rocks !

C++ function call with parameter

I want to call script function and pass parameter to it, but it returns Null . I don't know if my JetContext call is wrong, so I hope this can be resolved. Here's example from my test :

Call from c++ :

// Don't know if this is a right way to pass parameters to script function
_ScriptContext->Call("onUpdate", new Jet::Value(dt),1); // dt is float

Script :

fun onUpdate(delta)
{
    print(delta);
} 

Return in console : Null

Thanks in advance

Fix on 64 bit linux

Currently dies with

Jet Language Console:
jetscript: malloc.c:2394: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Aborted

Is there a way to set/get global script variables from c++ by name ?

Is there a way to set/get global script variables from c++ by name ? I've to get JetContext variables but I don't see where I can do that. It would be great if there is a mehod for setting/getting variable from c++, something like :

class JetContext

void addVariable(string name,Jet::Value Value);
Jet::Value getVariable(name);

Maybe there is a way but I can't figure it out from source :(
Thanks in advance

ps. I'm using jet scripting for a small game that I'm about to make, and this is realy nice because syntax is more like squirrel script (don't like lua syntax much ), but easier to setup,bind and run than squirrel script. So thanks for your efforts ๐Ÿ‘

Call from script to c++

I really like this scripting language, this is exactly what i need for my project, so thanks for sharing. I have one question : Will there be possible to call from script to c++ ? Thanks in advance...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.