
Co1t3r
Joined: Dec 13, 2008
|
Posted: Feb 10, 2010 12:05 AM
Msg. 1 of 13
After screwing around with scripts I figured out how to make a deploy-able bubble shield. I used H3MT's shield as a test. Basically the way the bubble shield weapon works is, its projectile deploys and equipment tag which is what you see after you "fire" it. The way the script works is it creates this equipment tag and attaches it to the player's right hand marker, and then is immediately detached. I haven't tested this in multiplayer, but it works perfectly in single. With a bit of clever scripting I got it to imitate and item collection and launch through flashlight. (global boolean hasPowerup false) (global boolean deployPowerup false)
(script static "unit" player0 (unit (list_get (players )0 )))
(script static "void" DeployBBS (if (= hasPowerup 1) (begin (object_create_anew bb_shield) (set hasPowerup 0) (objects_attach (player0) "r hand " bb_shield "") (objects_detach (player0) bb_shield) (set deployPowerup 0) ) ) )
(script continuous TestForPowerup (if (= (unit_get_current_flashlight_state (player0)) true) (begin (DeployBBS) (unit_set_desired_flashlight_state (player0) 0) ) ) )
(script continuous BBSSpawn (if (= (volume_test_object get_bbs (player0)) 1) (begin (object_destroy bbs1) (sound_impulse_start sound\sfx\weapons\weapon_pickup_ammo\ar_ammo none 1) (set hasPowerup 1) (sleep 300) (object_create bbs1) ) ) )
(script startup test (object_create bbs1) )
The most important part to understand about this script is DeployBBS. bb_shield is the bubble shield equipment tag in narrows leak. TestForPowerup lets you deploy through flashlight. BBSSpawn emulates an item collection. bbs1 is a scenery item using the bubble shield base model. Feel free to plug this script into your map, or edit it how you wish. With this concept you can make all sorts deploy-able equipment. Easy instructions for non-scripters: 1. Find the bubble shield equipment tag in the H3MT narrows leak 2. Import it into your map place one somewhere unaccessable and name it bb_shield 3. Create a trigger volume named get_bbs where you want to player to pick up the shield 4. Compile this script in Sapien If you want to try to get this to work in multiplayer, you'll have to to some modifying.
|
|
|

Hydrogen
Joined: Dec 6, 2009
Wort Wort Wort...
|
Posted: Feb 10, 2010 01:32 AM
Msg. 2 of 13
hm.. lets see this is epic. cmt tag release with alot fo epic crap such as brutes grav hammer from cmt now this now lets fix up the power drainer peoples. :]
lol ty cmt for your great tags that has just given me a idea. and you to colter13 for this wonderful script. I might just pic up the old project I was working on. :D
|
|
|

Co1t3r
Joined: Dec 13, 2008
|
Posted: Feb 10, 2010 09:19 AM
Msg. 3 of 13
BTW the non-scripter tutorial was made in a hurry. I'll redo it later. I'm more hoping this concept will catch on and better kinds equipment can be made.
|
|
|

Me KS
Joined: Feb 2, 2008
Desire is Reality. Xfire: jetmaster23
|
Posted: Feb 10, 2010 01:06 PM
Msg. 4 of 13
Good script. It'll work perfectly in SP. But, what's the purpose of the 'deployPowerup' variable? It's initialized false and is only set to being false in the 'DeployBBS' script. It's never set to be true, so it isn't serving any purpose as it is. Did you intend to use it or just abandon it?
|
|
|

Co1t3r
Joined: Dec 13, 2008
|
Posted: Feb 10, 2010 03:52 PM
Msg. 5 of 13
It's from an older revision of this script. It was designed to check if the user wanted to deploy the shield, but I don't need it anymore and forgot to take it out.
|
|
|

Hydrogen
Joined: Dec 6, 2009
Wort Wort Wort...
|
Posted: Feb 12, 2010 10:21 PM
Msg. 6 of 13
is it possible to throw the power drainer?
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: Feb 12, 2010 11:04 PM
Msg. 7 of 13
It's basically the same idea.
|
|
|

catinthemafia
Joined: Jun 8, 2009
the worlds hatred creates the next kkk
|
Posted: Feb 12, 2010 11:51 PM
Msg. 8 of 13
wow, once i get a comp in june im totaly gonna use that script *thread saved
|
|
|

Hydrogen
Joined: Dec 6, 2009
Wort Wort Wort...
|
Posted: Feb 12, 2010 11:54 PM
Msg. 9 of 13
lol how do u save threads :P
|
|
|

catinthemafia
Joined: Jun 8, 2009
the worlds hatred creates the next kkk
|
Posted: Feb 12, 2010 11:57 PM
Msg. 10 of 13
post in it
|
|
|

shadowslayer123
Joined: Feb 22, 2009
Not the american average
|
Posted: Feb 13, 2010 07:56 PM
Msg. 11 of 13
good script, 2 problems.
in your tutorial, you didnt mention bbs1, so sapien couldnt import the script.
i made 1 bubble shield named bb_sheild and one named bbs. that made it work.
2nd, bubble shield never runs out and explodes
|
|
|

Co1t3r
Joined: Dec 13, 2008
|
Posted: Feb 14, 2010 12:31 AM
Msg. 12 of 13
1. I made the tutorial in a hurry, so I meant for people to figure it out themselves, as you did. 2. It explodes perfectly in multiplayer, but for some strange reason there are a couple bugs, including not exploding, on singleplayer.
The other one is that it doesn't drop, it floats in the same place as it was attached to the arm. Reasons?
|
|
|

shadowslayer123
Joined: Feb 22, 2009
Not the american average
|
Posted: Feb 14, 2010 12:38 AM
Msg. 13 of 13
you could start it in multiplayer, count how long it takes for it to explode, then make a new script designed specifically for single player that adds sleep until (add time here) followed by object_destroy bbs. for the hand, you could attatch it to somewhere else like the foot, because you will not even see it do that, because it goes so fast, so if it floats, it will be on the ground anyway. hope this helps
|
|
|