scripting:basics
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
scripting:basics [2022/08/11 13:58] – [Example 2: a Character] jerryhopper | scripting:basics [2022/08/11 14:32] (current) – jerryhopper | ||
---|---|---|---|
Line 24: | Line 24: | ||
**Lets break down this line.** | **Lets break down this line.** | ||
- | This is where we declare our variablename and type, where the name is ' | + | This is where we declare our variablename and type, where the name is ' |
+ | In Enfusion, variables has to be declared of which type they should be. Its fairly self-explanatory if you look at the line below. | ||
GenericEntity btr = | GenericEntity btr = | ||
Line 44: | Line 45: | ||
- | So, the result of the above is that we have a variable with the name ' | + | So, the result of the above is that we have a variable with the name '**btr**' which '**type**' is '**GenericEntity**' |
Line 66: | Line 67: | ||
- | ===== Get a CharacterEntity, | ||
+ | ---- | ||
+ | |||
+ | |||
+ | ===== Control a CharacterEntity ===== | ||
+ | |||
+ | |||
+ | Lets continu from Example #2. We now have an entity, and its time we control it. | ||
+ | |||
+ | ==== Change stance ==== | ||
- | Lets continu from Example #2. | ||
If we want to change the stance of the soldier, we can do so via this CharacterController. | If we want to change the stance of the soldier, we can do so via this CharacterController. | ||
Line 82: | Line 90: | ||
* STANCECHANGE_TOPRONE | * STANCECHANGE_TOPRONE | ||
+ | |||
+ | Notice that these are ' | ||
Great! | Great! | ||
+ | |||
+ | ==== Move ==== | ||
+ | |||
+ | Now lets try make the character move. To move a character, we need to know what speed and direction you want to move. We will use a variable which we declare as a ' | ||
+ | |||
+ | |||
+ | vector direction = {0,0,1}; | ||
+ | |||
+ | The ' | ||
+ | |||
+ | soldier_c.SetMovement(2, | ||
+ | | ||
+ | That should do the trick. Your character should be moving in the given direction. |
scripting/basics.1660222685.txt.gz · Last modified: 2022/08/11 13:58 by jerryhopper