Skip to content

parallax

This class cannot be accessed unless you are using fantasy.parallax2. This class and the related functions are not in the FC2 engine. Parallax2 however uses the FC2 Lua module and imports custom functions to allow these to exist.

This is why this class is undefined in solutions that are not Parallax2. This class is automatically passed as a global class in Parallax2. At the same time, you still have access to other modules and classes in FC2.

update

Type

function

Description

This function updates your configuration on the kernel driver. You must launch Parallax2 with editor_mode on for this to work. If it is off, this function will return false.

By default, this function calls an API method. If used inappropriately, this function can get you banned from the Web API for spam. Alternatively, Cloudflare may block you instead. By providing a table argument, you can pass direct modifications to the configuration and send it to the driver without API spamming. See the second example.

Parameters

  • table configuration (optional)

Returns

  • boolean

Example (Cloud)

Lua
1
2
3
4
5
6
7
-- save our configuration to cloud
fantasy.configuration():save()

-- let parallax2 load our configuration from cloud, then send it to the driver.
if parallax:update() then
    fantasy.log( "configuration sent to kernel driver" )
end

Example (Direct)

Lua
-- pass direct configuration values to the driver. you don't need to pass each configuration setting. this is only an example
local result = parallax:update({
    editor_mode = true,
    delay = 100,
    release_delay = 20,
    max_delay_random = 100,
    max_release_delay_random = 100,
    enabled_on_loaded = true,
    max_jitter = 5,
    panic = 36,
    activate = 20,
    mod = 160
})

if result then
    fantasy.log( "configuration sent to kernel driver" )
end