User Tools

Site Tools


hpl1:documentation:script_reference

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
hpl1:documentation:script_reference [2012/08/29 14:43]
ganjalf TeleportPlayer(ToArea) doestn works, i deletet ToArea and it works.
hpl1:documentation:script_reference [2018/05/06 17:05]
abion47 [Physics]
Line 213: Line 213:
 ==== Audio ==== ==== Audio ====
  
- +<code c++> 
-<code c++>void CreateSoundEntity(std::​string asName, std::string asFile, std::string asArea)+void CreateSoundEntity(std::​string asName, std::string asFile, std::string asArea)
 </​code>​ </​code>​
  
 +Creates a sound entity at the postion of an area.\\
 +asName Name of the created sound entity.\\
 +asFile The snt file to load.\\
 +asArea The area to create at.
  
-Creates a sound entity at the postion of an area.\\  +<code c++> 
-asName Name of the created sound entity.\\  +void CreateSoundEntityAt(std::​string asType,​std::​string asDestName,
-asFile The snt file to load.\\  +
-asArea The area to create at.\\  +
-<code c++>void CreateSoundEntityAt(std::​string asType,​std::​string asDestName, ​+
                    ​std::​string asSoundName,​std::​string asSoundFile);​                    ​std::​string asSoundName,​std::​string asSoundFile);​
 </​code>​ </​code>​
  
 +Creates a sound entity at the position of an entity.\\
 +asType The type of entity. This can be: "​Joint","​Body"​ or "​Entity"​.\\
 +asDestName The entity/​body/​joint name\\
 +asSoundName The name of created sound entity.\\
 +asSoundFile The name of the snt file.
  
-Creates a sound entity at the position of an entity.\\  +<code c++> 
-asType The type of entity. This can be: "​Joint","​Body"​ or "​Entity"​.\\  +void PlaySoundEntity(std::​string asName, bool abPlayStart)
-asDestName The entity/​body/​joint name\\  +
-asSoundName The name of created sound entity.\\  +
-asSoundFile The name of the snt file.\\  +
-<code c++>void PlaySoundEntity(std::​string asName, bool abPlayStart)+
 </​code>​ </​code>​
  
 +Play a sound entity\\
 +asName The entity name\\
 +abPlayStart If the start sound should be played.
  
-Play a sound entity\\  +<code c++> 
-asName The entity name\\  +void StopSoundEntity(std::​string asName, bool abPlayEnd)
-abPlayStart If the start sound should be played.\\  +
-<code c++>void StopSoundEntity(std::​string asName, bool abPlayEnd)+
 </​code>​ </​code>​
  
 +Stop a sound entity\\
 +asName The entity name\\
 +abPlayEnd If the end sound should be played.
  
-Stop a sound entity\\  +<code c++> 
-asName The entity name\\  +void FadeInSoundEntity(std::​string asName, float afSpeed)
-abPlayEnd If the end sound should be played.\\  +
-<code c++>void FadeInSoundEntity(std::​string asName, float afSpeed)+
 </​code>​ </​code>​
  
 +Play a sound entity fading it\\
 +asName The entity name\\
 +afSpeed Volume increase per second.
  
-Play a sound entity fading it\\  +<code c++> 
-asName The entity name\\  +void FadeOutSoundEntity(std::​string asName, float afSpeed)
-afSpeed Volume increase per second.\\  +
-<code c++>void FadeOutSoundEntity(std::​string asName, float afSpeed)+
 </​code>​ </​code>​
  
 +Stop a sound entity fading it\\
 +asName The entity name\\
 +afSpeed Volume decrease per second.
  
-Stop a sound entity fading it\\  +<code c++> 
-asName The entity name\\  +void PlayMusic(std::​string asName, float afVol, float afStepSize, bool abLoop)
-afSpeed Volume decrease per second.\\  +
-<code c++>void PlayMusic(std::​string asName, float afVol, float afStepSize, bool abLoop)+
 </​code>​ </​code>​
  
 +Play music track.\\
 +asName Name of the music file.\\
 +afVol Volume of the music\\
 +afStepSize The increase in volume per second when fading in.
  
-Play music track.\\  +<code c++> 
-asName Name of the music file.\\  +void StopMusic(float afStepSize)
-afVol Volume of the music\\  +
-afStepSize The increase in volume per second when fading in.\\  +
-<code c++>void StopMusic(float afStepSize)+
 </​code>​ </​code>​
  
 +Stop music track.\\
 +afStepSize The decrease in volume per second when fading out.
  
-Stop music track.\\ ​ 
-afStepSize The decrease in volume per second when fading out.\\ ​ 
 <code c++> <code c++>
 PlayGameMusic(string asFile, float afVolume,​float afFadeStep,​bool abLoop, int alPrio); PlayGameMusic(string asFile, float afVolume,​float afFadeStep,​bool abLoop, int alPrio);
 </​code>​ </​code>​
  
 +Play music track with prio, added to episode 1 to be able to play different tracks that mix in and out depending on prio.\\
 +asFile The name of the music file.\\
 +afVolume The volume to play the music at 0 to 1.\\
 +afFadeStep The decrease in volume per second when fading out.\\
 +abLoop If the music should loop.\\
 +alPrio The priority of the track, 0 to 10. A higher numbers fades a lower number out, if you have an ambient music track using prio 0 it will fade out if you add a music track to an enemy entity with prio 1 and the enemy attacks the player. When the attack is over the ambient track will fade back in.
  
-Play music track with prio, added to episode 1 to be able to play different tracks that mix in and out depending on prio.\\ ​ 
-asFile The name of the music file.\\ ​ 
-afVolume The volume to play the music at 0 to 1.\\  
-afFadeStep The decrease in volume per second when fading out.\\ ​ 
-abLoop If the music should loop.\\ ​ 
-alPrio The priority of the track, 0 to 10. A higher numbers fades a lower number out, if you have an ambient music track using prio 0 it will fade out if you add a music track to an enemy entity with prio 1 and the enemy attacks the player. When the attack is over the ambient track will fade back in.\\  
 <code c++> <code c++>
 StopGameMusic(float afFadeStep, int alPrio); StopGameMusic(float afFadeStep, int alPrio);
 </​code>​ </​code>​
  
 +Stop game music track with prio.\\
 +afFadeStepThe decrease in volume per second when fading out.\\
 +alPrio priority of the music track.
  
-Stop game music track with prio.\\  +<code c++> 
-afFadeStepThe decrease in volume per second when fading out.\\  +void PlayGuiSound(std::​string asName, float afVol)
-alPrio priority of the music track.\\  +
-<code c++>void PlayGuiSound(std::​string asName, float afVol)+
 </​code>​ </​code>​
  
 +Play a sound gui sound, with out any position.\\
 +asName The sound name\\
 +afVol Volume of the sound\\
  
-Play a sound gui sound, with out any position.\\ ​ 
-asName The sound name\\ ​ 
-afVol Volume of the sound\\ ​ 
-\\  
 ==== Physics ==== ==== Physics ====
  
Line 312: Line 319:
 asJointName The joint name\\ ​ asJointName The joint name\\ ​
 asType The type, can be: "​OnMax"​ or "​OnMin"​.\\ ​ asType The type, can be: "​OnMax"​ or "​OnMin"​.\\ ​
-asFunc The script function to be called. Must be in the current script file. _fckg_QUOT__fckg_QUOT_ = disabled.\\ ​+asFunc The script function to be called. Must be in the current script file. %%_fckg_QUOT__fckg_QUOT_ = disabled.%%\\ 
 \\  \\ 
 ''​void BreakJoint(std::​string asJointName)'' ​ ''​void BreakJoint(std::​string asJointName)'' ​
Line 393: Line 400:
 \\  \\ 
 \\  \\ 
-==== Local Variables ==== ''​void CreateLocalVar(std::​string asName, int alVal)'' ​+ 
 +==== Local Variables ====  
 + 
 +''​void CreateLocalVar(std::​string asName, int alVal)'' ​
 ''​void SetLocalVar(std::​string asName, int alVal)'' ​ ''​void SetLocalVar(std::​string asName, int alVal)'' ​
 ''​void AddLocalVar(std::​string asName, int alVal)'' ​ ''​void AddLocalVar(std::​string asName, int alVal)'' ​
Line 399: Line 409:
 \\  \\ 
 \\  \\ 
-==== Global Variables ==== ''​void ​ CreateGlobalVar(std::​string asName, int alVal)'' ​+ 
 +==== Global Variables ====  
 + 
 +''​void ​ CreateGlobalVar(std::​string asName, int alVal)'' ​
 ''​void SetGlobalVar(std::​string asName, int alVal)'' ​ ''​void SetGlobalVar(std::​string asName, int alVal)'' ​
 ''​void AddGlobalVar(std::​string asName, int alVal)'' ​ ''​void AddGlobalVar(std::​string asName, int alVal)'' ​
Line 406: Line 419:
 \\  \\ 
 \\  \\ 
-===== Game scripts =====   ==== General ==== ''​void ResetGame();'' ​+ 
 +===== Game scripts =====    
 + 
 +==== General ====  
 + 
 +''​void ResetGame();'' ​
 Resets the game and returns to main menu\\ ​ Resets the game and returns to main menu\\ ​
 \\  \\ 
Line 447: Line 465:
 abX enable or disabled the function.\\ ​ abX enable or disabled the function.\\ ​
 \\  \\ 
-''​void AddRadioMessage( std::​string asTransCat,​std::​string asTransName, ​  std::string asSound);'' ​+''​void AddRadioMessage( std::​string asTransCat,​std::​string asTransName,​ std::string asSound);'' ​
 Plays an audio file and displays subtitles for it.\\  Plays an audio file and displays subtitles for it.\\ 
 asTransCat the Category in the translations file\\ ​ asTransCat the Category in the translations file\\ ​
Line 566: Line 584:
 \\  \\ 
 \\  \\ 
-==== Attacks ==== ''​void CreateSplashDamage(std::​string asAreaName, float afRadius, float afMinDamage,​ float afMaxDamge, ​  float afMinForce, float afMaxForce, float afMaxImpulse,​ int alStrength);'' ​+ 
 +==== Attacks ====  
 + 
 +''​void CreateSplashDamage(std::​string asAreaName, float afRadius, float afMinDamage,​ float afMaxDamge, ​  float afMinForce, float afMaxForce, float afMaxImpulse,​ int alStrength);'' ​
 Creates a ball shaped splash damage at the center of an area.\\ ​ Creates a ball shaped splash damage at the center of an area.\\ ​
 asAreaName Name of the area.\\ ​ asAreaName Name of the area.\\ ​
Line 595: Line 616:
 \\  \\ 
 \\  \\ 
-==== Game Timer ==== ''​void CreateTimer(std::​string asName, float afTime, std::string asCallback, bool abGlobal);'' ​+ 
 +==== Game Timer ====  
 + 
 +''​void CreateTimer(std::​string asName, float afTime, std::string asCallback, bool abGlobal);'' ​
 Creates a new timer which calls a callback function when the time is out.\\ ​ Creates a new timer which calls a callback function when the time is out.\\ ​
 Syntax: **MyCallback(string asTimerName)**,​ the prefix "​@"​ (ie "​@Func()"​) shows that the function is in the global script\\ ​ Syntax: **MyCallback(string asTimerName)**,​ the prefix "​@"​ (ie "​@Func()"​) shows that the function is in the global script\\ ​
Line 610: Line 634:
 \\  \\ 
 \\  \\ 
-==== Player ==== ''​static void GivePlayerDamage(float afAmount, ​ std::string asType);'' ​+ 
 +==== Player ==== 
 + 
 + ''​static void GivePlayerDamage(float afAmount, ​ std::string asType);'' ​
 Gives the player a hit + damage\\ ​ Gives the player a hit + damage\\ ​
 afAmount The amount of health taken.\\ ​ afAmount The amount of health taken.\\ ​
Line 662: Line 689:
 \\  \\ 
 \\  \\ 
-==== Inventory ==== ''​void AddPickupCallback(std::​string asItem, std::string asFunction);'' ​+ 
 +==== Inventory ====  
 + 
 +''​void AddPickupCallback(std::​string asItem, std::string asFunction);'' ​
 Add a callback that is called when the player picks up an item.\\ ​ Add a callback that is called when the player picks up an item.\\ ​
 The syntax for the callback function is:\\  The syntax for the callback function is:\\ 
Line 714: Line 744:
 asTransName The name of the entry in the lang file.\\ ​ asTransName The name of the entry in the lang file.\\ ​
 \\  \\ 
-\\  +\\ 
-==== Map / Level Properties ==== ''​SetAmbientColor(float r, float g, float b);'' ​+  
 +==== Map / Level Properties ====  
 + 
 +''​SetAmbientColor(float r, float g, float b);'' ​
 Sets the ambient color of the level, this should always be part of a level as it gives it a bit of light otherwise shadows will be pitch black.\\ ​ Sets the ambient color of the level, this should always be part of a level as it gives it a bit of light otherwise shadows will be pitch black.\\ ​
 \\  \\ 
Line 770: Line 803:
 \\  \\ 
 \\  \\ 
-==== Game Entity Properties ==== ''​void SetGameEntityActive(std::​string asName, bool abX);'' ​+ 
 +==== Game Entity Properties ====  
 + 
 +''​void SetGameEntityActive(std::​string asName, bool abX);'' ​
 Set if a game entity is active.\\ ​ Set if a game entity is active.\\ ​
 asName The name of the game entity\\ ​ asName The name of the game entity\\ ​
Line 1071: Line 1107:
 \\  \\ 
 \\  \\ 
-==== Game Entity Callbacks ==== ''​void AddEntityCollideCallback(std::​string asType, std::string asDestName, ​  ​std::​string asEntityName,​ std::string asFuncName);'' ​+ 
 +==== Game Entity Callbacks ====  
 + 
 +''​void AddEntityCollideCallback(std::​string asType, std::string asDestName, ​  ​std::​string asEntityName,​ std::string asFuncName);'' ​
 Add a collide callback to an entity.\\ ​ Add a collide callback to an entity.\\ ​
 The syntax for the callback function is:\\  The syntax for the callback function is:\\ 
hpl1/documentation/script_reference.txt · Last modified: 2020/02/08 21:19 by muffin