I believe amending them to a single thread is a better way to go than creating a new thread everytime & having to spend ages searching for each of them!
[ABC]
º Actions: startAction() | stopAction()
º Animations: startAnimation() | stopAnimation()
º createScreenshot()
º Config.ini [read | delete]
º Config.ini [write]
[DEF]
[GHI]
[JKL]
[MNO]
[PQR]
º Print()
[STU]
º startDefaultBrowser()
[VWX]
º Volume: getVolume() | setVolume()
º Volume: Modified Slider Script
[YZ]
[END]
It checks if volume = 100% or more & if not it adds +10% volume to declared int value. it checks if volume = 0% or less & subtracts -10% volume from declared int value.
add\subtract actions are declared in an execute script with PlusMinus_Vol(int, false|true) true = add | false = subtract
int = {0 = music, 1 = sound, 2 = speech}
Check einzelkaempfer's Volume Slider Script - which is in German - for more ideas.
I will be uploading my modified English version of his script when I've finished working on my mock menu template which includes:
º new game º resume game º advanced save/load/delete menu (various values & conditions to control) º options menu (change vol, fullscreen, resolution, subtitles, language etc) º bonus content menu (content unlocked via achievements|score system - no sure yet) º quit game
extras included: º launch default browser º create multiple screenshots º read | write | delete config.ini (when I've finished the script)
& so on.
P.S if anyone knows a better way of playing sound or speech files within V.S with Lua rather than having to create/use an action then please let me know as I tried various methods I found on google & didn't have much luck other than returning a NIL value in the log file!
Cheers, Lee
as the code currently is, it will start the action assigned via execute function but it does not print my true/false messages to the log; instead we get an error message!
if I change "action_1" to local action_1 then it doesn't perform the assigned action & gives us an error about not using the correct/expected syntax!
current script below:
-- some quick examples of startAction() | stopAction()
-- start action has a return value so we'll do a version for that too!
-- execute startAction in an object action like so: start_action_num(local variable name)
-- execute stopAction in an object action like so: stop_action_num(local variable name)-- globals (declare the action & path into a local variable)
-- local action_1 = getObject('Scenes[scene_name].SceneActions[action_name]') -- scene action tab
-- local action_2 = getObject('Scenes[scene_name].SceneObjects[object_name].ObjectActions[action_name]') -- object action tab
-- local action_3 = getObject('Characters[character_name].CharacterActions[action_name]') -- character action tab
action_1 = getObject('Scenes[Options_Menu].SceneActions[play_sound]')
function start_action_num(act)
if startAction(act) then
print('action ' .. act .. ' has been started!')
else
print('action ' .. act .. ' could not be started!')
end
end
function stop_action_num(act)
stopAction(act)
print('action ' .. act .. ' has been stopped!')
end
anyone have any idea what's wrong with the script?
much appreciated, cheers
essentially I've created an LUA script which allows us to define which action we want to start via the "typ" variable added to the function!
if we set typ as 1 then it takes info added into the csname & act variables only! [SceneAction] if we set typ as 2 then it takes info added into the csname, objname & act variables! [scene, ObjAction] if we set typ as 3 then it takes info added into the csname & act variables only! [CharacterAction]
I don't think it will work properly if you don't add any text into the objname tab if not required so just add nil or whatever.
I suppose I could make this simpler by having a different function for each type of getObject as opposed to relying on if else statements but it does mean we would have to create unique code for each function.
-- * notes * --
-- some quick examples of startAction() | stopAction()
-- start action has a return value so we'll do a version for that too!
-- execute startAction in an object action like so: start_action(typ, csname, objname, act)
-- execute stopAction in an object action like so: stop_action(typ, csname, objname, act)-- * function variables * --
-- typ = int{1,2 or 3} - (1(sceneAction), 2(scene,objectAction), 3(characterAction))
-- csname = string (nil or character|scene name)
-- objname = string (nil or scene object name)
-- act = string (action name)
-- * example * --
-- startAction(3, Robert, nil, play_sound) -- starts "play_sound" found via character Robert's action tab!
function start_action(typ, csname, objname, act)
-- local variables!
local act1 = getObject('Scenes[' .. csname .. '].SceneActions[' .. act .. ']')
local act2 = getObject('Scenes[' .. csname .. '].SceneObjects[' .. objname .. '].SceneActions[' .. act .. ']')
local act3 = getObject('Characters[' .. csname .. '].CharacterActions[' .. act .. ']')
if typ == 1 then
if startAction(act1) then print('SceneAction ' .. csname .. ', ' .. act .. ' has been started!') end
else
if typ == 2 then
if startAction(act2) then print('SceneAction ' .. csname .. ', ' .. objname .. ', ' .. act .. ' has been started!') end
else
if typ == 3 then
if startAction(act3) then print('CharacterAction ' .. csname .. ', ' .. act .. ' has been started!') end
end -- typ = 3
end -- typ = 2
end -- typ = 1
function stop_action(typ, csname, objname, act)
local act1 = getObject('Scenes[' .. csname .. '].SceneActions[' .. act .. ']')
local act2 = getObject('Scenes[' .. csname .. '].SceneObjects[' .. objname .. '].SceneActions[' .. act .. ']')
local act3 = getObject('Characters[' .. csname .. '].CharacterActions[' .. act .. ']')
if typ == 1 then
stopAction(act1)
print('SceneAction ' .. csname .. ', ' .. act .. ' has been stopped!')
else
if typ == 2 then
stopAction(act2)
print('SceneAction ' .. csname .. ', ' .. objname .. ', ' .. act .. ' has been stopped!')
else
if typ == 3 then
stopAction(act3)
print('CharacterAction ' .. csname .. ', ' .. act .. ' has been stopped!')
end -- typ = 3
end -- typ = 2
end -- typ = 1
I know what's wrong with my code - I will upload the amended version later after I've cooked dinner
I forgot to make them strings & we need to separate the local variables too or else they throw errors at us but never fear as I ken what to do now!
Safe
P.S no idea what's going on with the formatting of the content inside the Spoiler tags ... will see if Calli can sort it out
I've added various tweaks & fixes to it ... º active handle image on mouse button hold * º play sound/speech file when mouse button released depending on current vol type º play sound/speech file after clicking plus/minus buttons depending on current vol type º added a simple fix to prevent the sliders randomly moving ** º added some print statements - feel free to -- comment them out!
* this was a right twatters'n'maddison to add as it didn't like my if else statement to define which animation to re-position & it also didn't like swapping animations within the same object - both gave me many errors so I worked around by adding secondary slider objects with the required animation frames. also I had to include a separate setVolConPos for the plus/minus buttons otherwise we got errors about missing objects due to the active handle animations being inactive.
** sometimes the sliders seemed to stick & would continue to move with the mouse even if you wasn' t in the slider area anymore or it didn't seem to register mouse button released.
-- * --
I will sort out a thread with screenshots to explain how it all works the morrow as it's late now - or early depending on how you view/regard time - & I'm a wee bit knackered!
but for now you can check out the project file I included in the spoiler
I've added an if file exists checker to be executed on game start action which will start a loop which will count the files & add the number into a variable named count ...
continues to loop until file doesn't exist & then prints current amount of saved screenshots & the next screenshot will be screen_(number).png
much better than before as it would have overwritten any files starting from screen_0.png!
check the first post index for the script