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
#21
RE: Machine puzzle and other things

I updated the script with a function that will open all bulkheads in an area, it didn't work, and here's my script and hpl.log
Spoiler below!
void OnStart()
{
AddUseItemCallback("Usedsteam", "SteamRod", "MachineScript_1", "Elevator", true);
AddUseItemCallback("Usedflow" ,"FlowRod", "MachineScript_2", "Elevator_1", true);
AddUseItemCallback("Usedkey" ,"KeyRod", "MachineScript_3", "SafetyOpen", true);
}

void SafetyOpen (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("KeyRod_static", true);
PreloadSound("rod_in.snt");
PreloadSound("17_piston_move.snt");
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 asParent, string &in asChild, int alState)
{
SetEntityActive("SteamRod_static", true);
PreloadSound("rod_in.snt");
AddLocalVarInt("ElevatorWork", 1);
func_check();
}

void Elevator_1 (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("FlowRod_static", true);
PreloadSound("rod_in.snt");
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)
{
ChangeMap("00_Buda.map", "PlayerStartArea_1", "14_elevator_activate.snt", "elevator_move_normal.snt");
}
}

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: 790 ms
    Primitive Loading: 57 ms
    Decal Loading: 73 ms
    Object Combining: 0 ms
    Compilation: 1 ms
    Combining: 1334 ms
     Sorting: 1280 ms
     Meshes: 3 ms
     Bodies: 51 ms
  Static Objects: 2256 ms
  Entities: 1578 ms
  Compilation: 2 ms
  Total: 3877 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/global.hps'!
------- SCRIPT OUTPUT BEGIN --------------------------
main (1, 1) : ERR  : Unexpected token '<integer constant>'
------- SCRIPT OUTPUT END ----------------------------
ERROR: Global script 'TheManMachine/maps/global.hps' could not be created!
-------- Loading map '14_MechanicalLaboratory.map' ---------
ERROR: Could not open binary file 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/TheManMachine/maps/14_MechanicalLaboratory.map_cache'
ERROR: Could not map cache file 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/TheManMachine/maps/14_MechanicalLaboratory.map'.    MeshEntity Loading: 1468 ms
    Primitive Loading: 201 ms
    Decal Loading: 59 ms
    Object Combining: 0 ms
    Compilation: 118 ms
    Combining: 1632 ms
     Sorting: 402 ms
     Meshes: 23 ms
     Bodies: 1207 ms
  Static Objects: 3483 ms
WARNING: Could not find child with unique ID 1 to attach to entity 'safety_normal_vert_1_Body_1' in 'entities/door/safety_normal_vert/safety_normal_vert.ent'
WARNING: Could not find child with unique ID 1 to attach to entity 'safety_normal_vert_2_Body_1' in 'entities/door/safety_normal_vert/safety_normal_vert.ent'
WARNING: Could not find child with unique ID 1 to attach to entity 'safety_normal_vert_3_Body_1' in 'entities/door/safety_normal_vert/safety_normal_vert.ent'
WARNING: Could not find child with unique ID 1 to attach to entity 'safety_normal_vert_4_Body_1' in 'entities/door/safety_normal_vert/safety_normal_vert.ent'
WARNING: Could not find child with unique ID 1 to attach to entity 'safety_normal_vert_5_Body_1' in 'entities/door/safety_normal_vert/safety_normal_vert.ent'
  Entities: 3607 ms
  Compilation: 19 ms
  Total: 7171 ms
  Meshes created: 152
  Bodies created: 108
-------- Loading complete ---------
ERROR: Couldn't build script 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/TheManMachine/maps/inventory.hps'!
------- SCRIPT OUTPUT BEGIN --------------------------
ExecuteString (1, 1) : ERR  : No matching signatures to 'OnEnter()'
main (1, 1) : ERR  : Unexpected token '<unrecognized token>'
------- SCRIPT OUTPUT END ----------------------------
ERROR: Inventory script 'TheManMachine/maps/inventory.hps' not found!
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: 401 ms
    Primitive Loading: 38 ms
    Decal Loading: 57 ms
    Object Combining: 0 ms
    Compilation: 1 ms
    Combining: 223 ms
     Sorting: 185 ms
     Meshes: 2 ms
     Bodies: 36 ms
  Static Objects: 721 ms
  Entities: 570 ms
  Compilation: 1 ms
  Total: 1308 ms
  Meshes created: 18
  Bodies created: 9
-------- Loading complete ---------
--------------------------------------------------------Statistics
--------------------------------------------------------
Medium framerate: 35.294591
--------------------------------------------------------User Exit
--------------------------------------------------------
Saving main config.
Saving user config.
Deleting game modules.
   'LuxInputHandler'
   'LuxHelpFuncs'
   'LuxSaveHandler'
   'LuxScriptHandler'
   'LuxProgressLogHandler'
   'LuxMapHandler'
   'LuxMapHelper'
   'LuxPlayer'
   'LuxInsanityHandler'
   'LuxDebugHandler'
   'LuxEffectRenderer'
   'LuxMusicHandler'
   'LuxMusicHandler'
   'LuxEffectHandler'
   'LuxCompletionCountHandler'
   'LuxGlobalDataHandler'
   'LuxHintHandler'
   'LuxPostEffectHandler'
   'LuxPreMenu'
   'LuxDebugHandler'
   'LuxInventory'
   'LuxJournal'
   'LuxCredits'
   'LuxLoadScreenHandler'
Deleting config files.
--------------------------------------------------------Exiting Gui Module
--------------------------------------------------------
Deleting all sets
Deleting all skins
Deleting all gfx elements
Deleting all materials
--------------------------------------------------------Exiting Generate Module
--------------------------------------------------------
--------------------------------------------------------Exiting Scene Module
--------------------------------------------------------
--------------------------------------------------------Exiting Input Module
--------------------------------------------------------
--------------------------------------------------------Exiting Sound Module
--------------------------------------------------------
--------------------------------------------------------Exiting Graphics Module
--------------------------------------------------------
--------------------------------------------------------Exiting Resources Module
--------------------------------------------------------
Done with fonts
Done with scripts
Done with particles
Done with sounds
Done with meshes
Done with materials
Done with Gpu programs
Done with images
Destroyed all textures
Done with sound entities
Done with animations
Done with ent files
All resources deleted
--------------------------------------------------------Exiting Physics Module
--------------------------------------------------------
--------------------------------------------------------Exiting System Module
--------------------------------------------------------
-------------------------------------------------------- Deleting game setup provided by user
- Deleting lowlevel stuff.
  Physics
  Sound
  Input
  Resources
  System
  Graphics
  Haptic
HPL Exit was successful!|--Memory Manager Report-------------------------------|
|
| No memory leaks detected. Memory left: 0
|
|------------------------------------------------------|


Still hasn't gotten over the loss of wubwub...
11-11-2012, 03:31 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#22
RE: Machine puzzle and other things

Your Syntax is wrong.
(string &in asParent, string &in asChild, int alState) is for colliding.



(string &in asItem, string &in asEntity) is for using items

Trying is the first step to success.
11-11-2012, 05:01 PM
Find
CorinthianMerchant Offline
Posting Freak

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

SteamRod_static is now created, but nothing else is working...
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: 409 ms
    Primitive Loading: 38 ms
    Decal Loading: 59 ms
    Object Combining: 0 ms
    Compilation: 3 ms
    Combining: 274 ms
     Sorting: 234 ms
     Meshes: 3 ms
     Bodies: 37 ms
  Static Objects: 783 ms
  Entities: 610 ms
  Compilation: 1 ms
  Total: 1409 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/global.hps'!
------- SCRIPT OUTPUT BEGIN --------------------------
main (1, 1) : ERR  : Unexpected token '<integer constant>'
------- SCRIPT OUTPUT END ----------------------------
ERROR: Global script 'TheManMachine/maps/global.hps' could not be created!
-------- Loading map '14_MechanicalLaboratory.map' ---------
ERROR: Could not open binary file 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/TheManMachine/maps/14_MechanicalLaboratory.map_cache'
ERROR: Could not map cache file 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/TheManMachine/maps/14_MechanicalLaboratory.map'.    MeshEntity Loading: 1514 ms
    Primitive Loading: 384 ms
    Decal Loading: 80 ms
    Object Combining: 0 ms
    Compilation: 124 ms
    Combining: 1424 ms
     Sorting: 174 ms
     Meshes: 20 ms
     Bodies: 1230 ms
  Static Objects: 3530 ms
WARNING: Could not find child with unique ID 1 to attach to entity 'safety_normal_vert_1_Body_1' in 'entities/door/safety_normal_vert/safety_normal_vert.ent'
WARNING: Could not find child with unique ID 1 to attach to entity 'safety_normal_vert_2_Body_1' in 'entities/door/safety_normal_vert/safety_normal_vert.ent'
WARNING: Could not find child with unique ID 1 to attach to entity 'safety_normal_vert_3_Body_1' in 'entities/door/safety_normal_vert/safety_normal_vert.ent'
WARNING: Could not find child with unique ID 1 to attach to entity 'safety_normal_vert_4_Body_1' in 'entities/door/safety_normal_vert/safety_normal_vert.ent'
  Entities: 4199 ms
  Compilation: 20 ms
  Total: 7813 ms
  Meshes created: 147
  Bodies created: 108
-------- Loading complete ---------
ERROR: Couldn't build script 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/TheManMachine/maps/inventory.hps'!
------- SCRIPT OUTPUT BEGIN --------------------------
ExecuteString (1, 1) : ERR  : No matching signatures to 'OnEnter()'
main (1, 2) : ERR  : Expected identifier
------- SCRIPT OUTPUT END ----------------------------
ERROR: Inventory script 'TheManMachine/maps/inventory.hps' not found!
WARNING: Entity 'FlowRod_static' with type 5 and subtype -1 does not exist!
ERROR: Couldn't create SoundEntity 'rod_in.snt'
WARNING: Couldn't preload sound entity 'rod_in.snt'
ERROR: Couldn't create SoundEntity 'rod_in.snt'
WARNING: Couldn't preload sound entity 'rod_in.snt'
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: 408 ms
    Primitive Loading: 38 ms
    Decal Loading: 57 ms
    Object Combining: 0 ms
    Compilation: 1 ms
    Combining: 232 ms
     Sorting: 193 ms
     Meshes: 1 ms
     Bodies: 38 ms
  Static Objects: 736 ms
  Entities: 581 ms
  Compilation: 1 ms
  Total: 1335 ms
  Meshes created: 25
  Bodies created: 9
-------- Loading complete ---------
--------------------------------------------------------Statistics
--------------------------------------------------------
Medium framerate: 37.435340
--------------------------------------------------------User Exit
--------------------------------------------------------
Saving main config.
Saving user config.
Deleting game modules.
   'LuxInputHandler'
   'LuxHelpFuncs'
   'LuxSaveHandler'
   'LuxScriptHandler'
   'LuxProgressLogHandler'
   'LuxMapHandler'
   'LuxMapHelper'
   'LuxPlayer'
   'LuxInsanityHandler'
   'LuxDebugHandler'
   'LuxEffectRenderer'
   'LuxMusicHandler'
   'LuxMusicHandler'
   'LuxEffectHandler'
   'LuxCompletionCountHandler'
   'LuxGlobalDataHandler'
   'LuxHintHandler'
   'LuxPostEffectHandler'
   'LuxPreMenu'
   'LuxDebugHandler'
   'LuxInventory'
   'LuxJournal'
   'LuxCredits'
   'LuxLoadScreenHandler'
Deleting config files.
--------------------------------------------------------Exiting Gui Module
--------------------------------------------------------
Deleting all sets
Deleting all skins
Deleting all gfx elements
Deleting all materials
--------------------------------------------------------Exiting Generate Module
--------------------------------------------------------
--------------------------------------------------------Exiting Scene Module
--------------------------------------------------------
--------------------------------------------------------Exiting Input Module
--------------------------------------------------------
--------------------------------------------------------Exiting Sound Module
--------------------------------------------------------
--------------------------------------------------------Exiting Graphics Module
--------------------------------------------------------
--------------------------------------------------------Exiting Resources Module
--------------------------------------------------------
Done with fonts
Done with scripts
Done with particles
Done with sounds
Done with meshes
Done with materials
Done with Gpu programs
Done with images
Destroyed all textures
Done with sound entities
Done with animations
Done with ent files
All resources deleted
--------------------------------------------------------Exiting Physics Module
--------------------------------------------------------
--------------------------------------------------------Exiting System Module
--------------------------------------------------------
-------------------------------------------------------- Deleting game setup provided by user
- Deleting lowlevel stuff.
  Physics
  Sound
  Input
  Resources
  System
  Graphics
  Haptic
HPL Exit was successful!|--Memory Manager Report-------------------------------|
|
| No memory leaks detected. Memory left: 0
|
|------------------------------------------------------|

Spoiler below!
void OnStart()
{
AddUseItemCallback("Usedsteam", "SteamRod", "MachineScript_1", "Elevator", true);
AddUseItemCallback("Usedflow" ,"FlowRod", "MachineScript_2", "Elevator_1", true);
AddUseItemCallback("Usedkey" ,"KeyRod", "MachineScript_3", "SafetyOpen", true);
}

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)
{
ChangeMap("00_Buda.map", "PlayerStartArea_1", "14_elevator_activate.snt", "elevator_move_normal.snt");
}
}


Still hasn't gotten over the loss of wubwub...
11-11-2012, 06:20 PM
Find
CorinthianMerchant Offline
Posting Freak

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

Bump!

Still hasn't gotten over the loss of wubwub...
11-14-2012, 08:16 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#25
RE: Machine puzzle and other things

It makes sense since there is nothing else in you void OnStart() than the steam rod script. Thats why nothing else works Wink

Trying is the first step to success.
11-14-2012, 08:22 PM
Find
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
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#27
RE: Machine puzzle and other things

tYou forgot to declare some thing try this:
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");
}
}


CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
11-14-2012, 09:02 PM
Find
CorinthianMerchant Offline
Posting Freak

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

It doesn't crash anymore but none of the scripts are working properly.
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: 396 ms
    Primitive Loading: 40 ms
    Decal Loading: 59 ms
    Object Combining: 0 ms
    Compilation: 1 ms
    Combining: 261 ms
     Sorting: 221 ms
     Meshes: 1 ms
     Bodies: 39 ms
  Static Objects: 758 ms
  Entities: 578 ms
  Compilation: 1 ms
  Total: 1353 ms
  Meshes created: 27
  Bodies created: 9
-------- Loading complete ---------
Setting profile: 'CM' Path: 'C:\Users\Halapi\Documents/Amnesia/TheManMachine/CM/'
-------- Loading map '14_MechanicalLaboratory.map' ---------
ERROR: Could not open binary file 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/TheManMachine/maps/14_MechanicalLaboratory.map_cache'
ERROR: Could not map cache file 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/TheManMachine/maps/14_MechanicalLaboratory.map'.    MeshEntity Loading: 1750 ms
    Primitive Loading: 278 ms
    Decal Loading: 87 ms
    Object Combining: 0 ms
    Compilation: 120 ms
    Combining: 1692 ms
     Sorting: 450 ms
     Meshes: 28 ms
     Bodies: 1214 ms
  Static Objects: 3932 ms
WARNING: Could not find child with unique ID 1 to attach to entity 'safety_normal_vert_1_Body_1' in 'entities/door/safety_normal_vert/safety_normal_vert.ent'
WARNING: Could not find child with unique ID 1 to attach to entity 'safety_normal_vert_2_Body_1' in 'entities/door/safety_normal_vert/safety_normal_vert.ent'
WARNING: Could not find child with unique ID 1 to attach to entity 'safety_normal_vert_3_Body_1' in 'entities/door/safety_normal_vert/safety_normal_vert.ent'
WARNING: Could not find child with unique ID 1 to attach to entity 'safety_normal_vert_4_Body_1' in 'entities/door/safety_normal_vert/safety_normal_vert.ent'
  Entities: 5003 ms
  Compilation: 19 ms
  Total: 9015 ms
  Meshes created: 147
  Bodies created: 107
-------- Loading complete ---------
WARNING: Entity 'player' does not exist!
ERROR: Couldn't build script 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/TheManMachine/maps/inventory.hps'!
------- SCRIPT OUTPUT BEGIN --------------------------
ExecuteString (1, 1) : ERR  : No matching signatures to 'OnEnter()'
main (1, 1) : ERR  : Unexpected token '<unrecognized token>'
------- SCRIPT OUTPUT END ----------------------------
ERROR: Inventory script 'TheManMachine/maps/inventory.hps' not found!
ERROR: Couldn't create SoundEntity 'rod_in.snt'
WARNING: Couldn't preload sound entity 'rod_in.snt'
WARNING: Entity 'FlowRod_static' with type 5 and subtype -1 does not exist!
ERROR: Couldn't create SoundEntity 'rod_in.snt'
WARNING: Couldn't preload sound entity 'rod_in.snt'
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: 38 ms
    Decal Loading: 56 ms
    Object Combining: 0 ms
    Compilation: 1 ms
    Combining: 228 ms
     Sorting: 188 ms
     Meshes: 2 ms
     Bodies: 38 ms
  Static Objects: 726 ms
  Entities: 559 ms
  Compilation: 1 ms
  Total: 1302 ms
  Meshes created: 26
  Bodies created: 9
-------- Loading complete ---------
--------------------------------------------------------Statistics
--------------------------------------------------------
Medium framerate: 38.224741
--------------------------------------------------------User Exit
--------------------------------------------------------
Saving main config.
Saving user config.
Deleting game modules.
   'LuxInputHandler'
   'LuxHelpFuncs'
   'LuxSaveHandler'
   'LuxScriptHandler'
   'LuxProgressLogHandler'
   'LuxMapHandler'
   'LuxMapHelper'
   'LuxPlayer'
   'LuxInsanityHandler'
   'LuxDebugHandler'
   'LuxEffectRenderer'
   'LuxMusicHandler'
   'LuxMusicHandler'
   'LuxEffectHandler'
   'LuxCompletionCountHandler'
   'LuxGlobalDataHandler'
   'LuxHintHandler'
   'LuxPostEffectHandler'
   'LuxPreMenu'
   'LuxDebugHandler'
   'LuxInventory'
   'LuxJournal'
   'LuxCredits'
   'LuxLoadScreenHandler'
Deleting config files.
--------------------------------------------------------Exiting Gui Module
--------------------------------------------------------
Deleting all sets
Deleting all skins
Deleting all gfx elements
Deleting all materials
--------------------------------------------------------Exiting Generate Module
--------------------------------------------------------
--------------------------------------------------------Exiting Scene Module
--------------------------------------------------------
--------------------------------------------------------Exiting Input Module
--------------------------------------------------------
--------------------------------------------------------Exiting Sound Module
--------------------------------------------------------
--------------------------------------------------------Exiting Graphics Module
--------------------------------------------------------
--------------------------------------------------------Exiting Resources Module
--------------------------------------------------------
Done with fonts
Done with scripts
Done with particles
Done with sounds
Done with meshes
Done with materials
Done with Gpu programs
Done with images
Destroyed all textures
Done with sound entities
Done with animations
Done with ent files
All resources deleted
--------------------------------------------------------Exiting Physics Module
--------------------------------------------------------
--------------------------------------------------------Exiting System Module
--------------------------------------------------------
-------------------------------------------------------- Deleting game setup provided by user
- Deleting lowlevel stuff.
  Physics
  Sound
  Input
  Resources
  System
  Graphics
  Haptic
HPL Exit was successful!|--Memory Manager Report-------------------------------|
|
| No memory leaks detected. Memory left: 0
|
|------------------------------------------------------|


Still hasn't gotten over the loss of wubwub...
11-14-2012, 09:42 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#29
RE: Machine puzzle and other things

Are you sure you names your area BAtSound and not BatSound?

Trying is the first step to success.
11-14-2012, 09:47 PM
Find




Users browsing this thread: 1 Guest(s)