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 »can device machines spawn items with script?

Author Topic: can device machines spawn items with script? (6 messages, Page 1 of 1)
Moderators: Dennis

casual mods
Joined: May 2, 2013

I be chillin


Posted: May 22, 2013 07:04 PM    Msg. 1 of 6       
using the script like (object_create assault rifle)?


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: May 22, 2013 07:16 PM    Msg. 2 of 6       
If you gave an item the object name, assault rifle, then (object_create "assault rifle") would work, but, that would only allow one spawned at a time. You'd be best off using an effect to create the assault rifle, and if you're just using an effect, you can put the effect in the turned on value of the device_control and completely ignore the scripts.


casual mods
Joined: May 2, 2013

I be chillin


Posted: May 22, 2013 07:36 PM    Msg. 3 of 6       
i plan on using a points/currency system,
if i did it the device_control on spawn effect method
would i just script a points/currency check trigger volume before the device machine?


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: May 22, 2013 08:27 PM    Msg. 4 of 6       
(global short points 0)
(script continuous dispense
(sleep_until (= (device_get_position <device>) 1) 1)
(if (>= points 5)
(begin
(set points (- points 5))
(effect_new_on_object_marker <effect> <object> <string>)
)
)
(device_set_position <device> 0)
(sleep 15)
)

Use that example. If the player has 5 or more points, it will take them and create the effect.
In the effect slot, you want to write out the tag location of an .effect tag, encased in quotes "". For the object, write the device (Or, player if you dont want it to be dropped out of the device). For string, if you dont have a marker on the object for spawning it from, just put ""


casual mods
Joined: May 2, 2013

I be chillin


Posted: May 22, 2013 09:19 PM    Msg. 5 of 6       
so it would go like this?:

(global short points 0)
(script continuous buy assault rifle
(sleep_until (= (device_get_position assault rifle) 1) 1)
(if (>= points 5)
(begin
(set points (- points 5))
(effect_new_on_object_marker "effects\buy\assaultrifle.effect" player "")
)
)
(device_set_position buy assault rifle 0)
(sleep 15)
Edited by casual mods on May 22, 2013 at 09:22 PM
Edited by casual mods on May 22, 2013 at 09:22 PM


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: May 22, 2013 10:07 PM    Msg. 6 of 6       
stop putting spaces in, use _. Also, you use a different device name at the top and bottom. For a player, (unit (list_get (players) 0))
You'll also need something somewhere for adding your points (however you decide to do that, whether its every time an enemy dies, etc)

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 11:12 AM 141 ms.
A Halo Maps Website