Forum Jump :

Author Message


Posts: 1

Level: Member

Country: ro
In-game name:

#1 Posted at 2012-07-14 18:24        
Good morning guys,

Me and my friend have been trying to make a sensor ball script. The problem is that in order for the script to work, we have to set an init code. I was wondering if there's any way to include the init code in the config.cpp file so that we won't have to add it manually in every mission. Also, we would like to put the objects in an ammobox. I have tried the eventHandlers class, but I don't think I used it correctly, since it doesn't work. Forgot to mention that I only started looking into making addons 3 days ago, so I'm lacking a lot of knowledge .

These are the config.cpp files I made.

1. Manual init.
2. no init, ammobox.

I managed to get around the need of the init code by adding the options directly to the object. CODE :
I had dug a bit deeper and I found out that you can't assign UserActions to items from the CfgWeapons/CfgMagazines/CfgAmmo classes. Is there any way to work around it ? Like modifying the existent CfgMagazines classes such as HandGrenade_stone, and adding actions directly ?

Something that would help me even more would be giving the items inside CfgVehicles the ability to be put in the unit's inventory and ammoboxes.

And in the end, if neither of the above is possible, can you apply the unit initialisation code in the config.cpp of the object. Or is there a coding equivalent of the "this" command from the mission editor, that sends reference from the object to the script ? I'm asking because in order to make our carry script work we have to send an array of information to the script, and select the mandatory pieces of information using the select 0/1/2 command.

Any suggestion is much appreciated. Thanks in advance !

Tags: Code, Config, Cpp, Init