
deadlyfighter1000
Joined: Jan 11, 2009
Constantly a threat.
|
Posted: Aug 5, 2011 10:26 PM
Msg. 1 of 14
Here is the part of my script that doesn't work, I have other vehicles + ai that spawn correctly but for some reason these ai don't. Script:
(script continuous Scorpion1 (sleep 10000) (object_create sc1) (ai_place Scorpions/sc1) (vehicle_load_magic sc1 "" (ai_actors Scorpions/sc1)) (sleep_until (= (ai_living_count Scorpions/sc1) 0) 15) (object_destroy sc1) (sleep 5000) ) (script continuous Scorpion2 (sleep 10000) (object_create sc2) (ai_place Scorpions/sc2) (vehicle_load_magic sc2 "" (ai_actors Scorpions/sc2)) (sleep_until (= (ai_living_count Scorpions/sc2) 0) 15) (object_destroy sc2) (sleep 5000) ) (script continuous Scorpion3 (sleep 10000) (object_create sc3) (sleep_until (= (unit_get_health sc3) 0) 15) (object_destroy sc3) )
I have vehicles named sc1,2, and 3 and encounters named Scorpions/sc1,2, and 3. Please help. Thanks.
|
|
|

mapzy18
Joined: Jul 18, 2010
Sup.
|
Posted: Aug 5, 2011 10:36 PM
Msg. 2 of 14
i think you do (object_create_anew scorpions/sc1,2 and 3) i have never used ai_place and i dont make firefight so i may be different? idk let me now
OHHHH you put "object_create" instead of object_create_anew. change that an it should be good Edited by mapzy18 on Aug 5, 2011 at 10:38 PM
|
|
|

deadlyfighter1000
Joined: Jan 11, 2009
Constantly a threat.
|
Posted: Aug 6, 2011 03:31 PM
Msg. 3 of 14
E: Got it all working, but I want to know how I can make my AI use ghosts effectively without spinning around when I set it to AI Flying. They just stand still with AI can side-step so please help. Edited by deadlyfighter1000 on Aug 6, 2011 at 07:31 PM
|
|
|

Lone Warrior
Joined: Dec 14, 2008
-Himalayan Wizard and Mystical Guru of the Mts.-
|
Posted: Aug 8, 2011 08:10 AM
Msg. 4 of 14
Quote: --- Original message by: deadlyfighter1000
E: Got it all working, but I want to know how I can make my AI use ghosts effectively without spinning around when I set it to AI Flying. They just stand still with AI can side-step so please help. Edited by deadlyfighter1000 on Aug 6, 2011 at 07:31 PM Did you place firing positions for the ghost AI? If you have, try copying the values for the elites to the ai that you're using, and it should work. If not, repost with your guerilla settings for your AI.
|
|
|

deadlyfighter1000
Joined: Jan 11, 2009
Constantly a threat.
|
Posted: Aug 8, 2011 02:32 PM
Msg. 5 of 14
Ok, I fixed the problem by making the settings in guerilla identical to the wraith's settings (which worked) and now it works with ai can side-step. So they now effectively drive the ghost and use firing positions.
I have another question though, is it possible to test a vehicle to see if it has any units (ai or player) in the seat?
I am wondering because I want to make it so that all AI will enter & use vehicles on the go, even enemies vehicles. But when they die in the vehicle I want it to be destroyed so that the original AI can respawn with the vehicle.
|
|
|

kirby_422
Joined: Jan 22, 2006
Apparently public enemy number 1?
|
Posted: Aug 8, 2011 02:44 PM
Msg. 6 of 14
Quote: --- Original message by: deadlyfighter1000 I have another question though, is it possible to test a vehicle to see if it has any units (ai or player) in the seat? (vehicle_test_seat <vehicle> <string> (vehicle_driver <vehicle>)) Checks if a vehicle is being driven by its driver. (the string is the seat label, so like g-driver, w-driver, etc)
|
|
|

deadlyfighter1000
Joined: Jan 11, 2009
Constantly a threat.
|
Posted: Aug 8, 2011 02:52 PM
Msg. 7 of 14
Quote: --- Original message by: kirby_422Quote: --- Original message by: deadlyfighter1000 I have another question though, is it possible to test a vehicle to see if it has any units (ai or player) in the seat? (vehicle_test_seat <vehicle> <string> (vehicle_driver <vehicle>)) Checks if a vehicle is being driven by its driver. (the string is the seat label, so like g-driver, w-driver, etc) But that would only test for the specific unit wouldn't it? I want to be able to check if anyone is in the vehicle, and if not, destroy it.
|
|
|

kirby_422
Joined: Jan 22, 2006
Apparently public enemy number 1?
|
Posted: Aug 8, 2011 03:11 PM
Msg. 8 of 14
Quote: --- Original message by: deadlyfighter1000Quote: --- Original message by: kirby_422Quote: --- Original message by: deadlyfighter1000 I have another question though, is it possible to test a vehicle to see if it has any units (ai or player) in the seat? (vehicle_test_seat <vehicle> <string> (vehicle_driver <vehicle>)) Checks if a vehicle is being driven by its driver. (the string is the seat label, so like g-driver, w-driver, etc) But that would only test for the specific unit wouldn't it? I want to be able to check if anyone is in the vehicle, and if not, destroy it. Read it. Its asking it Whomever may be in the seat, is in the seat. Regardless of who the driver is, if the driver is there, it returns true.
|
|
|

deadlyfighter1000
Joined: Jan 11, 2009
Constantly a threat.
|
Posted: Aug 8, 2011 04:01 PM
Msg. 9 of 14
Ok, thanks for your help so far, now I made this script, and I know its gonna look bad. I also know it doesn't work. But I want to know how to fix it, I have never really done a script like this before. Here it is:
(script continuous Spectre2 (sleep 3500) (object_create_anew s2) (ai_place Spectres/s2) (vehicle_load_magic s2 "" (ai_actors Spectres/S2)) (sleep_until (= (ai_living_count Spectres/S2) 0) 15) (sleep 1000) (sleep_until (= (and (= (and (= (vehicle_test_seat s2 "W-driver" (vehicle_driver s2)) 0) 1) (= (vehicle_test_seat s2 "W-passenger" (vehicle_riders s2)) 0) 1) (= (vehicle_test_seat s2 "W-gunner" (vehicle_gunner s2)) 0) 1) true)) (object_destroy s2) (sleep 2000) ) The part that is bolded is the part that doesn't work. I'm not really sure how to do this..
E: It was originally all one line, but halomaps doesn't allow that long of one line to post. Edited by deadlyfighter1000 on Aug 8, 2011 at 04:02 PM Edited by deadlyfighter1000 on Aug 8, 2011 at 04:05 PM
|
|
|

kirby_422
Joined: Jan 22, 2006
Apparently public enemy number 1?
|
Posted: Aug 8, 2011 05:17 PM
Msg. 10 of 14
replace it with (sleep_until (= (or (vehicle_test_seat s2 "W-driver" (vehicle_driver s2)) (vehicle_test_seat s2 "W-gunner" (vehicle_gunner s2)) (vehicle_test_seat s2 "W-passenger" (unit (list_get (vehicle_riders s2) 0))) (vehicle_test_seat s2 "W-passenger" (unit (list_get (vehicle_riders s2) 1))) (vehicle_test_seat s2 "W-passenger" (unit (list_get (vehicle_riders s2) 2)))) 0) 1) vehicle_riders returns an object_list, containing all people in the vehicle. Since warthog has 3 seats, you will have to check 0, 1, 2 to see if any of them are in the seat. I use an or instead of an and, because or will return true if even one of them is true. I wait until the or = false, meaning none of them are true. (that of the 3 possible people for the passenger seat, none of them are, nor is the driver in the driver seat, or gunner in the gunner seat)
|
|
|

deadlyfighter1000
Joined: Jan 11, 2009
Constantly a threat.
|
Posted: Aug 9, 2011 11:54 AM
Msg. 11 of 14
Thanks, I understand how that works and will continue to use it for my maps. So for example for the Scorpion I would have to check vehicle_riders five times, one for each seat right?
E: Another question, I want to know how to make AI enter vehicles that are near them, within a distance. I tried using a command list telling them to enter vehicles with 20 world units, but when I tested it, it didn't work. Is there a way to make AI enter vehicles that are near them?
Edited by deadlyfighter1000 on Aug 9, 2011 at 12:32 PM
|
|
|

Lone Warrior
Joined: Dec 14, 2008
-Himalayan Wizard and Mystical Guru of the Mts.-
|
Posted: Aug 9, 2011 07:19 PM
Msg. 12 of 14
Quote: --- Original message by: deadlyfighter1000
E: Another question, I want to know how to make AI enter vehicles that are near them, within a distance. I tried using a command list telling them to enter vehicles with 20 world units, but when I tested it, it didn't work. Is there a way to make AI enter vehicles that are near them?
Edited by deadlyfighter1000 on Aug 9, 2011 at 12:32 PM Yes there is, you can use this command in your script: ( ai_vehicle_enterable_actors <vehicle> <encounter> ) Remove the < > when compiling too. This will allow the encounter to enter the vehicle mentioned at will whenever there's room. However, the only issue is that it does not specify seats. Edited by Lone Warrior on Aug 9, 2011 at 07:19 PM
|
|
|

deadlyfighter1000
Joined: Jan 11, 2009
Constantly a threat.
|
Posted: Aug 10, 2011 01:46 PM
Msg. 13 of 14
Yeah, I know that script, but the problem is it only specifies one vehicle, is there another way to make the ai enter any vehicle near them? Or would I just have to repeat the script for each vehicle?
|
|
|

Lone Warrior
Joined: Dec 14, 2008
-Himalayan Wizard and Mystical Guru of the Mts.-
|
Posted: Aug 10, 2011 02:36 PM
Msg. 14 of 14
Quote: --- Original message by: deadlyfighter1000 Yeah, I know that script, but the problem is it only specifies one vehicle, is there another way to make the ai enter any vehicle near them? Or would I just have to repeat the script for each vehicle? If command lists aren't working, I'm afraid you'll need to repeat this script for each vehicle.
|
|
|
| |
|
|
 |
|