
Reegar Carbine
Joined: May 25, 2014
Idk???
|
Posted: Jul 3, 2014 09:07 AM
Msg. 1 of 11
So I got some qeustions about sp map making.
1. First what kind of script do I need to use, if I want the script to sleep until an enemy has spotted the player(or other enemies).
2 Lets say I got this death barrier script. It checks to see if a player enters a certain area and then kills it. But what if the player has completed a certain objective so he is allowed to walk in this certain area. How do I deactivate this death barrier script? Or better how could I deactivate any sort of dormant, startup, or continuous script?
3. This is a more complicated one. In the custom sp mission takedown project lawson the creators give you the option to select an rally point before you start. Is there any tutorial of some sort that tells you how to set this up? Also how did he get that nice looking logo ingame?
Edited by Reegar Carbine on Jul 3, 2014 at 09:11 AM
|
|
|

clonecam117
Joined: Dec 11, 2012
Now a professional VFX/particle effect artist.
|
Posted: Jul 3, 2014 11:30 AM
Msg. 2 of 11
For the second one, you'd have to first initialize a global Boolean variable, set to false.
When the player completes the objective, set the variable to true.
In the kill trigger script, add a bit at the beginning that says:
(if -variable name-
|
|
|

Heatguts
Joined: Jun 6, 2014
Recon Armor FTW!
|
Posted: Jul 3, 2014 01:55 PM
Msg. 3 of 11
1: sleep_until (= ((ai_status <ai>) (5))) I think. Regardless ai_status of <ai> should equal 5 (visible enemy).
2: What he said, except pretend I said it better.
3: I asked that same question a while ago. That involves using hacked guerrilla to modify the ui widgets which I haven't figured out how to do yet. Edited by Heatguts on Jul 3, 2014 at 01:58 PM
|
|
|

kinpat
Joined: Apr 22, 2014
:D
|
Posted: Jul 3, 2014 02:38 PM
Msg. 4 of 11
Quote: --- Original message by: Heatguts 1: sleep_until (= ((ai_status <ai>) (5))) I think. Regardless ai_status of <ai> should equal 5 (visible enemy).
just fixing... (too many brackets...) (sleep_until (= (ai_status <ai>) 5))
|
|
|

clonecam117
Joined: Dec 11, 2012
Now a professional VFX/particle effect artist.
|
Posted: Jul 3, 2014 06:41 PM
Msg. 5 of 11
Quote: --- Original message by: Heatguts
1: sleep_until (= ((ai_status <ai>) (5))) I think. Regardless ai_status of <ai> should equal 5 (visible enemy).
2: What he said, except pretend I said it better.
3: I asked that same question a while ago. That involves using hacked guerrilla to modify the ui widgets which I haven't figured out how to do yet. Edited by Heatguts on Jul 3, 2014 at 01:58 PM OS guerilla/scripts does it easy.
|
|
|

Reegar Carbine
Joined: May 25, 2014
Idk???
|
Posted: Jul 4, 2014 10:00 AM
Msg. 6 of 11
Quote: --- Original message by: clonecam117 For the second one, you'd have to first initialize a global Boolean variable, set to false.
When the player completes the objective, set the variable to true.
In the kill trigger script, add a bit at the beginning that says:
(if -variable name- Im still missing something. Script: (global boolean death false) (script static unit player0 (unit (list_get (players) 0)) ) (script startup test (sleep 100) (ai_place test/halo) (sleep_until (= (ai_status test/halo) 5)) (sound_impulse_start sound\music\cstrng\cstrng3 none 1.00) (game_save_totally_unsafe) (ai_command_list test go) (sleep_until (= (ai_living_count test) 0) 15) (set death true) ) (script startup death_barrier (if death something should go here(sleep_until (volume_test_objects test (players)) 15) (unit_kill (unit (list_get (players) 0) )))
|
|
|

kinpat
Joined: Apr 22, 2014
:D
|
Posted: Jul 4, 2014 10:08 AM
Msg. 7 of 11
(script startup death_barrier (if (= death true) (sleep_until (volume_test_objects test (players)) 15) (unit_kill (unit (list_get (players) 0) )))
edit: also to make it more simple, if you already have this set up,
(script static unit player0 <--------------- (unit (list_get (players) 0)) )
you dont have to do it like this:
(unit_kill (unit (list_get (players) 0)
but like this:
(unit_kill (player0)) Edited by kinpat on Jul 4, 2014 at 10:38 AM
|
|
|

Reegar Carbine
Joined: May 25, 2014
Idk???
|
Posted: Jul 4, 2014 10:59 AM
Msg. 8 of 11
Ok so i tried that but it didn't work. When I walked into the trigger nothing happend so I tried something simpler.
(global boolean death false)
(script static unit player0 (unit (list_get (players) 0)) )
(script startup test (sleep_until (volume_test_objects safe (player0)) 15) (set death true) <--- this should deactivate the deatbarrier )
(script continuous death_barrier (if (= death false) <--this should check if the player hasnt entered the trigger called 'safe' (sleep_until (volume_test_objects death_barrier (player0)) 15) (unit_kill (player0)) ))
The idea is that if I now walk into the trigger called 'safe' the deathbarrier should not work anymore.
But its not working correctly ingame. When i walk into the deathbarrier first nothing happends. And if I walk into the trigger called 'safe' and then walk into the deathbarrier I do get killed plus the game crashes with exception. Very confusing.
|
|
|

kinpat
Joined: Apr 22, 2014
:D
|
Posted: Jul 4, 2014 12:04 PM
Msg. 9 of 11
Quote: --- Original message by: Reegar Carbine (global boolean death false)
(script static unit player0 (unit (list_get (players) 0)) )
(script startup test (sleep_until (= (volume_test_objects safe (player0)) true) 15) (set death true) <--- this should deactivate the deatbarrier )
(script continuous death_barrier (if (= death false) <--this should check if the player hasnt entered the trigger called 'safe' (sleep_until (= (volume_test_objects death_barrier (player0)) true) 15) (unit_kill (player0)) )) remember to look what these commands return; for example "volume_test_objects" returns true or false, depending on the fact that is the object in the volume or not. That's why in if's and sleep_until's you have to have that (.....(= (.......) true/false)) thing. And btw, if you are only checking that 1 thing is in the volume use the volume_test_object (without the "s") instead. Edited by kinpat on Jul 4, 2014 at 12:10 PMEdit: tested myself, ran into same exception. But this script seems to work: (global boolean death false) (script static unit player0 (unit (list_get (players) 0))) (script startup test (sleep_until (= (volume_test_object *volume1* (player0)) true) 15) (set death true) ) (script continuous death_barrier (if (= death false) (begin (if (= (volume_test_object *volume2* (player0)) true) <----- here (begin (unit_kill (player0)) ))))) Using sleep_until command in *here wont work, 'cause the death global is false in the beginning, and the script gets to point where it sleeps until you go to this volume, and in that case, changing the value of the death global wont help anymore (because the script waits for the sleep, and doesn't care for the if anymore). (and remember to have that *(begin* after the *if* if you dont have an *else* event to happen.) Hope you understood. Edited by kinpat on Jul 4, 2014 at 12:32 PM
|
|
|

Reegar Carbine
Joined: May 25, 2014
Idk???
|
Posted: Jul 4, 2014 01:11 PM
Msg. 10 of 11
Thx that worked
Do you maby know how to get this one to work as well? It gives me errors in sapien.
'I expected a script or variable definition'
(global boolean death false)
(script static unit player0 (unit (list_get (players) 0)))
(script startup test (sleep 100) (ai_place enemy/halo) (sleep_until (= (ai_status enemy/halo) 5)) (sound_impulse_start sound\music\cstrng\cstrng3 none 1.00) (game_save_totally_unsafe) (ai_command_list enemy/halo go) (sleep_until (= (ai_living_count enemy/halo) 0) 15) (set death true) ))
(script continuous death_barrier (if (= death false) (begin (if (= (volume_test_object death_barrier (player0)) true) (begin (unit_kill (player0)) ))))) Edited by Reegar Carbine on Jul 4, 2014 at 01:12 PM
|
|
|

kinpat
Joined: Apr 22, 2014
:D
|
Posted: Jul 4, 2014 02:49 PM
Msg. 11 of 11
Quote: --- Original message by: Reegar Carbine (script startup test (sleep 100) (ai_place enemy/halo) (sleep_until (= (ai_status enemy/halo) 5)) (sound_impulse_start sound\music\cstrng\cstrng3 none 1.00) (game_save_totally_unsafe) (ai_command_list enemy/halo go) (sleep_until (= (ai_living_count enemy/halo) 0) 15) (set death true) )) you have one bracket too much in the end (script startup test (sleep 100) (ai_place enemy/halo) (sleep_until (= (ai_status enemy/halo) 5)) (sound_impulse_start sound\music\cstrng\cstrng3 none 1.00) (game_save_totally_unsafe) (ai_command_list enemy/halo go) (sleep_until (= (ai_living_count enemy/halo) 0) 15) (set death true) ) <---------- only one here needed and btw, sapien will always show you that what line has the problem before saying the problem itself, so try to look that when you fix problems.
|
|
|