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 »Need help with a simple script

Author Topic: Need help with a simple script (5 messages, Page 1 of 1)
Moderators: Dennis

rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Sep 7, 2010 09:52 PM    Msg. 1 of 5       
I've only been scripting for about two weeks so I'm not vary familiar with the different commands. What I need is a script the will run when the player picks up a power up like active camo, or a health pack. By the way this is a single player map if that helps.

Edit: Another script I need is one that once activated will check what weapon(s) you are carrying and then react accordingly
Edited by rerout343 on Sep 7, 2010 at 10:27 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Sep 7, 2010 11:18 PM    Msg. 2 of 5       
There is no command for detecting whether a player has picked up an equipment. As for what weapon you're carrying, the (unit_has_weapon_readied command (think this is it, might have transposed some words accidentally) detects whether the player is holding the object_definition that's specified in its parameter. You'll have to define the object_definitions first though.


rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Sep 7, 2010 11:22 PM    Msg. 3 of 5       
Could you give me an example of the script to check for a weapon?

EDIT: Also, Is there a way to make a timer that counts up instead of down?
Edited by rerout343 on Sep 7, 2010 at 11:48 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Sep 8, 2010 11:24 AM    Msg. 4 of 5       
(global object_definition assault_rifle "weapons\assault rifle\assault rifle")

.....
(unit_has_weapon_readied (unit (list_get (players) 0)) assault_rifle) ;;returns true if player is holding an assault rifle

As for having a timer count up, you'll have to have multiple variables setup, and a continuous script that counts up every 30 ticks. Every 30 ticks, increase the amount of seconds, and every sixty seconds, reset the seconds to 0, while setting the minutes to minutes + 1.


rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Sep 8, 2010 08:47 PM    Msg. 5 of 5       
Now would it be possible to add a line that would remove said weapon from the players inventory?

Also, would it be possible to set up a script to make a counter that would keep track of the players kills against the AI?

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 10:17 PM 141 ms.
A Halo Maps Website