Scud 0 Posted April 29, 2004 Been stuck on this for 3 weeks and just about ready to spit the dummy. When rockets are fired they dissapear then reapear when reloaded. All this works fine so I assume the game is reckonizing my weapon and ammo. for this I use  "_ffcount = (_plane ammo "O1_Rockets")" Now what I want is simply to follow fired rocket to impact point then do fancies with smoke etc. Yes there are post (several different suggestions) on this and yes I have tried (all of them) the coding letter for letter. and as Footmunch suggested I put in "player globalchat format["%1", _rocket];" to see where things are working or not  usual err returned is "Scalar bool array string 0xfcffffef". This is from cfg.cpp Quote[/b] ]class CfgAmmo{             class Default {}; class AT3: Default {}; class Hellfire: AT3 {}; class Zuni: Hellfire {}; // rocket (unguided) class o1_Rockets:Zuni { soundHit[]={Explosions\expl2,db40,1}; hit=400;indirectHit=250;indirectHitRange=3; }; }; class CfgWeapons { class Default{}; class LAWLauncher: Default {}; class CarlGustavLauncher : LAWLauncher {}; class AT3Launcher: CarlGustavLauncher {}; class HellfireLauncher: AT3Launcher {}; class MaverickLauncher: HellfireLauncher {}; class ZuniLauncher38: AT3Launcher {}; // Unguided Rockets Launcher class O1_Rockets : ZuniLauncher38 { scopeWeapon = public; scopeMagazine = public; ammo=o1_rockets; displayName="WP Rockets"; // displayNameMagazine=$STR_MN_FFAR; // shortNameMagazine=$STR_SN_FFAR; count=4; reloadTime=0.5; aiRateOfFire=2; // delay between shots at given distance aiRateOfFireDistance=1000; // at shorter distance delay goes lineary to zero sound[]={Weapons\rocket1,db-30,1}; reloadSound[]={Weapons\missload,db-70,1}; initSpeed=44; // magazine=4; //magazineReloadTime=2; autoFire = true; }; }; Anyway if some1 can hlp with this would be good Will post more info if needed. thanx Share this post Link to post Share on other sites
Rastavovich 0 Posted April 29, 2004 How you try to detect the missile, I mean how do you set the variable _rocket? Share this post Link to post Share on other sites
Scud 0 Posted April 29, 2004 Quote[/b] ]_plane = _this select 0_weapon = _plane select 1 _Rocket = nearestobject[_plane, "o1_rockets"] player globalchat format["%1", _rocket]; checking #getrocketposloop _impactpoint = getpos _Rocket ~0.01 player globalchat format["%1", _impactpoint]; checking ?(not alive _Rocket):[_plane, _impactpoint] exec "\birddog\williep.sqs" goto "getrocketposloop" exit This is what I have now which I think Footmunch suggested in other post. Just tried it then and I am getting a co-ords printout now on the checking text instead of an err. So now its just a case of transferring the co-ords to the next step being the drop command. This is brief example Quote[/b] ]_plane = _this select 0 _impactpoint = this select 1 _o1rxpos = (this select 1) select 0 _o1rypos = (this select 1) select 1 _o1rzpos = (this select 1) select 2 ;       shape       type   time life           pos             vel   rtte w  v fric size  colour     drop ["cl_basic", "", "Billboard", 15, 30, [_o1rxpos,_o1rypos,_o1rzpos], [0,0,1], 0, 0.05, 0.1, 1, [30],[[0, 1, 0, 1]],[1,1,1],1,1,"","",???] Now I am not real sure on what goes in the last section should it be _plane or _impactpoint or other?? or is the whole thing screwed? Share this post Link to post Share on other sites
Rastavovich 0 Posted April 29, 2004 well, the last section let you link the dropcommand to a certain object, in your case it would be quite good to link it to the missile itself. You don't have to pass the plane as parameter, since it doesnt give you any usefull information here. Your code should be <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _mis = _this select 0; missile drop ["cl_basic", "", "Billboard", 15, 30, [0,0,0], [0,0,1], 0, 0.05, 0.1, 1, [30],[[0, 1, 0, 1]],[1,1,1],1,1,"","",_mis] exit Since I assume you want a constant drop of cloudlets you maybe should loop the dropcommand until the missile is destroyed (or a certain time untill the motor has burned out). Share this post Link to post Share on other sites
Scud 0 Posted April 29, 2004 Thanx Rastavovich Will give it a try with that. Share this post Link to post Share on other sites
Footmunch 0 Posted April 29, 2004 Scud - This is for the Willy Pete rockets, right? In which case, a good method is to 'createvehicle' a BIS smoke grenade at the _impactpoint. When that works, you can create your own smoke grenade (derived from the BIS one) and change the colour, density, lifetime etc. So, williep.sqs looks like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _plane = _this select 0 _pos = _this select 1 _gren = createvehicle "SmokeGrenade" [_pos select 0, _pos select 1] ; I think SmokeGrenade is wrong - check the commented configs. exit Also, there's a slight flow error in your impact finding code: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_plane = _this select 0 _weapon = _plane select 1 _Rocket = nearestobject[_plane, "o1_rockets"] player globalchat format["%1", _rocket]; checking #getrocketposloop _impactpoint = getpos _Rocket ; insert Rasta's smoking code here. ~0.01 player globalchat format["%1", _impactpoint]; checking ?(alive _Rocket): goto "getrocketposloop" [_plane, _impactpoint] exec "\birddog\williep.sqs" exit If you want the rocket to smoke while in flight, then you can use Rastavovich's code. Share this post Link to post Share on other sites
Scud 0 Posted April 29, 2004 Thanx Footmunch smokeshell I think I was using createvehicle orig but I thought that caused probs with Mp - not that I do Mp edited Ok, all this in mind I will see what I can come with. Just don't hold your breath waiting Share this post Link to post Share on other sites
Scud 0 Posted April 30, 2004 didn't use the grenade bit but will impliment it later, all other info helped heaps. Finally got it going - the answer to this problem Quote[/b] ]drop ["cl_basic", "", "Billboard", 15, 30, [_o1rxpos,_o1rypos,_o1rzpos], [0,0,1], 0, 0.05, 0.1, 1, [30],[[0, 1, 0, 1]],[1,1,1],1,1,"","",???] Now I am not real sure on what goes in the last section should it be _plane or _impactpoint or other?? was just to put in _anything and it finally worked. I also changed Quote[/b] ]#getrocketposloop_impactpoint = getpos _Rocket ~0.01 player globalchat format["%1", _impactpoint]; checking ?(not alive _Rocket):[_plane, _impactpoint] exec "\birddog\williep.sqs" goto "getrocketposloop" to Quote[/b] ]#getrocketposloop_x = (getpos _Rocket) select 0 _y = (getpos _Rocket) select 1 _z = (getpos _Rocket) select 2 ~0.01 ?(not alive _Rocket): goto "boom" goto "getrocketposloop" which seems to go ok so I'll leave as is. Thanx again for help Share this post Link to post Share on other sites