42
votes
Accepted
What's the technology that allows programming inside a game?
Scripts written in scripting / embedded / interpreted languages such as "Lua", "Lisp" or "AngelScript" (more here) can be updated during the game [*] and then are interpreted (= executed) on the fly.
...
12
votes
What's the technology that allows programming inside a game?
Embedded language is the proper technical term. In practice, languages which are used inside other applications (such as games) are often referred to as scripting or even interpreted languages, ...
10
votes
What's the technology that allows programming inside a game?
You are looking for a way to change the code into some actions. This is precisely what interpreters are doing.
Take a look at Python. You run it, and bam! You land in REPL(Read Eval Print Loop).
You ...
5
votes
Accepted
Array but with a name for every element (value)
There are multiple methods to deal with this.
1) You could create an enum with custom values that you could refer to:
...
5
votes
How to make Unity game moddable with scripting in a friendly way?
A somewhat blunt approach would be to let modders write C# code and then have your game read & compile those scripts, using them as though they were code the game was built with.
This has some ...
5
votes
In GameMaker, is it possible for users to code something into a game while playing, and verify that it is correct?
What you're describing is effectively running gameplay mechanics in a virtual machine, which can simplify the process of authoring them and insulate against bad behaviour.
As it happens, a lot of ...
5
votes
Accepted
What is the class name in Unity's AddComponent?
It's the class name of the component you want to add. For example, if you created a MonoBehaviour script named GoToPosition and wanted to add it to a game object ...
5
votes
Accepted
Best practice for giving properties to game objects
For HP, I'd recommend creating a Health component, something like this...
...
4
votes
Accepted
Event Trigger for sprite not working
I see that the backward image is turned around 180 degrees to make it face opposite the direction of the forward image. This means that its front side is facing away from the camera. By default, this ...
4
votes
Is allowing the server to remotely execute code on a client a security risk?
You might want to ask yourself if you really need client-sided scripting at all. You might be able to make many interesting mods possible by simply making your network protocol powerful enough. Most ...
4
votes
An object reference is required to access non-static member
Your nextLevelName member variable is not static, meaning there could be a different name set on each instance of the ...
3
votes
Array but with a name for every element (value)
It sounds like you want to associate a name with an inventory slot containing a count of grenades of that type, exposed so you can edit them in the Inspector.
In that case, I'd expand on Raeles's ...
3
votes
Accepted
How do game makers (without coding) work?
You can (and you should) create scripts while using these engines (except maybe buildbox). They usually work by having a literal engine usually written in c++ running under them, and they take your ...
3
votes
Call a BlueprintImplementableEvent from c++ in unreal editor?
Nako Sung answer:
Without game, UE4 prevents script functions to be executed accidently. (I don't know the clear reason)
In C++ you can use FEditorScriptExecutionGuard:
...
3
votes
Performance Issues Using Lua in C++
I think part of the problem (which also caused me to misinterpret the question at first) is the lual_dofile() calls.
This sounds like all scripts are always loaded ...
3
votes
Accepted
Camera Linecast Bumper Stuttery
I am not sure at all about the following.
Instead of Linecasting between the current position of the camera and the target, I would linecast between the desired position and the target.
...
3
votes
Visual Studio can't handle my unity scripts
Seems you don't have the Unity plug-in for VS Community. The project should open as a C# assembly project like the following.
It's in tools and features, go get it.
Good luck.
3
votes
User-friendly scripting when using an ECS?
ECS has its pros and cons. User-friendly scripting is not one of its pros.
The problem ECS solves is the ability to have a large number of similar things in your game at the same time while ...
3
votes
User-friendly scripting when using an ECS?
You could create a system ScriptExecutionSystem which operates on all entities with a Script component. It obtains all components of the entity which could be useful to expose to the scripting system ...
2
votes
Accepted
Modify a character's rotation without altering it's movement
Right now when you rotate the mesh you interfere with the movement because transform.TransformDirection(moveDirection) transforms from local to world space, so your ...
2
votes
Accepted
Can MoonSharp call functions from static classes?
One soulution could be creating a static callback function that in turn calls the function on the staic c# class
so for exmple
...
2
votes
Using a script to draw an icon next to (i.e. inline with) a text label in Unity
Use manual anchoring instead of using layout groups if it's not a must.
Keep both logo and text UI objects in an empty UI object. Manually anchor both objects as your intended layout. They are ...
2
votes
How to make Unity game moddable with scripting in a friendly way?
You could do it like Kerbal Space Program does it: Allow your game to load AssetBundles at runtime by having it read config files which tell it where and in what way the assets in the bundle are ...
2
votes
Accepted
Input.GetKeyDown need to press button more than once to work
Unity chose to reset the flag that services Input.GetKeyDown every frame as is noted in their docs.
You need to call this function from the Update function, ...
2
votes
What's the technology that allows programming inside a game?
There are two examples that I can think of off the top of my head. Both seem to do exactly what your asking for.
The first is screeps. https://screeps.com/ You can read alot about how it ...
2
votes
Accepted
Instantiated objects sharing the same animator cannot animate independently?
The issue is not that you are sharing the same instance of the Animator. Each card has its own instance. The problem is that you are not checking what is being hit by your raycast:
...
2
votes
Use Python scripts in my C++ game?
Without getting into the nitty-gritty...it's possible.
The Python 2.x docs have a short guide on how you could do this. Basically, it involves including the python library and invoking it when you ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
scripting × 270unity × 110
c# × 92
c++ × 31
lua × 26
python × 14
entity-system × 11
modding × 11
java × 10
architecture × 9
xna × 8
animation × 8
unityscript × 8
software-engineering × 7
javascript × 6
vector × 6
component-based × 6
udk × 6
2d × 5
camera × 5
ai × 5
procedural-generation × 5
unreal × 5
physics × 4
3d × 4