Xplorer4x4 Posted October 1, 2009 Report Share Posted October 1, 2009 I am trying to modify the SWAT Heavy Rescue into an LAPD Bomb Squad truck as LAPD has a similar truck. I cant quite figure out the correct code for it but i should be close.Heres what I tried:if (StrCompare(v.IsValid() && !v.IsDestroyed() && StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p") == 0) || (v.IsValid() && !v.IsDestroyed() || StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/pierce_bomb_squad.e4p") == 0))if (StrCompare(v.IsValid() && !v.IsDestroyed() && StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p") == 0) && (v.IsValid() && !v.IsDestroyed() || StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/pierce_bomb_squad.e4p") == 0))if (v.IsValid() && !v.IsDestroyed() && StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p") == 0 && v.IsValid() || !v.IsDestroyed() || StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/pierce_bomb_squad.e4p") == 0)if (v.IsValid() && !v.IsDestroyed() && StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p") == 0 && v.IsValid() && !v.IsDestroyed() || StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/pierce_bomb_squad.e4p") == 0)So far none of these have worked but none have crashed my game. Any ideas? Quote Link to comment Share on other sites More sharing options...
pyrothijs Posted October 1, 2009 Report Share Posted October 1, 2009 I am trying to modify the SWAT Heavy Rescue into an LAPD Bomb Squad truck as LAPD has a similar truck. I cant quite figure out the correct code for it but i should be close.Heres what I tried:So far none of these have worked but none have crashed my game. Any ideas?Can't you just add the commands from the bomb squad truck to the swat truck and delete the swat commands? Also just delete the swat personel and add the bomb squad personel to the vehicle. That should do the trick I think. Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 1, 2009 Author Report Share Posted October 1, 2009 No, there is no command for the actual vehicles regarding the robot. When i checked the bomb squad suv it just had a few simple commands like vcmdlfashing light, hazard light,return to HQ, and like two more generic commands. BTW, The swat heavy rescue doesnt have deploy swat commands or anything like that. Im talking about this SWAT truck btw:http://farm4.static.flickr.com/3410/363818..._a9976572bb.jpg Quote Link to comment Share on other sites More sharing options...
Newfoundking Posted October 1, 2009 Report Share Posted October 1, 2009 A good few commands are scripted to not be added to a vehicle, until another one is used, like the fire sation alarm panel, you look, and I do believe it's just vcmd alarm or something to that effect... As for the bomb robot, I do believe it's vehicles are included in the script.. Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 1, 2009 Author Report Share Posted October 1, 2009 Yep first thing i did was check for a command, but since there isnt one, it wouldnt work Quote Link to comment Share on other sites More sharing options...
Newfoundking Posted October 1, 2009 Report Share Posted October 1, 2009 LABombRobot.scriptYes there is one... it includes :// - PcmdRobotGet// - PcmdRobotRemove// - PcmdRobotSendTo // - PcmdRobotUse// - PcmdDummyRobotpart in regards to the getting of the robot from what vehicle...Vehicle v(Target); if (v.IsValid() && !v.IsDestroyed() && StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p") == 0) { return true; } return false;I do believe that's it Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 1, 2009 Author Report Share Posted October 1, 2009 Well let me rephrase that, theres no command to simply put the robot in a vehicle. Then again there never is for equipment so I suppose that makes since. Nor is there a simple option to add it in the equipment section of the unit.xml because the bomb squad SUV has no equipment listed in the unit.xml. Quote Link to comment Share on other sites More sharing options...
pyrothijs Posted October 2, 2009 Report Share Posted October 2, 2009 Well let me rephrase that, theres no command to simply put the robot in a vehicle. Then again there never is for equipment so I suppose that makes since. Nor is there a simple option to add it in the equipment section of the unit.xml because the bomb squad SUV has no equipment listed in the unit.xml.Isn't it automaticly spawned when you click the right vehicle with the bomb squad guy? So if you added the swat truck to the list of vehicles and you select that vehicle with the bomb squad guy it should display a 'get robot' command. Since the bomb squad guy isn't holding the robot I'm guessing the robot just spwans next to the vehicle. I'm not sure you need to add it as equipment to the vehicle. Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 2, 2009 Author Report Share Posted October 2, 2009 No it has to be coded in to the script. It cant just be added to freeplaybase. Otherwise, you can get the bomb squad guy out of the truck, click get bomb robot, but when you hover over the truck the icon gets a big red X on it, where as it doesnt have the red X on the bomb suqd suv even if I got the guy out of the SWAT truck.Its not considered equipment in terms of a unit.xml file. Quote Link to comment Share on other sites More sharing options...
pyrothijs Posted October 2, 2009 Report Share Posted October 2, 2009 No it has to be coded in to the script. It cant just be added to freeplaybase. Otherwise, you can get the bomb squad guy out of the truck, click get bomb robot, but when you hover over the truck the icon gets a big red X on it, where as it doesnt have the red X on the bomb suqd suv even if I got the guy out of the SWAT truck.Its not considered equipment in terms of a unit.xml file.I didn't say you could 'just' add it to the freeplay base. Of course you would have to at least at the SWAT van to the 'getrobot' script and you would have to change the units file so that the swat van can carry bomb squad guys. Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 2, 2009 Author Report Share Posted October 2, 2009 My bad. You said"So if you added the swat truck to the list of vehicles" so i thought you meant just the freeplaybase. The section of code I am modifying IS from the get robot script, and thats why I posted this thread as I cant quite figure out how to get the script to recognize both vehicles. The unit folder and xml is done. The truck in game and working fine except for housing the robot on it. Quote Link to comment Share on other sites More sharing options...
pyrothijs Posted October 2, 2009 Report Share Posted October 2, 2009 My bad. You said"So if you added the swat truck to the list of vehicles" so i thought you meant just the freeplaybase. The section of code I am modifying IS from the get robot script, and thats why I posted this thread as I cant quite figure out how to get the script to recognize both vehicles. The unit folder and xml is done. The truck in game and working fine except for housing the robot on it.Strange, I have a paper due next week, but after that I'll try and look into it. Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 2, 2009 Author Report Share Posted October 2, 2009 Ok hopefully Hoppah gets back to me on this later. Its a very small change neededThe original code was: if (v.IsValid() && !v.IsDestroyed() && StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p") == 0) { return true; } return false; } } Quote Link to comment Share on other sites More sharing options...
Hoppah Posted October 2, 2009 Report Share Posted October 2, 2009 Alright. Because I had a good time at school today I will write a full explanation of this simple code:Vehicle v(Target); if (v.IsValid() && !v.IsDestroyed() && StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p") == 0) { return true; } return false;What does this means in normal words?:Vehicle v(Target); The target of the command is a vehicle and defined as 'v'.Then you get 'if' and a '(' as the opening symbol.The code can be read as: "if v is valid AND v is NOT destroyed AND v has the same prototype as 'suv_bomb_squad.e4p'".If these checks return true the command will be executed (return true;) if one of these codes do not return true it won't (return false;)Theory (homework):The && symbols litteraly means ANDA ! symbol means the opposide and can be read as NOTNot present in the code above but also important: || symbols litteraly means ORStrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/swat_truck.e4p") == 0 is 1 code (comparison function) and should not be changed.So what do you need to do?Instead of comparing v to only 1 prototype it also needs to compare it to the swat truck. To make the code return true v needs to either match suv_bomb_squad.e4p OR swat_truck.e4p.So the new code is going to be:Vehicle v(Target);if (v.IsValid() && !v.IsDestroyed() && (StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p") == 0 || StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/swat_truck.e4p") == 0)){ return true;}return false;Notice the || symbols, because v needs to match one of them and not both. If you would have used the && symbols instead of || the code can never return true because it can't much two prototypes, but only 1 of them. Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted October 2, 2009 Author Report Share Posted October 2, 2009 Thanks, Hoppah. I knew that the symbols mentioned(|| and &&) were needed to make an "or" but couldnt recal which was which, and I knew about ! all through years of working with php but I havent worked with php much for a year or two, so I am bit rusty, However I didnt quite read the V(traget) right when I was reading the code but i get it know.I wasnt as close as I thought, but I was on the right track. Thanks a million Hoppah! Keep up the good work. Quote Link to comment Share on other sites More sharing options...