while we are on the subject, WRECK has also trouble with the module_skins, when you add new races it makes a line spacing too much which leads to the openbrf error messages/not working. DSTN can confirm this.
tocan — 03.12.2020
don't let wreck proceed the sounds file, it's the easiest solution.
Provide sample of code and screenshot of error, please.
while we are on the subject, WRECK has also trouble with the module_skins, when you add new races it makes a line spacing too much which leads to the openbrf error messages/not working. DSTN can confirm this.
skel_human 1.000000
2 3
0
zombie 0
man_body dummy_mesh zombie_m_handL
skel_human 1.000000
2 3
0
zombie 0
man_body dummy_mesh zombie_m_handL
(val_divup, <destination>, <value>), # Divide destination with round up. Negatives will be rounded down.
(store_divup, <destination>, <value1>, <value2>), # Divide destination := value1/value2 with round up. Negatives will be rounded down.
def val_divup(destination, value, *argl):
return [
(assign, l._sign_, destination),
(val_abs, destination),
(val_div, l._sign_, destination),
(assign, l._y_, value),
(val_mul, l._sign_, l._y_),
(val_abs, l._y_),
(val_div, l._sign_, l._y_),
(val_add, destination, l._y_),
(val_sub, destination, 1),
(val_div, destination, l._y_),
(val_mul, destination, l._sign_),
]
def store_divup(destination, value1, value2, *argl):
return [
(assign, l._sign_, value1),
(assign, l._y_, value2),
(assign, l._x_, value1),
(val_abs, l._x_),
(val_div, l._sign_, l._x_),
(val_mul, l._sign_, l._y_),
(val_abs, l._y_),
(val_div, l._sign_, l._y_),
(val_add, l._x_, l._y_),
(val_sub, l._x_, 1),
(store_div, destination, l._x_, l._y_),
(val_mul, destination, l._sign_),
]
str_register_s4 = 4
"{!}{s4}"
import __main__
if __main__.__file__ == 'compile.py':#This is WRECK compiler?
for mission in mission_templates:
mission[5].append(*global_common_triggers)
#process_factions.py
relations[other_pos][i_faction] = rel[1]
relations[i_faction][other_pos] = rel[1]
python compile.py tag cap fac %1 %2 %3 %4 %5 %6 %7 %8 %9
(lt, -1, id),
import re
from compiler import *
from header_common import reg0 as reg0
register_plugin()
cur_reg = 64
def str_print(s, *argl):
global cur_reg
if s == "":
return
p = re.compiler"{?([:$][a-zA-Z_]\w*)\b}?")
cur_reg = 64
assigns = []
def replacer(match):
global cur_reg
val = match.group(1)
cur_reg -= 1
assigns.append( (assign, reg0+cur_reg, val) )
return "{reg" + str(cur_reg) + "}"
s = re.sub(p, replacer, s)
if s[0] != "@":
s = "@" + s
return assigns + [(display_message, s)]
extend_syntax(str_print)
(timeout, 1000, "script_xyz", ":var", 2),
from compiler import *
register_plugin()
def timeout(time_ms, script_no, *argl):
res = [
(lua_push_int, time_ms),
(lua_push_int, script_no),
]
for arg in argl: res += [(lua_push_int, arg)]
res += [
(try_begin),
(lua_call, "@timeoutAdd", 2 + len(argl)),
(try_end),
(lua_set_top, 0),
]
return res
extend_syntax(timeout)
local timeouts = {}
function timeoutsTick()
if #timeouts == 0 then return end
local t_now = game.store_mission_timer_a_msec(0)
for i = #timeouts, 1, -1 do
if timeouts[i].t <= t_now then
game.call_script(timeouts[i].script, unpack(timeouts[i].args))
table.remove(timeouts, i)
end
end
end
function timeoutAdd(time, script_no, ...)
table.insert(timeouts, { script = script_no, t = game.store_mission_timer_a_msec(0) + time, args = {...} })
end
(0, 0, 0, [], [(lua_call, "@timeoutsTick", 0), (lua_set_top, 0)]),