LUA Scripting commands

LUA Scripting commands

ที่มา : game-guru.com


Prompt(string) - Display the string for several seconds at the bottom of the screen

SetFogNearest(distance) - set the start distance of the fog

SetFogDistance(distance) - set the end distance of the fog where it is opaque

SetFogRed(red) - set the fog red component from 0 to 255

SetFogGreen(green) - set the fog green component from 0 to 255

SetFogBlue(blue) - set the fog blue component from 0 to 255

SetAmbienceIntensity(percentage) - set the ambient intensity from 0 to 100

SetAmbienceRed(red) - set the ambient red component from 0 to 255

SetAmbienceGreen(green) - set the ambient green component from 0 to 255

SetAmbienceBlue(blue) - set the ambient blue component from 0 to 255

SetSurfaceRed(red) - set the global surface red component from 0 to 255

SetSurfaceGreen(green) - set the global surface green component from 0 to 255

SetSurfaceBlue(blue) - set the global surface blue component from 0 to 255

StartTimer(entity index) - resets the timer associated with the specified entity index

GetTimer(entity index) - get the timer for the entity in milliseconds

Destroy(entity index) - destroy the specified entity

CollisionOn(entity index) - create a physics body around the specified entity

CollisionOff(entity index) - destroy the physics body around the specified entity

Hide(entity index) - hide the specified entity

Show(entity index) - show the specified entity

Spawn(entity index) - if the specified entity was not spawned at start, spawn it

Collected(entity index) - mark the specified entity has having been collected

MoveUp(entity index,amount) - move the specified entity upwards by amount

MoveForward(entity index,amount) - move the specified entity forward by amount

MoveBackward(entity index,amount) - move the specified entity backward by amount

ModulateSpeed(entity index,speed) - alter the move and animation speed of entity

SetAnimation(entity index) - set an animation index value for later use

SetAnimationFrames(entity index,v) - set an animation range for later use

PlayAnimation(entity index) - play the animation index or range as previously set

LoopAnimation(entity index) - loop the animation index or range as previously set

StopAnimation(entity index) - stop the animation for the specified entity

SetAnimationSpeed(entity index,speed) - set the animation speed of the entity

GetAnimationFrame(entity index) - get the animation frame number from the entity

CharacterControlUnarmed(entity index) - switch character to unarmed state

CharacterControlLimbo(entity index) - switch character to limbo state

CharacterControlArmed(entity index) - switch character to armed state

CharacterControlFidget(entity index) - switch character to fidget state

CharacterControlDucked(entity index) - switch character to crouched state

CharacterControlStand(entity index) - switch character to stood state

SetCharacterToWalk(entity index) - set the character to walk when moving

SetCharacterToRun(entity index) - set the character to run when moving

RotateToPlayer(entity index) - rotate the specified entity to face the player

AddPlayerWeapon(entity index) - trigger player to collect the weapon entity

AddPlayerAmmo(entity index) - trigger player to collect the ammo entity

AddPlayerHealth(entity index) - trigger player to collect the health entity

WinZone(entity index) - trigger player to win this level and move to next level

Checkpoint(entity index) - trigger player to record checkpoint for later use

GetPlayerInZone(entity index) - return 1 if the player is inside entity zone area

PlaySound(entity index,slot) - play the sound stored in the specified slot 

LoopSound(entity index,slot) - loop the sound stored in the specified slot 

StopSound(entity index,slot) - stop the sound stored in the specified slot 

SetSoundSpeed(speed) - set the speed of the last sound handled in hertz

SetSoundVolume(volume) - set the volume of the last sound handled 0 to 100

FireWeapon(entity index) - cause the specified entity to fire at the player

Include ("ai_cover.lua") - Use within the init function to ensure the script is pre loaded

SwitchScript ( e,"ai_cover" ) - Switch AI to use a different script

SetCharacterToStrafeLeft(e) - AI to strafe to the left

SetCharacterToStrafeRight(e) - AI to strafe to the right

RotateX(e,v) - Rotate an entity along the X axis.

RotateY(e,v) - Rotate an entity along the Y axis.

RotateZ(e,v) - Rotate an entity along the Z axis.

Scale(e,v) - Scales an entity to V%

SetCharacterVisionDelay(e,v) - Sets the speed at which a 



V1.008



Entity "If Used" now works.



SetEntityHealth(e,health) - can be used to set the health of an entity. If the new health is 0 then it will be destroyed.

SetPlayerHealth(health) - assign a new health value to the player (total health).

AddPlayerHealth(health) - adds additional health to the player

CollisionOff(e) - turn off physics collision for this entity (handy for a custom entity perhaps dying, where you want to turn off physics so they don't move and play a death animation)

CollisionOn(e) - restore collision for this entity

SetPosition(e,x,y,z) - sets the absolute position of an entity, use only on entities with physics off (Note: If GravityOff(e) has not been called, positioned object will still align themselves with the terrain floor)

SetRotation(e,x,y,z)- set the absolute rotation of an entity. Only for use on a non physics entity.

ResetPosition(e,x,y,z) - reposition a physics entity

GravityOff(e) - turns off non physics entities snapping to the terrain floor, handy to call inside _init

GravityOn(e) - turns on non physics entities snapping to the terrain floor

HurtPlayer(e,v) - injure the player, great for custom objects

HideTerrain() - stop the terrain drawing

ShowTerrain() - show the terrain again

HideWater() - stop water from being drawn

ShowWater() - show water again



V1.0085



PlaySoundIfSilent(e,v) - plays the entities sound if not playing

PlayNon3DSound(e,v) - play the entities sound as non-3D

TransportToIfUsed(e) - moves the player to the position of the object in the IFUSED field

FinishLevel() - Forces the level to finish.

PlayCombatMusic(playTime,fadeTime) - Plays the combat music

PlayFinalAssaultMusic(fadeTime) - Plays the assault music



Coming Soon - V1.009 - Teaser



g_PlayerLives = 0 - can read the current number of player lives



PromptTextSize(v) - change the size of the prompt text from 1 through 5, 5 being largest

HideHuds() - hide huds for weapon and player status

ShowHuds() - show huds for weapon and player status

FreezeAI() - freeze all DarkAI activity used by character AI

UnFreezeAI() - unfreeze all DarkAI activity used by character AI

FreezePlayer() - freeze the ability of the player to move, mouselook or take action

UnFreezePlayer() - [unfreeze the ability of the player to move, mouselook or take action

DisableMusicReset(v) - call at start of game to suspend normal music restart behaviour

LoadImages(str,v) - specify a folder inside 'scriptbank\images\"' to load images at slot V onwards

SetImagePosition(x,y) - set the X and Y position of where the image should be drawn

ShowImage(i) - select the image slot number to be drawn

HideImage(i) - hide the image from being drawn

SetImageAlignment(i) - use 0 to position image using center hotspot, 1 is top left hotspot



สร้างเกม, ทำเกม, โปรแกรมสร้างเกม, เกม, game สอนสร้างเกม, สอนทำเกม, rm, game guru, eclipse origins online game, pcgame, mobile game #สร้างเกม #ทำเกม #โปรแกรมสร้างเกม #เกม #game #สอนสร้างเกม #สอนทำเกม #rm #game_guru #eclipse_origins #online_game #pcgame #mobile_game

ไม่มีความคิดเห็น:

แสดงความคิดเห็น