• entries
6
0
• views
314

# VividScript

675 views

Resumed work on Vivid-Script. Vivid-Script is a managed, real time scripting language. It is wrote for Vivid3D, and as such will not just be a normal language with a set of functions,

it will instead offer several features that connect closely with the engine. It works on a dynamic engine. i.e, it uses a lot of the C# dynamics feature, so that code is clean and safe, by ensuring there are no mis-matches before running.

here is a simple script, that runs fine. and also there is the code to run it in c#

module TestModule

int testVal

end

func Entry(int age,string name)

printf("Hey testing!"+" Oh yeah!"+" This is working!")

end 

And here is the code to run it,

  VSource src = new VSource("test1.vs");
VCompiler comp = new VCompiler();
VCompiledSource s = comp.Compile(src);

VME test_vme = new VME();

test_vme.SetEntry ( s.EntryPoint );

test_vme.RunEntry ( );

And here is the function that registers C# methods/code to the language, so it can connect to normal C# methods easily.

 public void RegisterOSFuncs ( )
{
// - printF( <Expressions> )

{
Link = ( t ) =>
{
Console.WriteLine ( "printF:" + t[0]);

return null;
}
};

}

There are no comments to display.

## Create an account

Register a new account

• ### Similar Content

• By wbrill23
Hello,
I'm scripting a music player with blueprints in Unreal Engine. I have a UI and I want to call the Play Music, Go To Next Song, and Go To Previous Song functions from it. How would I do that?

• Hello, my name is Piotrek, I'm 26 years old and I'm a programmer looking for a team who could use my help. I am programming amateurly for over 8 years (sometimes more, sometimes less), I studied computer science and currently I've been working for over two years as C# developer in company creating backup software (WinForms. WPF etc.). I played with UnityEngine (more) and UnrealEngine (less) so I get basics to further work.
I wanted always make computer games and it's why I became programmer. I tried few times to collaborate with single persons from Internet but it was always starting from zero. without any experience and unfortunately, it didn't work out. Now I'm looking for a team which are working now on game and have more work than programmers (but had at least 1-2 with which I can work). It would be nice if it is a commercial project (I can work some times for free to show my skill), but if it is a hobby project I also could consider cooperation. My main goal is to ship first game for my portfolio. I can spend 2-3h every day on this, in weekends more.
Please PM if you have something which could interest me or any question.
EDIT: It didn't last long to wait for first offers, so I'll focus now on one of them and if it won't work out well (I hope not!), I will be back here. Wish me good luck.
• By null777
Hello, I'm working on developing a 2D platformer. In the game, the player can run/jump/etc, and they can also often shoot at the same time that they're performing these other actions. For programming these actions, I have no issue constructing the relevant FSMs and getting them to behave as intended. My issue comes when I need to find the right frames or animations for the sprite to show. Should the game just check if the player is shooting and what state they're in and then have the right animations hardcoded in to play in each possible outcome of that if statement? I've considered some potentially more elegant solutions like having a normal sprite sheet and then a shooting sprite sheet where the shooting sheet has the corresponding shooting frame at the same position in the sheet. Then the animator would just have to load the correct frame of its current sheet no matter what, and whenever the player is shooting, it simply swaps out the regular sprite sheet for the shooting one.

Basically I can think of a few different ideas that sort of solve this problem, but none of them seem ideal. I wanted to know what the generally accepted best practices are for this type of problem. Any advice would be appreciated.

• Hello!
I'm a student in a Game Design class, and I need help with a primitive game that's due tonight. It's my first time using vectors, Dot products, and 3D space.
The object of the game is simply to sneak past the NPC and reach the goal without being spotted. I'm currently writing script for the NPC, which I intend to have a "cone" of vision, as well as a maximum visibility distance. I've worked out distance with relative ease, but I haven't figured out how to create a field of view for the NPC to spot the player within. I need help with a solution for this mechanic. I'm not intending for anyone to solve it for me, but I've hit a wall, and am at the point where I cannot complete this without asking for help. I'm building in Unity.
Any feedback is GREATLY appreciated.
• By Amitean
Simply put, my function compares two AABBs for collision detection, and when they are around the same size it works fine, but I noticed that if I greatly decreased the size of one of them (or augmented the size of the other), then the collision wouldn't be detected correctly; I would have to have them intersect for a collision to be registered rather than having it register when they are at least in direct contact, which is the intended behavior.
Below is my code.
local function DetectCollision(a, b) -- AABB to AABB local collisionX = (a.Position.X + a.Size.X) >= b.Position.X and (b.Position.X + b.Size.X) >= a.Position.X local collisionY = (a.Position.Y + a.Size.Y) >= b.Position.Y and (b.Position.Y + b.Size.Y) >= a.Position.Y local collisionZ = (a.Position.Z + a.Size.Z) >= b.Position.Z and (b.Position.Z + b.Size.Z) >= a.Position.Z return collisionX and collisionY and collisionZ end EDIT - To be more specific, the issues start to occur when I cut the size of one of the AABBs in half. For instance, if I had two cubes where one's size is 12 on all axes and the other is six on all axes, then the collision will not register. Upon debugging, I noticed that only one of the collision bools will become false. This seems to depend on what axis the smaller bounding box moves from in relation to the bigger one, so if I moved the smaller AABB away from the bigger one on the y-axis, then collisionY will be false.
×