
Headhunter09
Joined: May 6, 2008
This is the truth.
|
Posted: Jan 11, 2009 09:04 AM
Msg. 1 of 9
Here's the problem: I made a script so that when I walk into a certain area my allies spawn and run out of the base. Then they need to keep going to the first combat zone. However, ingame they just appear and stand there. They react to me when I come near, but they don't follow the command list. Why? Script: (script startup first_appear (sleep_until (volume_test_objects marines (players)) 15) (ai_place helpers) (ai_command_list helpers helpers_appear) (ai_command_list helpers to_first_area) ) (script startup first_battle (sleep_until (= (ai_living_count first_enemies) 0) 15) (ai_command_list helpers to_2_area) )
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: Jan 11, 2009 11:27 AM
Msg. 2 of 9
Hmm... Well in your script, they would run out, and half a millisecond later (how fast does a computer run?) they would screw the first command list, and go immediately to the second. Use a script to sleep until they finish, or when they enter a trigger volume, or something like that. Also, for your second script, if the encounter called first_enemies is not initially created, and they weren't created when you started the game, the ai would run the command list to_2_area. Make sure that the script first_battle is dormant, and is woken AFTER you place the AI encounter.
|
|
|

Headhunter09
Joined: May 6, 2008
This is the truth.
|
Posted: Jan 11, 2009 12:18 PM
Msg. 3 of 9
I had it being dormant, but it gave me an error
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: Jan 11, 2009 12:26 PM
Msg. 4 of 9
What is your error?
|
|
|

Me KS
Joined: Feb 2, 2008
Desire is Reality. Xfire: jetmaster23
|
Posted: Jan 11, 2009 02:41 PM
Msg. 5 of 9
Does your SP map have multiple BSP's? If so, you need to set your command list to the BSP being used when you run the command list. Otherwise, the marines won't follow the command list. To do this, just check the "manual bsp index" check box in the command list settings for those command lists and then type in the number of the BSP you need in the "manual bsp index" text box right under it. Just as a warning, the command list won't work in any other BSP other than the one you typed in once you do this. Other than that, here's the fix to the first script: (script startup first_appear (sleep_until (volume_test_objects marines (players)) 15) (ai_place helpers) (ai_command_list helpers helpers_appear) (sleep_until (or (= (ai_command_list_status (ai_actors helpers)) 1) (= (ai_command_list_status (ai_actors helpers)) 0) ) 15) (ai_command_list helpers to_first_area) )
This will make the script wait until the first command list finishes before starting the next one. Edited by Me KS on Jan 11, 2009 at 02:42 PM
|
|
|

Headhunter09
Joined: May 6, 2008
This is the truth.
|
Posted: Jan 11, 2009 03:28 PM
Msg. 6 of 9
another question: how do I refer to the player from a variable slot?
|
|
|

Me KS
Joined: Feb 2, 2008
Desire is Reality. Xfire: jetmaster23
|
Posted: Jan 11, 2009 03:40 PM
Msg. 7 of 9
Quote: --- Original message by: Headhunter09 another question: how do I refer to the player from a variable slot? Either make a "unit" variable or an "object" variable and then use the usual (list_get (players) 0) as the variable's value. I would use "unit" since "unit" can be used interchangeably between "unit" and "object" arguments in commands, in the case of players. You could even do both if you wanted to, just with different variable names, like player_o for object and player_u for unit. Here's the "unit" one: (global unit player (unit (list_get (players) 0))) And the "object" one: (global object player (list_get (players) 0)) Then, you would just use "player" where there is a "unit" or "object" in any command, e.g. (unit_kill player) Edited by Me KS on Jan 11, 2009 at 03:40 PM
|
|
|

Headhunter09
Joined: May 6, 2008
This is the truth.
|
Posted: Jan 11, 2009 04:12 PM
Msg. 8 of 9
k thnx that works, but now it is telling me my left paren is unmatched, and I know it isn't so what does that indicate?
|
|
|

Polamee
Joined: Feb 25, 2008
MP2SPMT's founder
|
Posted: Jan 15, 2009 08:18 AM
Msg. 9 of 9
Not sure. Show the script. Or add an extra close bracket ) at the end.
|
|
|