Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Machine puzzle and other things
CorinthianMerchant Offline
Posting Freak

Posts: 2,876
Threads: 84
Joined: Nov 2011
Reputation: 131
#26
RE: Machine puzzle and other things

Alright i tried a new script that would play a sound when the player enters an area, but it causes the game to crash.

My hpl.log:

Spoiler below!
Version 1.20
-------- THE HPL ENGINE LOG ------------
Engine build ID 20101021192547Creating Engine Modules
--------------------------------------------------------
Creating graphics module
Creating system module
Creating resource module
Creating input module
Creating sound module
Creating physics module
Creating ai module
Creating gui module
Creating generate module
Creating haptic module
Creating scene module
--------------------------------------------------------Initializing Resources Module
--------------------------------------------------------
Creating loader handlers
Creating resource managers
Adding loaders to handlers
--------------------------------------------------------Initializing Graphics Module
--------------------------------------------------------
Init lowlevel graphics: 1024x768 bpp:32 fs:1 ms:0 gpufmt:2 cap:'The Man Machine - An Amnesia Full Conversion Mod Loading...' pos:(-1x-1)
Setting video mode: 1024 x 768 - 32 bpp
Init Glew...OK
Setting up OpenGL
  Vendor: ATI Technologies Inc.
  Renderer: ATI Radeon HD 4350
  Version: 2.1.8781
  Max texture image units: 16
  Max texture coord units: 16
  Max user clip planes: 6
  Two sided stencil: 1
  Vertex Buffer Object: 1
  Anisotropic filtering: 1
  Max Anisotropic degree: 16
  Multisampling: 1
  Texture compression: 1
  Texture compression S3TC: 1
  Auto generate MipMaps: 1
  Render to texture: 1
  Max draw buffers: 8
  Max color render targets: 8
  Packed depth-stencil: 1
  Texture float: 1
  GLSL Version: 1.30
  ShaderModel 2: 1
  ShaderModel 3: 1
  ShaderModel 4: 1
  OGL ATIFragmentShader: 1
Setting up G-Bugger: type: 0 texturenum: 3
Adding engine materials
Initializing DevIL
  Vendor String: Abysmal Software
  Version String: Developer's Image Library (DevIL) 1.6.8pre Aug 12 2006
  Version Number: 168
Adding engine post effects
--------------------------------------------------------Initializing Sound Module
--------------------------------------------------------
Initializing OpenAL
  Available OpenAL devices:
   0. Generic Software on Högtalare (Realtek High Definition Audio)(OpenAL default)
  Trying to open device 'Generic Software on Högtalare (Realtek High Definition Audio)'... Success!
  Number of mono sources: 32
  Streaming setup: 4 Buffers x 262144 bytes each
--------------------------------------------------------Initializing Game Module
--------------------------------------------------------
Adding engine updates
Initializing script functions
--------------------------------------------------------User Initialization
--------------------------------------------------------
WARNING: Could not find language file entry 'WelcomeMessage01'
WARNING: Could not find language file entry 'WelcomeMessage02'
WARNING: Could not find language file entry 'WelcomeMessage03'
WARNING: Could not find language file entry 'WelcomeMessage04'
WARNING: Could not find language file entry 'WelcomeMessage05'
WARNING: Could not find language file entry 'WelcomeMessage06'
--------------------------------------------------------Game Running
--------------------------------------------------------
ERROR: Couldn't load image 'TheManMAchine/graphics/main_menu/themanmachine_logo.png'
ERROR: Could not load image 'TheManMAchine/graphics/main_menu/themanmachine_logo.png'!
-------- Loading map 'tmm_menu_bg.map' ---------
ERROR: Could not open binary file 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/TheManMachine/main_menu/main/tmm_menu_bg.map_cache'
ERROR: Could not map cache file 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/TheManMachine/main_menu/main/tmm_menu_bg.map'.    MeshEntity Loading: 402 ms
    Primitive Loading: 37 ms
    Decal Loading: 58 ms
    Object Combining: 0 ms
    Compilation: 1 ms
    Combining: 265 ms
     Sorting: 225 ms
     Meshes: 3 ms
     Bodies: 37 ms
  Static Objects: 764 ms
  Entities: 590 ms
  Compilation: 2 ms
  Total: 1371 ms
  Meshes created: 27
  Bodies created: 9
-------- Loading complete ---------
Setting profile: 'CM' Path: 'C:\Users\Halapi\Documents/Amnesia/TheManMachine/CM/'
ERROR: Couldn't build script 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/TheManMachine/maps/14_MechanicalLaboratory.hps'!
------- SCRIPT OUTPUT BEGIN --------------------------
main (1, 1) : INFO : Compiling void OnStart()
main (3, 2) : ERR  : No matching signatures to 'AddEntityCollideCallback(string@&, string@&, PlayBatSound, const bool, const uint)'
main (3, 2) : INFO : Candidates are:
main (3, 2) : INFO : void AddEntityCollideCallback(string&in, string&in, string&in, bool, int)
main (9, 1) : INFO : Compiling void PlayBatSound(string&in, string&in, int)
main (11, 42) : ERR  : 'BAtSound' is not declared
main (11, 25) : ERR  : 'general_bat' is not declared
main (11, 20) : ERR  : 'Bat' is not declared
------- SCRIPT OUTPUT END ----------------------------
FATAL ERROR: Could not load script file 'TheManMachine/maps/14_MechanicalLaboratory.hps'!
main (3, 2) : ERR  : No matching signatures to 'AddEntityCollideCallback(string@&, string@&, PlayBatSound, const bool, const uint)'
main (11, 42) : ERR  : 'BAtSound' is not declared
main (11, 25) : ERR  : 'general_bat' is not declared
main (11, 20) : ERR  : 'Bat' is not declared

My script:
Spoiler below!
void OnStart()
{
AddEntityCollideCallback("BatSound", "player", PlayBatSound, false, 1);
AddUseItemCallback("Usedsteam", "SteamRod", "MachineScript_1", "Elevator", true);
AddUseItemCallback("Usedflow" ,"FlowRod", "MachineScript_2", "Elevator_1", true);
AddUseItemCallback("Usedkey" ,"KeyRod", "MachineScript_3", "SafetyOpen", true);
}

void PlayBatSound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity(Bat, general_bat.snt, BAtSound, 0.1f, false);
}void SafetyOpen (string &in asItem, string &in asEntity)
{
SetEntityActive("KeyRod_static", true);
PreloadSound("rod_in.snt");
PreloadSound("17_piston_move.snt");
RemoveItem("KeyRod");
SetMoveObjectState("safety_normal_vert_1", 1.0f);
SetMoveObjectState("safety_normal_vert_2", 1.0f);
SetMoveObjectState("safety_normal_vert_3", 1.0f);
SetMoveObjectState("safety_normal_vert_4", 1.0f);
SetMoveObjectState("safety_normal_vert_5", 1.0f);
SetMoveObjectState("safety_normal_vert_6", 1.0f);
}
void Elevator (string &in asItem, string &in asEntity)
{
SetEntityActive("SteamRod_static", true);
PreloadSound("rod_in.snt");
RemoveItem("SteamRod");
AddLocalVarInt("ElevatorWork", 1);
func_check();
}

void Elevator_1 (string &in asItem, string &in asEntity)
{
SetEntityActive("FlowRod_static", true);
PreloadSound("rod_in.snt");
RemoveItem("FlowRod");
AddLocalVarInt("ElevatorWork", 1);
func_check();
}

void func_check()
{
if (GetLocalVarInt("ElevatorWork") == 2)
{
PreloadSound("13_flow_done.snt");
SetEntityConnectionStateChangeCallback("elevator_lever_1", "Map");
}
}

void Map (string &in asEntity, int alState)
{
if (alState == 1)
{
FadeOut(4);
ChangeMap("00_Buda.map", "PlayerStartArea_1", "14_elevator_activate.snt", "elevator_move_normal.snt");
}
}


Still hasn't gotten over the loss of wubwub...
(This post was last modified: 11-14-2012, 09:00 PM by CorinthianMerchant.)
11-14-2012, 08:59 PM
Find


Messages In This Thread
RE: Machine puzzle and other things - by Adny - 11-04-2012, 07:59 PM
RE: Machine puzzle and other things - by Steve - 11-04-2012, 08:15 PM
RE: Machine puzzle and other things - by Steve - 11-07-2012, 05:19 PM
RE: Machine puzzle and other things - by CorinthianMerchant - 11-14-2012, 08:59 PM
RE: Machine puzzle and other things - by Steve - 11-14-2012, 09:02 PM



Users browsing this thread: 6 Guest(s)