
Mysterion
Joined: Aug 9, 2008
Nice shot, but too bad your @$$ just got SACKED!!!
|
Posted: May 15, 2009 11:23 AM
Msg. 1 of 19
How does one add a flag for a weapon, such that when it is picked up and carried by a player, it will show up on all the players screen like the team flan in a CTF game.
I want to create a map where a portable nuke can be carried to the opponents base and deployed, but everyone can see who is carrying it in order to try and stop them. This would represent your sensors detecting the radiation signature created by the nuke weapon being transported.
|
|
|

gamegodlazy
- Screenshot Guru -
Joined: Aug 17, 2006
Please pass the Panda Sauce to me
|
Posted: May 15, 2009 11:44 AM
Msg. 2 of 19
you mean that you can pick it up as a flag?
that is a box you need to activate in the weapon tag
|
|
|

Headhunter09
Joined: May 6, 2008
This is the truth.
|
Posted: May 15, 2009 04:07 PM
Msg. 3 of 19
Quote: --- Original message by: Mysterion How does one add a flag for a weapon, such that when it is picked up and carried by a player, it will show up on all the players screen like the team flan in a CTF game.
I want to create a map where a portable nuke can be carried to the opponents base and deployed, but everyone can see who is carrying it in order to try and stop them. This would represent your sensors detecting the radiation signature created by the nuke weapon being transported. I believe it is in the globals.
|
|
|

Mysterion
Joined: Aug 9, 2008
Nice shot, but too bad your @$$ just got SACKED!!!
|
Posted: May 15, 2009 05:42 PM
Msg. 4 of 19
My C4-Nuke can be picked up, and looks similar to a C4 but different color and has a 99 second fuse no matter if you right or left click to toss it. I have just discovered one cool feature with it. After sticking it on a Flood Carrier, when he pops, it detonates regardless of how many seconds remain on the timer. Edited by Mysterion on May 15, 2009 at 05:44 PM
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: May 15, 2009 06:42 PM
Msg. 5 of 19
Quote: --- Original message by: Mysterion How does one add a flag for a weapon, such that when it is picked up and carried by a player, it will show up on all the players screen like the team flan in a CTF game.
I want to create a map where a portable nuke can be carried to the opponents base and deployed, but everyone can see who is carrying it in order to try and stop them. This would represent your sensors detecting the radiation signature created by the nuke weapon being transported. Like an arrow pointing towards the c4? I would use the nav point script, but the scripting bible says that it might not work if the player is not local to the machine. The other option, is to replace the flag in the globals, making a Capture the Nuke gametype. Probably not what you want. You could try the c4 thing. The script for making a variable that loops through all players is: (global short x 0)
(script continuous increase (begin (set x (+ x 1)) ) )
(script continuous reset (if (= x 15) (begin (set x 0) ) ) )
The script for making the nav point appear is: (activate_nav_point_object [navpoint type] (unit (list_get (players) x)) [object] [distance above object])
Valid navpoint types are: default, default_red, flag_blue, flag_red, target_blue, target_red, skull_blue, skull_red, crown_blue, crown_red The "red" variants have the waypoint colored red. You most likely want to use the one titled "blue", as that presents it in the default manner. As for distance above object, it's how far above the object you want it. If it's a weapon on the ground, you obviously don't want the arrow sitting in the ground. You normally should set it 0.6, as that's about player height.
|
|
|

Mysterion
Joined: Aug 9, 2008
Nice shot, but too bad your @$$ just got SACKED!!!
|
Posted: May 15, 2009 08:05 PM
Msg. 6 of 19
Awesome...I will try this in my next mod.
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: May 15, 2009 08:08 PM
Msg. 7 of 19
I doubt it even works for more than one player. Get two people together to play, and see what happens.
|
|
|

Mysterion
Joined: Aug 9, 2008
Nice shot, but too bad your @$$ just got SACKED!!!
|
Posted: May 15, 2009 10:49 PM
Msg. 8 of 19
When I make the map, I will test it by creating a server on my desktop, and joining it with my laptop.
|
|
|

Me KS
Joined: Feb 2, 2008
Desire is Reality. Xfire: jetmaster23
|
Posted: May 16, 2009 01:03 PM
Msg. 9 of 19
Here's a script for that. It only works with team game types, since I used the "team" nav point commands to make it easier to make sure the player will see the nav point no matter what team he's on. This script tests all players to see if they're carrying the nuke weapon, and if they are, sets a nav point to them. If they're not, the "deactivate" command is used to make sure the nav point doesn't stick to players who were carrying it but have dropped it. It works for all players since the script is testing players and placing nav points locally on each player's instance of the game, so there are no syncing issues. The only one issue with it is if you're the player carrying a nuke, you'll see a nav point stuck to yourself. But, it's much too difficult to find out what player index you are so that it can be avoided. It's not that big a deal though. The only thing you have to do is find the path of your nuke's weapon tag (i.e. weapons\nuke\nuke) and put that in the quotes where it says "path to nuke weapon tag". That sets a variable that is used to check who's holding the nuke. This means that any player holding any nuke will have a nav point on them. Since you're planning to have only two nukes, that's fine, since the limit for nav points at one time is four.
(global short num 0)
(global object nuke_carrier (list_get (players) 16)) (global object_definition nuke "path to nuke weapon tag")
(script static "void" manage_num (set num (+ num 1)) (if (> num 15) (set num 0) ) )
(script static "void" determine_carrier (if (unit_has_weapon (unit (list_get (players) num)) nuke) (begin (set nuke_carrier (list_get (players) num)) (activate_team_nav_point_object default default nuke_carrier 0.6) (activate_team_nav_point_object default player nuke_carrier 0.6) ) (begin (deactivate_team_nav_point_object default (list_get (players) num)) (deactivate_team_nav_point_object player (list_get (players) num)) ) ) )
(script continuous run_scripts (determine_carrier) (manage_num) (determine_carrier) (manage_num) (determine_carrier) (manage_num) (determine_carrier) ; 4 (manage_num) (determine_carrier) (manage_num) (determine_carrier) (manage_num) (determine_carrier) (manage_num) (determine_carrier) ; 8 (manage_num) (determine_carrier) (manage_num) (determine_carrier) (manage_num) (determine_carrier) (manage_num) (determine_carrier) ; 12 (manage_num) (determine_carrier) (manage_num) (determine_carrier) (manage_num) (determine_carrier) (manage_num) (determine_carrier) ; 16 (manage_num) )
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: May 16, 2009 01:31 PM
Msg. 10 of 19
Wouldn't it work better to attach the nav point to the object? Or would the nav point disappear after you pick up the nuke?
|
|
|

Headhunter09
Joined: May 6, 2008
This is the truth.
|
Posted: May 16, 2009 01:43 PM
Msg. 11 of 19
or replace the oddball with the nuke?
|
|
|

Me KS
Joined: Feb 2, 2008
Desire is Reality. Xfire: jetmaster23
|
Posted: May 16, 2009 01:57 PM
Msg. 12 of 19
Quote: --- Original message by: Gamma927 Wouldn't it work better to attach the nav point to the object? Or would the nav point disappear after you pick up the nuke? I see what you're saying. You want a nav point on the nuke constantly so that people always know where it is. I don't think it would disappear when a player picks it up, but there's a possibility that it might since any weapon held by a player is a child object of the player and not independent anymore. Thing is, you have to name the nuke to stick a nav point on it. And that means it has to be in the Items > Weapons in Sapien, which means it will disappear instead of respawning. I can circumvent that by constantly using (object_create) which will only create if it doesn't exist. But, then there's network issues. I'm pretty sure weapons are just like vehicles on client-side. This means that they can't be referred to by client-side scripts. It also means that object_create on client side creates a local client side copy of the weapon that can be referred to by the client side script, but doesn't exist on server side, so it's useless. So this means there's no way to stick a nav point on it on client side. Edited by Me KS on May 16, 2009 at 01:57 PM
|
|
|

Mysterion
Joined: Aug 9, 2008
Nice shot, but too bad your @$$ just got SACKED!!!
|
Posted: May 16, 2009 02:13 PM
Msg. 13 of 19
This will be really cool if it works...everyone will be trying to kill the nuke carrier as he gets closer to your base. Can you say, "Mass Evacuation"!
I wonder if there would be anyway to pick it back up and get it out of your base before it detonates? I suppose even if you could, folks would be sticking it up high and unreachable on a wall.
|
|
|

Headhunter09
Joined: May 6, 2008
This is the truth.
|
Posted: May 16, 2009 02:14 PM
Msg. 14 of 19
Quote: --- Original message by: Mysterion This will be really cool if it works...everyone will be trying to kill the nuke carrier as he gets closer to your base. Can you say, "Mass Evacuation"!
I wonder if there would be anyway to pick it back up and get it out of your base before it detonates? I suppose even if you could, folks would be sticking it up high and unreachable on a wall. or on your back.
|
|
|

Mysterion
Joined: Aug 9, 2008
Nice shot, but too bad your @$$ just got SACKED!!!
|
Posted: May 16, 2009 02:21 PM
Msg. 15 of 19
Everyone would be trying to get away from you, as the clock was ticking down...that would be so funny! Hey, that would open up the game for suicide missions...stick the nuke on your buddy and kick him out the back of a pelican.
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: May 16, 2009 02:23 PM
Msg. 16 of 19
You'd have to modify fall damage then...
|
|
|

Mysterion
Joined: Aug 9, 2008
Nice shot, but too bad your @$$ just got SACKED!!!
|
Posted: May 16, 2009 04:14 PM
Msg. 17 of 19
I will set fall damage high enough for freefall...
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: May 16, 2009 04:26 PM
Msg. 18 of 19
Not fall damage. Maximum falling distance. Even if it was set to the highest, there's a distance which if you cross, you will die. You have to set that one.
|
|
|

Mysterion
Joined: Aug 9, 2008
Nice shot, but too bad your @$$ just got SACKED!!!
|
Posted: May 16, 2009 11:25 PM
Msg. 19 of 19
correct...
|
|
|