Make all units recruitable.fscript 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // FinalAlert2:YR Script file
  2. // Name: Make Vehicle Recruitable
  3. // Written By: Matthias Wagner
  4. // Last Change: August 21, 2001
  5. // Be careful when editing scripts, they may cause damage to maps if used improperly
  6. AllowDelete("Necessary for changing vehicles");
  7. AllowAdd("Necessary for changing vehicles");
  8. Is("%DeleteAllowed%","=","0","%NoDelete%");
  9. Print("Deletion must be allowed for this script to run!","%NoDelete%");
  10. Cancel("%NoDelete%");
  11. Is("%AddAllowed%","=","0","%NoAdd%");
  12. Print("Adding must be allowed for this script to run!","%NoAdd%");
  13. Cancel("%NoAdd%");
  14. Ask("%specified%","Do you want to limit changes to a specific house?","Limit to house");
  15. SetVariable("%House%","");
  16. UInputGetHouse("%House%","House:","%specified%");
  17. SetAutoUpdate("FALSE"); // no screen flickering...
  18. Is("%UnitCount%","=","0","%Abort%");
  19. Cancel("%Abort%");
  20. SetVariable("%TCounter%","%UnitCount%");
  21. // LOOP BEGIN
  22. :Loop:
  23. SetVariable("%pos%","%TCounter%");
  24. Substract("%pos%","1");
  25. GetVehicle("%data%","%pos%");
  26. SetVariable("%Differ%","0");
  27. GetParam("%param%", "%data%", "0", "%specified%");
  28. Is("%param%","!=","%House%","%Differ%","%specified%");
  29. Substract("%TCounter%","1", "%Differ%");
  30. And("%cancelloop%","%Differ%", "%TCounter%");
  31. JumpTo("Loop", "%cancelloop%");
  32. // if we are here, and Differ is set to TRUE, TCounter must be 0, so cancel script.
  33. Cancel("%Differ%");
  34. DeleteVehicle("%pos%");
  35. // recruitable & AI recruitable
  36. SetParam("%data%","12","1");
  37. SetParam("%data%","13","1");
  38. AddVehicle("%data%");
  39. Substract("%TCounter%", "1", "%TCounter%"); // only substract if >=0, else infinite loop!
  40. JumpTo("Loop","%TCounter%");