Updated VScript : Basic Entity Code Tutorial (markdown)

Blixibon 2020-05-29 11:46:00 -05:00
parent 6f249ca97a
commit b3e1d6ffe6

@ -1,6 +1,6 @@
VScripts are a lot like the I/O system. Like how entities can take inputs, entities also have their own functions that could be "fired" in VScript.
VScripts are a lot like the I/O system. Like how entities have their own inputs, entities also have their own functions that could be "fired" in VScript.
For this tutorial, we'll create a simple script which sets the player's health to the health of a NPC with the name "wyatt". In the I/O system, it would be difficult to get the health of an entity. You may have to use `logic_keyfield` or `logic_datadesc_accessor` *(both are Mapbase entities)* to get the entity's health. In VScript, this is much easier.
For this tutorial, we'll create a simple script which sets the player's health to the health of a NPC named "wyatt". In the I/O system, it would be difficult to get the health of an entity. You may have to use `logic_keyfield` or `logic_datadesc_accessor` *(both are Mapbase entities)* to get the entity's health. In VScript, this is much easier.
---