
ShadowFox0809
Joined: Feb 27, 2010
|
Posted: Jun 9, 2010 11:51 AM
Msg. 1 of 9
Deployable turrets, standard method: a weapon for the undeployed turret can be picked up. When it's fired, it disappears (like the c4). A projectile using the deployable turret's model is shot out. When it hits the ground, the projectile disappears and spawns a deployable turret vehicle.
Problem: these deployable turret vehicles will accumulate when they respawn and slow down the game.
Goal: delete all deployable turrets that respawn.
Essentially, I'm trying to create a script where unnamed objects that are created (vehicles) will be deleted when they respawn. I know that created vehicles will default to the first vehicle's spawn point, and I'm trying to use that to my advantage.
Now, if this isn't possible, I need to find a way to make it so that a named vehicle will be created when a named weapon is fired.
Any ideas?
Edit: if I place the first vehicle respawn outside the BSP, will that prevent them from respawning? Edited by ShadowFox0809 on Jun 9, 2010 at 11:52 AM
|
|
|

SlappyThePirate
Joined: Aug 24, 2009
You are irritating, I'll release nothing
|
Posted: Jun 9, 2010 12:13 PM
Msg. 2 of 9
First way kinda works. "Now, if this isn't possible, I need to find a way to make it so that a named vehicle will be created when a named weapon is fired."
See, that's what you should do instead. What you should do is instead script a vehicle to attatch and detatch to the player when fired, hence spawning it. That way you can also control how many can be placed with the script. Edited by SlappyThePirate on Jun 9, 2010 at 12:13 PM
|
|
|

Megaguirus
Joined: Feb 26, 2009
Om nom nom
|
Posted: Jun 9, 2010 12:28 PM
Msg. 3 of 9
(global object_definition w_oddball "weapons\ball\ball") i think something like this might work (change the w_oddball and stuff obviously)
|
|
|

ShadowFox0809
Joined: Feb 27, 2010
|
Posted: Jun 9, 2010 12:58 PM
Msg. 4 of 9
The main problem I have is that I don't know of any devcommands that will help indicate when the weapon is fired. I could use the test primary trigger command, but what if someone switches weapons and fires? then a turret would spawn without deploying it.
Edit: what is the official script reference? I've never seen it before. Thanks for the help so far, and thanks in advance!
Update:
I think I got it. In concept, this is it.
script continuous sleep until player has weapon sleep until player has weapon ready player test reset sleep until player has fired weapon if player has weapon ready, then proceed script, if not, then restart (end of script. a true value may activate a global, whereas a false would do nothing, but begin this script again, checking over and over again until each of the conditions are met in the right order)
Would this work? Edited by ShadowFox0809 on Jun 9, 2010 at 05:32 PM
|
|
|

Advancebo
Joined: Jan 14, 2008
|
Posted: Jun 9, 2010 08:59 PM
Msg. 5 of 9
Thats dum. Load the vehicle tag into the primary/secondary trigger's firing effect. So that when you fire, it spawns a turret vehicle. Watch this video as an example: http://www.xfire.com/video/6b5b2/ No scripts involved. (Turret thing is around 0:30)
|
|
|

ShadowFox0809
Joined: Feb 27, 2010
|
Posted: Jun 9, 2010 09:08 PM
Msg. 6 of 9
alright, but the turret would need to be named, because it needs to be deleted after it respawns.
Update: I am working on a script that may get this done. h/o for 10-15 minutes
Edit: still working on it
Btw, advance, how did you get the undeployed turret to disappear after you deployed it?
Update: well, CAD's method of choosing the player id doesn't work for this, so if I wrote the script, I would have to write it for all 16 players (16 times) Also, this script fails if the weapon is deployed immediately after being picked up.
I conclude that it is far more beneficial to just let the duplicate turrets respawn; just let them respawn outside of the player's view. Don't let the deployable turret equipment (undeployed) spawn more than four times in a match.
Anyways, the script I wrote (and won't use, though it works)
(global object_definition undeployed_turret "weapons\c4\c4") (global object_definition deployed_turret "vehicles\warthog\mp_warthog")
(script continuous deployment (sleep_until (unit_has_weapon_readied (unit (list_get (players) 0)) undeployed_turret) ) (player_action_test_reset) (sleep_until (or (player_action_test_primary_trigger) (unit_has_weapon (unit (list_get (players) 0)) undeployed_turret) ) ) (if (and (player_action_test_primary_trigger) (not (unit_has_weapon_readied (unit (list_get (players) 0)) undeployed_turret)) ) (begin (object_create deployed_turret_1) (objects_attach (list_get (players) 0) "" deployed_turret_1 "") (objects_detach (list_get (players) 0) deployed_turret_1) (sleep 60) ) ) ) Edited by ShadowFox0809 on Jun 9, 2010 at 10:18 PM
|
|
|

Advancebo
Joined: Jan 14, 2008
|
Posted: Jun 9, 2010 10:53 PM
Msg. 7 of 9
Quote: --- Original message by: ShadowFox0809
alright, but the turret would need to be named, because it needs to be deleted after it respawns.
Update: I am working on a script that may get this done. h/o for 10-15 minutes
Edit: still working on it
Btw, advance, how did you get the undeployed turret to disappear after you deployed it?
Update: well, CAD's method of choosing the player id doesn't work for this, so if I wrote the script, I would have to write it for all 16 players (16 times) Also, this script fails if the weapon is deployed immediately after being picked up.
I conclude that it is far more beneficial to just let the duplicate turrets respawn; just let them respawn outside of the player's view. Don't let the deployable turret equipment (undeployed) spawn more than four times in a match.
Anyways, the script I wrote (and won't use, though it works)
(global object_definition undeployed_turret "weapons\c4\c4") (global object_definition deployed_turret "vehicles\warthog\mp_warthog")
(script continuous deployment (sleep_until (unit_has_weapon_readied (unit (list_get (players) 0)) undeployed_turret) ) (player_action_test_reset) (sleep_until (or (player_action_test_primary_trigger) (unit_has_weapon (unit (list_get (players) 0)) undeployed_turret) ) ) (if (and (player_action_test_primary_trigger) (not (unit_has_weapon_readied (unit (list_get (players) 0)) undeployed_turret)) ) (begin (object_create deployed_turret_1) (objects_attach (list_get (players) 0) "" deployed_turret_1 "") (objects_detach (list_get (players) 0) deployed_turret_1) (sleep 60) ) ) ) Edited by ShadowFox0809 on Jun 9, 2010 at 10:18 PM If you mean the held weapon, theres some flags you can mark in the weapon tag that cause it to be destroyed when drop. Kind of like the flag/oddball when you fire it, they will drop to the ground, but be destroyed instead.
|
|
|

ShadowFox0809
Joined: Feb 27, 2010
|
Posted: Jun 10, 2010 12:05 AM
Msg. 8 of 9
Thanks!
|
|
|

SlappyThePirate
Joined: Aug 24, 2009
You are irritating, I'll release nothing
|
Posted: Jun 10, 2010 08:08 PM
Msg. 9 of 9
I quote the Aussie marine: That's the way to do it, yeah! Really really cool.
|
|
|
| |
|
|
 |
|