ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
Registering "AMMO" class in class_registrator.script

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  22:30:06  11 September 2013
profilee-mailreply Message URLTo the Top
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?
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2019 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.