Jump to content
Sign in to follow this  
vader_21vb

Exec scripted enhancement from ccp

Recommended Posts

I'm trying to add script to a Addon, but I can only execute script true "class UserActions", have any found a way to exec script in addon without haveing the player "activating" it true "class UserActions" in the ccp file ?

I was hoping to add i line int the CCP , like :

Initline="[this,""MH-6""] exec ""\Addonname\Sling.sqs""";

Share this post


Link to post
Share on other sites

Hi

Since 1.75

Add your script to the file of your addon alongside your model.p3d and your config.cpp

In the config.cpp of your addon include this

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class EventHandlers

{

init = [this] exec "\YourAddonsNamehere\YourScrptsNameHere.sqs";

};<span id='postcolor'>

config.cpp executable events are listed in the latest command Ref They include things like GetIn, Getout, Fuel, etc

Kind Regards walker

Share this post


Link to post
Share on other sites

thanx , it works, now I only need to find a way to get the Object name of my addon transfered to the script, cos "this" is not the same var anymore..

Share this post


Link to post
Share on other sites

Does that mean that scripts in addons are MP usable? If I include them into the pbo everyone who uses the addon will have the script and so can run it (if it is run from the init line of the config.cpp).

For instance, if I want to change the textures of an addon with only one p3d file I could make selections in Oxygene, define them in the CfgModels section, add a script.sqs to the pbo file with a line like this for every texture - selection:

vehicle setObjectTexture [hidearrayindex,texturename]

and add this Init-Line thing to the config.cpp, which will run the script.

And if someone would place the addon in the editor it would swap the files if the addon is used...

But does it work in MP?

Joe

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (PSC @ Dec. 12 2002,22:24)</td></tr><tr><td id="QUOTE">But does it work in MP?<span id='postcolor'>

Unfortunatelly it does not. Init event handler is executed only ony the computer that owns the unit.

Share this post


Link to post
Share on other sites

Ok, thanks. Thats what I was fearing (since it was written in that other topic). But sometimes I'm a bit slow regarding some things (especially script/code things). Thats why I asked again to be 100% sure. Thanks again.

xmas.gif Fröhliche Weihnachten xmas.gif ach ham wir ja noch gar nicht...

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
Sign in to follow this  

×