Skip to main content
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. ...
Philip Allgaier's user avatar
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, ...
interphx's user avatar
  • 395
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 ...
MatthewRock's user avatar
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: ...
DavidC's user avatar
  • 281
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 ...
DMGregory's user avatar
  • 136k
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 ...
DMGregory's user avatar
  • 136k
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 ...
House's user avatar
  • 73.3k
5 votes
Accepted

Best practice for giving properties to game objects

For HP, I'd recommend creating a Health component, something like this... ...
DMGregory's user avatar
  • 136k
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 ...
Victor T.'s user avatar
  • 1,381
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 ...
Philipp's user avatar
  • 121k
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 ...
DMGregory's user avatar
  • 136k
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 ...
DMGregory's user avatar
  • 136k
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 ...
Bálint's user avatar
  • 15k
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: ...
Navaneeth Prathap Nair's user avatar
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 ...
Mario's user avatar
  • 8,527
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. ...
Hellium's user avatar
  • 2,949
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.
suvam0451's user avatar
  • 181
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 ...
Evorlor's user avatar
  • 5,832
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 ...
Philipp's user avatar
  • 121k
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 ...
Ryan's user avatar
  • 965
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 ...
Hampus's user avatar
  • 126
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 ...
Sourav Paul Roman's user avatar
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 ...
Philipp's user avatar
  • 121k
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, ...
Cobertos's user avatar
  • 1,644
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 ...
coteyr's user avatar
  • 191
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: ...
jgallant's user avatar
  • 8,444
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 ...
Kirbinator's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible