scripting:snippets
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
scripting:snippets [2022/08/11 13:29] – jerryhopper | scripting:snippets [2022/08/11 13:58] (current) – jerryhopper | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Snippets ====== | ====== Snippets ====== | ||
- | |||
- | |||
- | ===== Basics : Get a Entity ===== | ||
- | |||
- | |||
- | One of the most used commands is probably ' | ||
- | |||
- | Notice the variable name ' | ||
- | |||
- | | ||
- | |||
- | **Example1**: | ||
- | |||
- | GenericEntity btr = GenericEntity.Cast(GetWorld().FindEntityByName(" | ||
- | |||
- | |||
- | **Lets break down this line.** | ||
- | |||
- | This is where we declare our variablename and type, where the name is ' | ||
- | |||
- | GenericEntity btr = | ||
- | |||
- | |||
- | So, the variable ' | ||
- | |||
- | When we break it down you'll notice these 2 commands. | ||
- | | ||
- | GetWorld().FindEntityByName(" | ||
- | | ||
- | GenericEntity.Cast() | ||
- | |||
- | Lets not get too technical, but what you need to know is that we search for the entity ' | ||
- | |||
- | GenericEntity.Cast(GetWorld().FindEntityByName(" | ||
- | |||
- | What does that mean? - it means that the result of your FindEntityByName is ' | ||
- | |||
- | |||
- | So, the result of the above is that we have a variable with the name ' | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | **Example2**: | ||
- | |||
- | GenericEntity soldier = GenericEntity.Cast(GetWorld().FindEntityByName(" | ||
- | | ||
- | | ||
< | < | ||
Line 77: | Line 28: | ||
soldier_c.SetFireWeaponWanted(1) | soldier_c.SetFireWeaponWanted(1) | ||
</ | </ | ||
+ |
scripting/snippets.1660220982.txt.gz · Last modified: 2022/08/11 13:29 by jerryhopper