User Tools

Site Tools


scripting:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
scripting:start [2022/08/10 22:59] – [Snippets] jerryhopperscripting:start [2022/08/25 15:14] (current) – [Enumerations] jerryhopper
Line 1: Line 1:
 ====== Scripting ====== ====== Scripting ======
  
-New to scripting?  read about [[scripting:Datatypes]]+New to scripting?  read about [[scripting:Datatypes]] or check the step-by-step [[scripting:basics]]
  
-Or read about the most common functions and basic [[scripting:knowledge|scripting knowledge]]+We'll keep the most common functions an knowledge in [[scripting:knowledge|scripting knowledge]] section.
  
  
 ===== Snippets ===== ===== Snippets =====
  
 +[[snippets]]
 +===== Global functions =====
  
-<code>+[[scripting:PlayCameraAnimation();]]
  
 +[[AttachCameraToEntity()]]
  
-//Get the entity (soldier) +[[scripting:GetWorld()]]
-GenericEntity soldier = GenericEntity.Cast(GetWorld().FindEntityByName("soldier_scripted"));+
  
 +===== Enumerations =====
  
-//Control the Soldier. 
-CharacterControllerComponent soldier_c = CharacterControllerComponent.Cast(soldier.FindComponent(CharacterControllerComponent)); 
  
-// change stance +[[scripting:ECharacterStance]]
-soldier_c.SetStanceChange(ECharacterStanceChange.STANCECHANGE_TOCROUCH);+
  
-// move soldier +[[scripting:ECharacterStanceChange]]
-vector direction = {0,0,1}; +
-soldier_c.SetMovement(2, direction);+
  
 +[[scripting:ERestResult]]
  
-// shoot phase 1 +===== Classes =====
-soldier_c.SetWeaponRaised(true); +
-soldier_c.SetSafety(false, true);+
  
-// shoot phase 2 +[[scripting:GenericEntity]]
-soldier_c.SetFireMode(2); +
-soldier_c.SetFireWeaponWanted(1) +
-</code> +
-===== Global functions =====+
  
-[[scripting:PlayCameraAnimation();]]+[[scripting:BaseWorld]]
  
-[[AttachCameraToEntity()]]+==== restAPI ====
  
-[[scripting:GetWorld()]] 
-===== Classes ===== 
  
-[[scripting:GenericEntity]] +[[scripting:RestApi]]
- +
-[[scripting:BaseWorld]]+
  
 +[[scripting:RestContext]]
  
 +[[scripting:RestCallback]]
 ===== Components ===== ===== Components =====
  
scripting/start.1660168788.txt.gz · Last modified: 2022/08/10 22:59 by jerryhopper

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki