Home   Help Search Login Register  

Author Topic: Assignning vehicle with object id, netstats, scripting error  (Read 5767 times)

0 Members and 1 Guest are viewing this topic.

Offline Cougarxr7

  • Members
  • *
Re: Assignning vehicle with object id, netstats, scripting error
« Reply #15 on: 20 Jun 2009, 15:31:58 »
Worldeater,
 I found where I can access the vehicle respawn. I blocked out /* */the default area of respawn so no vehicles could respawn and added this,
Code: [Select]
_ag = ["Vulcan","M1Abrams","Stryker_TOW","Stryker_ICV_M2","Stryker_ICV_MK19","AH1W","UH60MG","HMMWV50","HMMWVMK","HMMWVTOW","firebird","Cobra1"];

if(_vcl isKindOf "Air") and (_died and (damage _vcl) == 1) then{
deleteVehicle _vcl;
if(_ag == "AH1W") then {
_ag = [x,firebird,60,"AH-1Z"]spawn {[_this select 0,_this select 1,_this select 2,_this select 3] execVM "scripts\addGetInEH.sqf"};
hint"THIS IS WORKING, HELO SHOULD RESPAWN!";
_vcl = _class createVehicle _respawnpoint;
_vcl setpos _respawnpoint;
_vcl setdir _azimut;
_vcl = typeof _x;
I set myself as not allowed,get rejected like I should, then blow up the Cobra and it would not respawn!
I'm not even getting the hint.  I am not getting any script errors! But that block of code did not work!<dang!
 Being that I am not a scripter, I have given it a shot. Can you see why this did not work?
Thanks!
« Last Edit: 20 Jun 2009, 17:20:49 by Cougarxr7 »
If this thread is in volation of forum rules , please delete.

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: Assignning vehicle with object id, netstats, scripting error
« Reply #16 on: 30 Jun 2009, 09:32:08 »
Uhm, yes... :)

  • There are two curly brackets missing. Remember: There is no such thing as a single bracket in coding. They always come in pairs!
    Quote
    if (...) then {
        ...
    }; // <--- Missing!
  • _ag will never be equal to "AH1W" because it's set to something else in line #1.
  • In line #6 you're using a variable named x. I'm pretty sure it should be _x instead.
  • Are you sure that's where the respawn is handled? Did you verify it (by adding a hint for example)? Do not underestimate the amount of  so called "dead code" in some projects (that is: code that's never used but wasn't removed).
try { return true; } finally { return false; }

Offline Cougarxr7

  • Members
  • *
Re: Assignning vehicle with object id, netstats, scripting error
« Reply #17 on: 01 Jul 2009, 07:44:15 »
Worldeater, I missed those braces when I copied the code they are there. ::)
_ag being set to all those units. I thought by the statement "if(_ag == "AH1W") ", it's asking if ag is set to that, which it is and it would return 'true'. Totally missed the _ on x.
The vehicle code was calling for code to set the vehicle up for needing repairs is call EVO_VecR'.
By changing it to call EVO_VecRm', it would respawn.
I have moved on to other projects in Arma2 however, I will still be looking into this.
I have come acrossed some code concerning vehicles respawning and I hope to have this figured out soon.
Thanks for all your help! I am sure there will be more from you in Arma2!
If this thread is in volation of forum rules , please delete.