bmgarcangel 0 Posted December 13, 2003 How can I make it so that shells will fly out of my static guns when I fire them? Share this post Link to post Share on other sites
BraTTy 0 Posted December 14, 2003 This line in the cfgammo part of the cpp: cartridge="FxCartridge"; of course change to your p3d model of the cartridge that you would like to use cartridge="/addonname/MyCartridge.p3d"; cartridge should expel from the weapons O2 vertexs im memory LOD "nabojnicestart" and "nabojniceend" If you have a plane for example and cartridges don't expel (well wouldn't from more than one point anyways) You can "camcreate" or "drop command" at various locations Share this post Link to post Share on other sites
bmgarcangel 0 Posted December 15, 2003 It doesn't work that way for a Static Machine Gun or a static gun I already know how to do it with regular guns that you run around with, but how'd you do it for a static gun Share this post Link to post Share on other sites
oyman 0 Posted December 16, 2003 well im thinking u can use BAS's shell ejection scirpt they use for the blackhawks modify it to make work with your gun maybe give it a setvelocity thing to make shells fly and i think thats all this is a hypothesis so i dont know if it will work Share this post Link to post Share on other sites
bmgarcangel 0 Posted December 18, 2003 ok.........and how exactly do I do this? Share this post Link to post Share on other sites
oyman 0 Posted December 18, 2003 uhhhh.......... i dont know,not that big in scirpting maybe someone else can answer Share this post Link to post Share on other sites
Bullz_eye_on_my_back 0 Posted December 27, 2003 Well, I might be able to help some. There might be 2 different ways with the scripting. 1. createvehicle command 2. Drop command It has been a very long time since I've scripted so it might not be entirely right on this createvehicle command example. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _mg= _this select 0 _dr= (getdir _mg) _xn= <your variable> _xm= <your variable> _yn= <your variable> _ym= <your variable> _zm= <your variable> _xs= <your variable> _ys= <your variable> _zs= <your variable> _xcord = (getpos _mg select 0) _ycord = (getpos _mg select 1) _zcord = (getpos _mg select 2) _bullet = "<name of shell here>" createvehicle [(_xcord)+_xm*sin((_dr)-90)+_xn*sin(_dr), (_ycord)+_ym*cos((_dr) -90)+_yn*cos(_dr),(_zcord)+_zm] _bullet setdir (_dr) _bullet setvelocity [_xs*sin(_dr), _ys*cos(_dr), _zs] exit The variables and the name of the shell should be changed to make it work. I can't remember if both of the sine and cosine functions are needed instead of one of each. It's been a while and i think i had set this code up for an airplane with banking and pitch. To implement this code I would first set up a "fired" event handler in the game for the machine gun and have it call this script. This way you can tweak the variables easier to make the cartridge come out at the right place and its velocity coming out right. Then just set up a "fired" event handler within the config file to reference your script and then pack it all up. The second way takes a little amount of scripting. I'm not sure if its totally possible but i'm pretty sure it can be done easily once you get the right syntax. I can't remember how to do it so you will need to go look up the "drop" tutorial for the scripting. The advantage of using the "drop" command is that it can be set in relation to the object and not the found positions. It also takes in acount the pitch and roll of the object and "cleans" itself up easily. With "drop" you can control what the object is, how fast it flies out and how fast it falls, how long the object will appear and so on. This is all done with one line of script. The first script can be less than perfect, because the given height of an object is not always exact in the game. It is based off of interpilation on different verteces creating the terrain, and around beaches and bridges it will almost never work correctly, because of the height bug. Share this post Link to post Share on other sites
Trenchfeet 0 Posted December 27, 2003 hi bulz long time no see! you should download my latest version on the p51 and the missions pack from my site (link below) to refresh you mind on that script if you want? Share this post Link to post Share on other sites
Bullz_eye_on_my_back 0 Posted December 27, 2003 Sounds great Trench! By the way, great job on the latest set of planes!! I can't wait to see what you come out with next. I do have a project or two that will help make the skies of WWII even more realistic and challenging. I just need to get a texturer and finish one script Share this post Link to post Share on other sites
BraTTy 0 Posted December 30, 2003 Heyz Trenchfeet and Bullz_eye... we need to get together and do something super Hows your projects coming bmgarcangel ? Share this post Link to post Share on other sites
Bullz_eye_on_my_back 0 Posted December 30, 2003 Sounds great to me.... I've got some addons but I'm stuck on one section of scripting. Everything has been tested over and over so they do work, its just one feature I can't get to work. Bratty you know the event handlers in the config files very well. Can Houses have a "hit" or "dammaged" handler placed in the config file?? I've tried it several differnt ways, but no matter what ..I shoot the object and it never runs the script. The "init" script works when i tested it. What I'm trying to do is set up a string for that particular object. Initially its a public string with that selection (for that object) is equal to zero. Once it gets shot or hit.. the script will be accessed and it will either destroy the object (depending on damage) or if the damage is minimum it will heal it back to full health but will increment the string variable up by 1...so at a certain point ...say 4 hits no matter whether its destroyed or not it will be destroyed by the script. When i look at it.. it should all work, but it doesn't access the script when hit Share this post Link to post Share on other sites
BraTTy 0 Posted December 30, 2003 Its the hit and dammaged eventhandler,thats the way they work. Takes a substantial hit to activate from my testing,I was going to use it for smoke and such on my planes but normal plane mgun bullets hitting them hardly set it off. I ended up using the "init" and just checking the dammage level and from reading I gather that "getdammage" isnt reliable on all machines in mp game possibly? Share this post Link to post Share on other sites
Bullz_eye_on_my_back 0 Posted December 31, 2003 hmmmm...very good explination. Now I'm not sure exactly what to do on it. I might try and do the getdammaged but have a "killed" event handler set up too-just incase. I just wish that the handler was processed before the killed result started. Share this post Link to post Share on other sites