54 float Float(
string s);
152 s=
"0.0,1.0,10.0,5.0";
167 vec3
Vec3(
float x,
float y,
float z);
179 vec4
Vec4(
float x,
float y,
float z,
float w);
223 void CreateWidget(
string class,
string script,
string params,
string pos);
257 void CreateHUDWidget(
string class,
string script,
string params,
string pos);
296 ResetSubWidgetFlags(
"button01",
"w_grayed");
315 SetSubWidgetFlags(
"button01",
"w_grayed");
501 PhysicsCreateVehicle(
"carBody",
"wheel01,wheel02",
"wheel03,wheel04",
"200,11000,5000,7,0.05,10,-95");
504 void PhysicsCreateVehicle(
string vehicleBody,
string frontWheels,
string backWheels,
string props);
981 float Abs(
float scalar);
992 float Min(
float a,
float b);
1003 float Max(
float a,
float b);
1019 LOG(
"num="+
string(num));
1026 float Clamp(
float scalar,
float min,
float max);
1068 float Cos(
float angle);
1082 float Rand(
int res);
1121 RayPick(p0,p1-p0,1.0);
1125 pickObj=GetPickObject();
1140 float Sin(
float angle);
1253 void PlayMusic(
string music,
int channel);
1267 void PlaySound(
string sound,
bool loop);
1296 void SetSource(
float gain,
float range);
1393 void AICreateCharacter(
float radius,
float height,
string maxLinear,
string maxAngular);
1408 void AICreateObject(
bool isObstacle,
bool isOccluder,
float radius,
float height);
1957 void LOG(
string str);
2081 string Load(
string path);
2121 LoadResource(
"S2EngineHD/Texture/Pippo/prova.tga",
"level");
2145 void Save(
string text,
string path);
2425 void SetParam(
string param,
string value);
2448 void ActiveObject(
string objname, vec3 pos, vec3 angles);
2461 void AttachObject(
string obj,
string node, vec3 pos, vec3 angles);
2472 void SpawnObject(
string prefabFilename, vec3 pos, vec3 angles);
2517 string GetObjectParam(
string objname,
string paramname,
bool isStock);
2530 string SetObjectParam(
string objname,
string paramname,
string paramvalue);
2651 void SendMessageBroad(
string dest,
string name,
string content,
float delay);
2676 void SendMessageMulti(
string name,
string content,
float range,
string class);
2677 void SendMessageMulti(
string name,
string content,
float range,
float delay);
int AddAnimationChannel()
This function Adds an animation channel to the animation channel list of an entity.
void CrossFadeMusic(string music, int channel)
This function play a music on a given channel by fading in it and fading out all mucis playing on the...
bool AIObjectIsHeard(string obj)
This function returns true if an object is heard by this object.
vec3 GetObjectWorldPos(string objname)
This function returns the worldspace position of an object.
void PhysicsCreateCharacter()
This function creates a character into the physics subsystem and associates it to this object...
string AIGetNearestHeardObject()
This function returns the name of the nearest object heard by this object.
vec4 Vec4(float x, float y, float z, float w)
This function returns a 4d vector given 4 float numbers as input. It is useful to build a vec4 from 4...
float Cos(float angle)
This function returns the cosine value of a given angle. The angle value is expressed in degrees...
void PhysicsApplyForce(vec3 point, vec3 dir, float len)
This function applies a force to this object if it has a physics object associated.
void PhysicsVehicleControl(float steerAngle, float acc, bool handbrake)
This function moves this object if it is associated with a physics vehicle.
float Float(string s)
This function convert an integer, or a string value into a float value.
vec3 GetAxis(string axis)
This function returns one of the 3 axis of THIS object (object owning the script) orthonormal basis i...
void SetParam(string param, string value)
This function sets the value of a specified param of this object if this is an object script or this ...
void SetObjectFlags(string objname, string flags)
This function sets to TRUE all input flags of an object.
string GetObjectParam(string objname, string paramname, bool isStock)
This function returns the value of the parameter of an object as string. Every object has its own par...
vec3 WorldToScreen(vec3 p)
This function transforms a point from world coordinates space to screen coordinates space...
string GetSubWidgetParam(string widget, string param)
This function returns a param value of child widget of this widget, if it exists. ...
void SetSubWidgetOpacity(string widget, float opacity)
This function sets the opacity level of the tree starting from the child widget of this widget...
void SetSubWidgetFlag(string sw, string flags)
This function sets (to true) the flags of a widget that is a child of this one.
float Clamp(float scalar, float min, float max)
This function returns the clamped value of an input float number between a nim and a max value...
void SendMessageSingle(string dest, string name, string content)
This function send a message to a single active object given its name.
void AnimationChannelFadeOut(int channel, float time)
This function starts the 'fade Out' transition of an animation channel.
float Max(float a, float b)
This function returns the maximum value between two given float values.
void AISetTargetToFacePos(vec3 target)
This function sets the target point that AI character must to face using Steering behaviors...
bool ReceivedMessage(string msg)
This is a special function that has effect only inside the Message() main function. It returns true if the message msg has been received.
vec3 AIGetNearestTacticalPatrolPoint(vec3 target, float range, int ID)
This function returns the nearest point from a given point( also called the target point) in which th...
void ResetSubWidgetFlag(string sw, string flags)
This function resets( sets to false) the flags of a widget that is a child of this one...
float Min(float a, float b)
This function returns the minimum value between two given float values.
void PhysicsCreateRagdoll()
This function creates a Ragdoll basing on this object model format.
float VectorLen(vec3 v)
This function returns the Length of a 3d vector.
void SendMessageGUI(string name, string content)
This function sends a message to the main widget of the GUI.
vec3 GetObjectWorldAxis(string objname, string axis)
This function returns one of the 3 axis of object orthonormal basis in worldspace.
void PhysicsCharacterMove(vec3 dir, float disp)
This function moves this object if it is associated with a physics character. By default, gravity is applied on the characters movement. You can use PhysicsSetCharacterGravity function to enable/disable the gravity applied on the characters.
vec3 AIGetNearestAllowedPoint(vec3 target, float range)
This function returns the nearest point (nearest to a given 'target point') toward which the characte...
void SetAnimationChannelSpeed(int channel, float speed)
This function sets the overall speed of an animation channel.
void AttachObject(string obj, string node, vec3 pos, vec3 angles)
This function activates a stock object and puts it into this object hierarchy (the attached object wi...
void PhysicsCreateBody(string coltype, float mass, vec3 props)
This function creates a physics rigid body and associates it to 'this object'.
bool GetObjectFlag(string objname, string flag)
This function returns the value (TRUE or FALSE) of an object flag.
void SetEngineParam(string param, string value)
This function sets the value of a specified param of the engine and its subsystems: Render...
string GetLevelParam(string param)
This function returns the value of a specified param of the current scene.
void AISetCharacterMaxAngular(float acc, float speed)
This function sets the maximum angular accelleration and maximum angular velocity of this object if i...
vec3 VectorInterpolate(vec3 s1, vec3 s2, float t)
This function returns the result of the linear interpolation between two input 3d Vectors...
string GetEngineParam(string param)
This function returns the value of a specified param of the engine and its subsystems: render...
vec3 NormalizeV(vec3 v)
This function returns a normalized 3d vector.
void SetSubWidgetParam(string widget, string param, string value)
This function assigns a value to a param of child widget of this widget, if it exists.
bool AIPointIsInsideWaypointArea(vec3 point)
This function returns true if a give point is inside a WaypointArea.
void AIEnableVision(bool enable, string eyeNode, float range)
This function makes AI subsystem enable Vision feature for this object AI.
void SetSourceVolume(float volume)
This function sets the sound source volume.
void LoadResource(string resPath, string cache)
This function loads a resource given its filename.
void SetAnimationBlendX(int channel, string animName, float value)
This function assigns a blend float value to a blended animation in X direction.
void PhysicsObjectWakeUp()
This functions sets the state of the body associated with this object to wake up. ...
void ShowSubWidget(string widget, bool show)
This function shows/hides a child of this widget given its name.
void PhysicsApplyForceToNode(string node, vec3 point, vec3 dir, float len)
This function applies a force to a node of this object. This function has effect only if the object n...
bool PhysicsNodeCollisionTest(string obj, string node, float radius, vec3 disp)
This function executes the Sweep test of an object node using a capsule builded from the node and the...
void PlayMusic(string music, int channel)
This function play a music on a given channel.
vec3 ScreenToWorld(vec3 p)
This function transforms a point from screen coordinates space to world coordinates space...
bool IsAnimationStopped(int channel)
This function returns true if the specified animation channel isn't playing. Otherwise it returns fal...
void SetTimeScale(float timeMul)
This function sets the simulation time speed multiplier.
string GetObjectScriptParam(string objname, string paramname, bool isStock)
This function returns the value of the parameter of the object script as string.
void SetSourcePitch(float pitch)
This function sets the sound source pitch.
string GetPressedKey(int mode)
This function returns the pressed key, if there is one. Otherwise it returns null. There are 3 ways in which the keyboard key pression can be detected:
float Rand(int res)
This function returns a float random number between 0.0 and 1.0 given the number of all possible choi...
void SendMessageHUD(string name, string content)
This function sends a message to the main widget of the HUD.
void BlendAnimationChannel(int channel, float weight)
This function sets the blend weight value of an animation channel given its ID number.
void PhysicsCharacterToRagdoll()
This function stops all animation channels, wakeUp the ragdoll associated with This Object...
void PhysicsApplyForceToRagdoll(vec3 point, vec3 dir, float len)
This function applies a force to an object if it has a physics object associated. The object is ident...
void StopSound()
This function stops a sound playing on this object source.
void SetWidgetOpacity(float opacity)
This function sets the opacity level of the tree starting from this widget.
int GetNumAudioDevice()
This function returns the number of audio devices supported by the hardware system.
bool Bool(float f)
This function convert an integer, a float, or a string value into a boolean value.
void PhysicsSetCharacterGravity(float gravity)
This function sets the amount of the gravity applied on the physics character associated with this ob...
vec3 String2Vec3(string s)
This function convert a string into a 3d vector.
bool GetSubWidgetFlag(string sw, string flag)
This function returns the flag value (true or false) of a widget that is a child of this one...
void Exit()
This function shutdown the engine and exit from the application.
void PhysicsApplyForceToObject(string obj, vec3 point, vec3 dir, float len)
This function applies a force to an object if it has a physics object associated. The object is ident...
void AnimationChannelFadeIn(int channel, float time)
This function starts the 'fade in' transition of an animation channel.
void PlaySound(string sound, bool loop)
This function plays a sound given its filename.
void PhysicsApplyGravity(bool apply)
This function sets to true/false the gravity application on the physics object associated to this obj...
void AICreateObject(bool isObstacle, bool isOccluder, float radius, float height)
This function creates an object for the AI subsystem.
void ShowWidget(bool show)
This function shows/hides this widget.
void SetLevelParam(string param, string value)
This function sets the value of a specified param of the current scene.
void Save(string text, string path)
This function saves a string into a text file.
void CreateWidget(string class, string script, string params, string pos)
This function creates a GUI element (Widget). A widget can be a button, label, a dialog, a frame, etc.
string Load(string path)
This function loads a text file and returns its content as a string.
void AICreateCharacter(float radius, float height, string maxLinear, string maxAngular)
This function creates a character for the AI subsystem.
void PhysicsSetCharacterDims(vec3 dims)
This function sets the dimensions of the capsule of a physics character associated to this object...
vec3 AIGetFurthestCoverPoint(vec3 opponent, vec3 target, float range)
This function returns the furthest point from a given point( also called the target point) in which t...
void ResetObjectFlags(string objname, string flags)
This function sets to FALSE all input flags of an object.
void PhysicsObjectSleep()
This functions sets the state of the body associated with this object to sleeping.
bool PhysicsGetCollideFlag()
This function returns true if the physics object associated with this object can collide, false otherwise.
string GetAudioDevice(int i)
This function returns a string containing the description of the AudioDevice at index i...
void AISetSteeringWeight(string steer, float weight)
This function sets the weight of a steering behavior. Steering behaviors are used for steering AI cha...
void AIEnableHearing(bool enable, float range)
This function makes AI subsystem enable Hearing feature for this object AI.
vec3 Vec3(float x, float y, float z)
This function returns a 3d vector given 3 float numbers as input. It is useful to build a vec3 from 3...
void SetSource(float gain, float range)
This function creates a sound source and assign it to this object.
void CreateHUDWidget(string class, string script, string params, string pos)
This function is equal to CreateWidget() function.
void PlayAnimation(int channel, bool loop)
This function plays all the animations of a channel.
void PlaySoundGlobal(string sound, bool loop)
This function plays a global sound given its filename.
string GetParam(string param)
This function returns the value of a specified param of this object if this is an object script or th...
bool IsKeyPressed(string key, int mode)
This function returns true if a keyboard key pressed. Otherwise it returns false. ...
vec3 AIGetNearestCoverPoint(vec3 opponent, vec3 target, float range)
This function returns the nearest point from a given point( also called the target point) in which th...
void PhysicsSetRagdollCollideFlag()
This function sets to true the collide flag of all the capsules of a ragdoll associated with this obj...
void SendMessageMulti(string name, string content, float range, string class)
This function send a message to more than one active object. The receiver objects are choosen basing ...
void PhysicsRagdollWakeUp()
This functions sets the state of a ragdoll associated with this object (i.e. the state the all the ra...
void ActiveObject(string objname, vec3 pos, vec3 angles)
This function activates a stock object. You have also to specify the position and orientation of the ...
vec3 GetObjectWorldAngles(string objname)
This function returns the orientation of an object in world space as euler angles. Angles are returned as a vec3 (yaw, pitch, roll).
float Sin(float angle)
This function returns the sine value of a given angle. The angle value is expressed in degrees...
int Int(string s)
This function convert a string value into an integer value.
void DestroySubWidget(string widget)
This function destroys a child widget of this widget, if it exists.
vec3 GetWorldAxis(string axis)
This function returns one of the 3 axis of THIS object (object owning the script) orthonormal basis i...
vec3 VectorRotate(vec3 v, float angle, vec3 axis)
This function rotates a 3d vector(also 3d point) given an angle of rotation and an axis of rotation...
vec3 GetMousePos()
This function returns a 3d vector containing the mouse position.
void StopAnimation(int channel)
This function stops an animation channel, i.e. it stops all the animations of the channel...
void PhysicsSetCollideFlag()
This function sets to true the collide flag of physics object associated with this object...
vec4 String2Vec4(string s)
This function convert a string into a 4d vector.
void EngineResume()
This function resumes the simulation (or game) previously paused.
bool LoadLevel(string level)
This function loads a game scene given its filename.
void PhysicsRagdollSleep()
This functions sets the state of a ragdoll associated with this object (i.e. the state the all the ra...
void EnginePause()
This function pauses the simulation or game.
bool PhysicsObjectIsSleeping()
This functions returns true if the state of physics object associated with this object is set to slee...
void FindPath(vec3 target)
This function computes an AI path from this object position to a given target point.
void SetAnimationChannelMask(int channel, string maskname)
This function assigns a mask to a given channel.
string PhysicsGetCollidedObject()
This function returns the name of the object collided in a previous sweep test.
void LOG(string str)
The function writes the input string into the S2Engine LOG file.
string String(float f)
This function convert an integer, a float, a boolean, a 3d vector or a 4d vector value into a string...
void BlendCurrentAnimation(string anim, float weight, int channel)
This function is the core of animation system, It assigns a channel to an animation and also sets ani...
float ScalarInterpolate(float s1, float s2, float t)
This function returns the result of the linear interpolation between two input float numbers...
vec3 GetMouseRelPos()
This function returns a 3d vector containing the mouse position relative to the previous frame...
float PhysicsGetVehicleRPM()
This function returns the rotation per minute (RPM) of the engine of physics vehicle associated to th...
vec3 CrossProduct(vec3 v1, vec3 v2)
This function returns the cross product between two given 3D vectors.
void SetSourceRange(float range)
This function sets the sound source range of influence.
void PauseAnimation(int channel)
This function pause an animation channel, i.e. it pauses all the animations of the channel...
void PhysicsCreateVehicle(string vehicleBody, string frontWheels, string backWheels, string props)
TThis function creates a vehicle into the physics subsystem and associates it to this object...
void SendMessageBroad(string dest, string name, string content)
This function send a message to all active objects.
void AISetCharacterMaxLinear(float acc, float speed)
This function sets the maximum linear accelleration and maximum linear velocity of this object if it ...
void PhysicsSetObjectPos(vec3 pos)
This function stes the position of this object if it is associated to a physics object.
vec3 VectorToAngles(vec3 v)
This function returns the orientation of a given 3d vector expressed as the float triple yaw...
void ShowCursor(bool show)
This function shows/hides the GUI cursor. It has effects only into the main GUI widget.
bool AIObjectIsViewed(string obj)
This function returns true if an object is viewed by this object.
bool PhysicsCharacterCollisionTest(string obj, vec3 start, vec3 end)
This function executes the Sweep test of an object using the capsule of a physics character associate...
void SetSubWidgetPos(string widget, float x, float y)
This function assigns a new position to the child widget of this widget.
vec3 PhysicsGetCollisionNormal()
This function returns the collision normal of the object collided in a previous sweep test...
bool GetInputAction(string name)
This function returns the value of an input action given its identifying name.
string SetObjectParam(string objname, string paramname, string paramvalue)
This function sets the value of the parameter of an object given as string.
float Abs(float scalar)
This function returns the Absolute value of a given float number.
void AnimationCrossFade(int channel, string animName, float time)
This function executes a cross fade between a given animation and all others.
void AddAnimationToChannel(int channel, string animName)
This function Adds an animation to a pre-added animation channel of an entity.
void RestartLevel()
This function restores the starting state of the game scene without close/reload it.
bool PhysicsCollisionTest(float radius, vec3 start, vec3 end)
This function executes the Collision(Sweep) Test test of a sphere. The sweep test is made by extrudin...
void CloseLevel()
This function closes an entire game scene.
void CreateHUD(string script)
This function creates the HUD main widget. Using CreateHUDWidget() function you can attach new widget...
void AISetTargetToReachPos(vec3 target)
This function sets the target point that AI character must to reach using Steering behaviors...
void StopSoundGlobal()
This function stops the global sound source.
void PhysicsApplyDirForceToRagdoll(vec3 dir, float len)
This function applies a directional force to all the nodes of the Ragdoll associated to this object...
void SetAnimationBlendY(int channel, string animName, float value)
This function assigns a blend float value to a blended animation in Y direction.
float DotProduct(vec3 v1, vec3 v2)
This function returns the Dot product between two given 3D vectors.
string GetVideoMode(int i)
This function returns a string containing the description of the supported Video Mode at index i...
int GetNumVideoModes()
This function returns the number of video modes supported by the hardware system. ...
vec3 PhysicsGetCharacterDims()
This function returns the dimensions of the capsule of a physics character associated to this object...
vec3 AIGetNearestTacticalCoverPoint(vec3 opponent, vec3 target, float range, int ID)
This function returns the nearest point from a given point( also called the target point) in which th...
string AIGetNearestViewedObject()
This function returns the name of the nearest object viewed by this object.
float GetInputAxis(string name)
This function returns the value of an input axis given its identifying name. Value returned is alread...
void PhysicsResetRagdollCollideFlag()
This function sets to false the collide flag of all the capsules of a ragdoll associated with this ob...
void StopMusic(int channel)
This function stops a music playing on a given channel.
void SpawnObject(string prefabFilename, vec3 pos, vec3 angles)
This function creates an object taking its description from a prefab resource.
vec3 PhysicsGetObjectPos()
This function returns the position of this object if it is associated to a physics object...
void PhysicsResetCollideFlag()
This function sets to false the collide flag of physics object associated with this object...
bool IsSoundPlaying()
This function returns true if the sounde source of this object is still playing a sound...
void ShowParentWidget(bool show)
This function shows/hides the parent of this widget.