A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE Technical / Map Design »Scripting issue I've run into

Author Topic: Scripting issue I've run into (7 messages, Page 1 of 1)
Moderators: Dennis

rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Aug 28, 2011 07:50 AM    Msg. 1 of 7       
Is there a command to simply check if a unit's seat is occupied? Not by anything specific, just if there is something in it. Example: The script will run if a specified warthog's gun is occupied by the player, a marine, or anything else that could enter it.

I thought I saw a command to do this in the scripting bible a couple months ago but I cannot seem to find it. It might not have been what I thought it was, but I do not know.

I might have another way to do this if it doesn't work, but this would be the preferred method
Edited by rerout343 on Aug 28, 2011 at 07:51 AM


Polamee
Joined: Feb 25, 2008

MP2SPMT's founder


Posted: Aug 28, 2011 10:11 AM    Msg. 2 of 7       
(vehicle_test_seat [vehicle] [string] [unit name])


rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Aug 28, 2011 10:41 AM    Msg. 3 of 7       
Quote: --- Original message by: Polamee
(vehicle_test_seat [vehicle] [string] [unit name])


That's why I can't use that command. I need mine to activate when anything enters it. That one calls for a specific unit. Or is there a way to word the command so it doesn't need one?


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Aug 28, 2011 11:31 AM    Msg. 4 of 7       
(vehicle_test_seat_list <vehicle> <string> (vehicle_riders <unit>))
or
(vehicle_test_seat <vehicle> <string> (vehicle_driver <unit>))
or
(vehicle_test_seat <vehicle> <string> (vehicle_gunner <unit>))
put vehicle, seat label, vehicle again.
With this, you can check if the driver is driving the vehicle (so regardless of who the driver is, it returns true if someones in it)

riders returns an object_list of people in the vehicle, driver returns the driver, gunner returns the gunner. If it was bob, it would return bob. If it was BLANK, it would return BLANK, etc. The first part then checks if BLANK is in that seat, and if he indeed is, it returns true. But if -1 is passed to it, that there is nobody in there, it instantly knows that nobody is in that seat, return a false.


rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Aug 28, 2011 05:25 PM    Msg. 5 of 7       
Ok, new problem. Now, whenever compile the scripts, I get this error:

i expected a object_list, but this function returns a void.: (ai (ai_test)0) ))

Script:

(script continuous aitest0
(unit (list_get (ai (ai_test)0) ))
)

Also, whenever I try to make it a static script, it gives me this:

this is not a valid return type.: aitest0

I've tried rewording my script every way I could think of and still nothing. I know it's probably something simple I'm overlooking, but I can't seem to find it.


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Aug 28, 2011 08:59 PM    Msg. 6 of 7       
1) You are using the command (ai <boolean>) for turning AI on and off
2) having the parenthesis make it check for script commands, or static scripts, with that context.
3) When its a static script, you must state what type of thing it represents, it instead mistook the name for the type.

I'm assuming ai_test is your encounter:
(script static "unit" aitest0
(unit (list_get (ai_actors ai_test) 0))
)

then in another script, you may place (aitest0) in the place of a unit, and it will automatically use the first AI in the encounter (you may want to replace that 0 with a variable, and change it so you can reference all AI by changing that number, etc. its your choice)


rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Aug 29, 2011 08:03 AM    Msg. 7 of 7       
Thank you, I was never quite sure how to set up a script like that. And I already have a plan to set it up for the rest of the encounter, I just want to get it to work with my one test encounter first because it only spawns one actor.

Although, now i have another problem relating back to my first script.

Would it be possible for you to help with this over xfire? Then I might be able to figure out what I'm doing wrong a little easier.

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 2:15 AM 266 ms.
A Halo Maps Website