User Tools

Site Tools


scripting:snippets

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:snippets [2022/08/11 13:13] jerryhopperscripting:snippets [2022/08/11 13:58] (current) jerryhopper
Line 1: Line 1:
 ====== Snippets ====== ====== Snippets ======
- 
- 
- 
-Get a Entity 
- 
-One of the most used commands is probably 'FindEntityByName'. Whevever you want to script something in the game, you should find its entity.  This is simply done by the below line. 
- 
-Notice the variable name 'soldier' and the entityname 'soldier_scripted' - You have to change these variables to reflect your entity ingame. 
- 
-**Example1**: get the entity of a soldier with the name 'soldier_scripted' 
- 
-  GenericEntity soldier = GenericEntity.Cast(GetWorld().FindEntityByName("soldier_scripted")); 
-   
-  
-**Example1**: get the entity of a vehicle with the name 'BTR1' 
- 
-  GenericEntity btr = GenericEntity.Cast(GetWorld().FindEntityByName("BTR1")); 
- 
- 
- 
- 
- 
  
  
Line 50: Line 28:
 soldier_c.SetFireWeaponWanted(1) soldier_c.SetFireWeaponWanted(1)
 </code> </code>
 +
scripting/snippets.1660220015.txt.gz · Last modified: 2022/08/11 13:13 by jerryhopper

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki