
Muscl3r
Joined: May 22, 2010
dont pray 4 easy lives...pray to be STRONGER MEN
|
Posted: Mar 19, 2011 04:04 PM
Msg. 1 of 7
debug:
[midship line 402] i expected a function name, but i got an expression.: (if (= (unit_has_weapon player plasma_rifle) true))(then (player_add_equipment (unit (list_get (players) 0)) plasma_rifle false)))
command:
((if (= (unit_has_weapon player plasma_rifle) true))(then (player_add_equipment (unit (list_get (players) 0)) plasma_rifle false)))
How can i fix this??
If i can't then my firefight won't have loadouts which will make the lives system halfassed and the sp will be crap
|
|
|

The Cereal Killer
Joined: Mar 18, 2011
Scripts, AI, cutscenes, ui_widgets, animation.
|
Posted: Mar 19, 2011 08:13 PM
Msg. 2 of 7
You don't need to type "then" for one thing. That may be the only problem... apologies, this is normally my realm but I'm not too focused ATM.
|
|
|

Muscl3r
Joined: May 22, 2010
dont pray 4 easy lives...pray to be STRONGER MEN
|
Posted: Mar 20, 2011 04:23 AM
Msg. 3 of 7
I have tried this too
((if (= (unit_has_weapon player plasma_rifle) true))(player_add_equipment (unit (list_get (players) 0)) plasma_rifle false)))
but i still get the same error
|
|
|

The Cereal Killer
Joined: Mar 18, 2011
Scripts, AI, cutscenes, ui_widgets, animation.
|
Posted: Mar 20, 2011 04:35 AM
Msg. 4 of 7
This may work, however once again, it is difficult to help without proper context:
(if (= (unit_has_weapon (player) plasma_rifle) true) (player_add_equipment (player) plasma_rifle false))
That is, assuming you have a static script set up like this:
(script static "unit" player (unit (list_get (players) 0)) )
|
|
|

Muscl3r
Joined: May 22, 2010
dont pray 4 easy lives...pray to be STRONGER MEN
|
Posted: Mar 20, 2011 04:54 AM
Msg. 5 of 7
well heres the script:
(script dormant spawnscript (show_hud_help_text false) (object_cannot_take_damage (players)) (sleep 60) (object_teleport (unit (list_get (players) 0)) start) (fade_in 1 1 1 30) (player_camera_control 1) (sleep 180) (object_can_take_damage (players)) )
(script continuous life_lost (set cheat_deathless_player true) (sleep_until (<= (unit_get_health (unit (list_get (players) 0))) 0.01) 1)(player_enable_input false) (fade_out 1 0 0 15) (sleep 30) (set lives (- lives 1)) (object_teleport (unit (list_get (players) 0)) hide) ((if (= (unit_has_weapon player plasma_rifle) true))(then (player_add_equipment (unit (list_get (players) 0)) plasma_rifle false))) ((if (= (unit_has_weapon player plasma_pistol) true))(player_add_equipment (unit (list_get (players) 0)) plasma_pistol false)) ((if (= (unit_has_weapon player needler_blue) true))(player_add_equipment (unit (list_get (players) 0)) needler_blue false)) ((if (= (unit_has_weapon player carbine) true))(player_add_equipment (unit (list_get (players) 0)) carbine false)) ((if (= (unit_has_weapon player beam_rifle) true))(player_add_equipment (unit (list_get (players) 0)) beam_rifle false)) (sleep 60) (player_action_test_reset) (sleep 30) (player_inable_input 1) (show_hud_help_text true) (hud_set_help_text obj11) (hud_set_objective_text obj11) (((if (= (player_action_test_action) true))(player_add_equipment (unit (list_get (players) 0)) loadout1 true))(then (wake spawnscript))) (((if (= (player_action_test_jump) true))(player_add_equipment (unit (list_get (players) 0)) loadout2 true))(then (wake spawnscript))) (((if (= (player_action_test_zoom) true))(player_add_equipment (unit (list_get (players) 0)) loadout3 true))(then (wake spawnscript))) )
|
|
|

The Cereal Killer
Joined: Mar 18, 2011
Scripts, AI, cutscenes, ui_widgets, animation.
|
Posted: Mar 20, 2011 04:59 AM
Msg. 6 of 7
Hm, yes try replacing that command then, and set up the other similar commands in the same way.
Also I'll save you from a future error, you typed (player_inable_input) instead of (player_enable_input) ;D
|
|
|

Muscl3r
Joined: May 22, 2010
dont pray 4 easy lives...pray to be STRONGER MEN
|
Posted: Mar 20, 2011 05:14 AM
Msg. 7 of 7
aah... thanks there bro
|
|
|