Difference between revisions of "HPL3/Scripting/Scripting Guide/Working with Classes"

From Frictional Wiki
Jump to navigation Jump to search
(Created page with "{{Hpl3ScriptingGuideMenuBasic}} {{shortPageTitle}} {{NavBar|HPL3/Scripting/Scripting_Guide/Enums|Enums|HPL3/Scripting/HPL3 Scripting Guide|HPL3 Scripting Guide|HPL3/Scripting...")
 
Line 1: Line 1:
 
{{Hpl3ScriptingGuideMenuBasic}}
 
{{Hpl3ScriptingGuideMenuBasic}}
 
{{shortPageTitle}}
 
{{shortPageTitle}}
 +
{| style="border:0px;" cellspacing="0"
 +
|- valign="top"
 +
| style="padding-right:0.2em" |
 +
Classes in HPL3 are generally used to perform thins that 
 +
 +
== Uses in HPL3 ==
 +
{{tip|As a general rule of thumb: '''Use HPL3 classes only when you cannot find in the helper files what you are looking for. They merely offer some extended functionality which may not be found in the helper files.'''}}
 +
 +
<syntaxhighlight lang="c++">
 +
void MoveEntityPosition()
 +
{
 +
// Create a 3D Vector and save the position data into it
 +
    // X: 55, Y: 5, Z: 25
 +
cVector3f positionData = cVector3f(55, 5, 25);
 +
 +
iLuxEntity@ entity = Map_GetEntity("MyEntity"); // Get the iLuxEntity object of our entity in the map
 +
entity.SetPosition(positionData); // Set the new position of the entity
 +
}
 +
</syntaxhighlight>
 +
| style="width:0.1%" |
 +
|}
 +
Every technical feature in HPL3 has a corresponding class to it (Lights, Billboards, Materials, GUI, etc), which makes scripting in HPL3 very flexible and allows you do modify anything through script.
 +
== See Also ==
 +
* [[HPL3/Scripting/AngelScript_Fundamentals/Chapter_8_-_Classes| Classes - AngelScript]]
  
 
{{NavBar|HPL3/Scripting/Scripting_Guide/Enums|Enums|HPL3/Scripting/HPL3 Scripting Guide|HPL3 Scripting Guide|HPL3/Scripting/Scripting_Guide/Conclusion_-_Basic|Conclusion}}
 
{{NavBar|HPL3/Scripting/Scripting_Guide/Enums|Enums|HPL3/Scripting/HPL3 Scripting Guide|HPL3 Scripting Guide|HPL3/Scripting/Scripting_Guide/Conclusion_-_Basic|Conclusion}}

Revision as of 17:54, 16 August 2020

Classes in HPL3 are generally used to perform thins that

Uses in HPL3

Icon tip.png Tip: As a general rule of thumb: Use HPL3 classes only when you cannot find in the helper files what you are looking for. They merely offer some extended functionality which may not be found in the helper files.
void MoveEntityPosition()
{
	// Create a 3D Vector and save the position data into it
    // X: 55, Y: 5, Z: 25
	cVector3f positionData = cVector3f(55, 5, 25);
		
	iLuxEntity@ entity = Map_GetEntity("MyEntity"); // Get the iLuxEntity object of our entity in the map
	entity.SetPosition(positionData); // Set the new position of the entity
}

Every technical feature in HPL3 has a corresponding class to it (Lights, Billboards, Materials, GUI, etc), which makes scripting in HPL3 very flexible and allows you do modify anything through script.

See Also


Enums