Jump to content
Reeveli

Creating ACE chemlight via script

Recommended Posts

Okay so I have given each player a custom action to spawn a chemlights on their position so they can drop them under water:

 

"Chemlight_green" createVehicle getPos player;

This works great for vanilla items but for some reason anything ACE won't spawn this way, like" ACE_Chemlight_HiYellow", "ACE_Banana" or "ACE_Chemlight_IR". Any idea why this is? I had my friend replicate this so it isn't an issue just on this particular script.

Share this post


Link to post
Share on other sites

ACE_G_Chemlight_HiYellow

ACE_bananaItem

 

The classname of an item in your inventory is not necessarily the same as the classname of that item "in the world."

Share this post


Link to post
Share on other sites
1 hour ago, Harzach said:

ACE_G_Chemlight_HiYellow

ACE_bananaItem

 

The classname of an item in your inventory is not necessarily the same as the classname of that item "in the world."

Thanks for the info, where does one get the proper class names? Used the ACE Class names list to get these.

Share this post


Link to post
Share on other sites

There are many ways. You can look in the editor, either at the mouseover dialog in the object list, by logging classes of a placed object (right-click > log > log classes), you can look through the configs, or check the classname of the relevant object in the world in some way.

 

For the ACE banana, I just looked at the class in the editor. For the chemlight, I grabbed the ammo class with a fired eventhandler:

player addEventhandler ["fired",{copyToClipboard format["%1",(_this select 4)]}];

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×