Community Forum

TipTrigger - InitStaticObjectClass ?

Forum Overview >> Scripting

CategoryScripting
Created27.12.2017 14:55


Andre Nierhaus (Dimer24) 27.12.2017 14:55
Hi
Can I find out exactly how the ".lua" file should look like to register a Tiptrigger ?

I haved all lines from
https://gdn.giants-software.com/documentation_scripting.php?version=script&category=67&class=3389

The lines from the initPricingDynamics are missed.
Lines 417 to 548

I'm unsure about the first three lines

This tree lines from LS 15

TipTrigger2 = {};
TipTrigger2_mt = Class(TipTrigger2, Object);

InitStaticObjectClass(TipTrigger2, "TipTrigger2", ObjectIds.OBJECT_TIP_TRIGGER);

the third line produces an errror: attempt to call global 'InitStaticObjectClass' (a string value)


Thanks in advance for help

Andre Nierhaus (Dimer24) 27.12.2017 16:33
Hi

I believe that I have found the right entries:

TipTrigger2 = {};

local TipTrigger2_mt = Class(TipTrigger2, Object);

InitObjectClass(TipTrigger2, "TipTrigger2");

and the line 1127 g_onCreateUtil.addOnCreateFunction("TipTrigger2", TipTrigger2.onCreate);

Now I have the Problem, that I miss the entries from initPricingDynamics

Error: Running LUA method 'modOnCreate.TipTrigger2'.
C:/Users/andre/Documents/My Games/FarmingSimulator2017/mods/map_Hinterland_17/maps/Import/Scripts/TipTrigger2.lua:284: attempt to call method 'initPricingDynamics' (a nil value)

I hope someone can help me



Note: Log in to post. Create a new account here.