smoq2
Forklift operator (Resident)
 On forum: 09/08/2008
 Message edited by: smoq2 09/12/2013 10:08:25
Messages: 2433
|
Registering "AMMO" class in class_registrator.script
I really want to bind the AMMO class to a script file, so that I could have the on_register() function for this item, however I have some problems doing so. This is what I added to class_registrator.script:
cs_register (object_factory, "CGameObject", "se_item.se_ammo", "AMMO", "wpn_ammo")
And an excerpt of my added class from se_item.script.
class "se_ammo" (cse_alife_item_ammo)
function se_ammo:__init (section) super (section)
end
function se_ammo:on_register()
cse_alife_item_ammo.on_register( self )
task_manager.get_task_manager():register_target(self)
if registred_items[self:section_name()] == nil then
registred_items[self:section_name()] = 1
else
registred_items[self:section_name()] = registred_items[self:section_name()] + 1
end
TFW_economy.add_to_smart(self)
end
function se_ammo:on_unregister()
cse_alife_item_ammo.on_unregister( self )
task_manager.get_task_manager():unregister_target(self)
end
The problem is, it doesn't seem to do anything. The scripts don't run, so I'm not sure if it gets registered properly. Can someone help me with this?
The page you need in the public telephone booth will always be missing.
The pendulum spins clockwise...
Current project:
S.T.A.L.K.E.R: The Faction War
https://www.gsc-game.com/main.php?t=community&s=forums&s_game_type=xr2&thm_id=22757&page=1&sec_id=22&sort=ASC&no_transl=#307619
|