Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Paintball System

Randy MacMoragh
Registered User
Join date: 15 Sep 2008
Posts: 6
12-01-2008 07:38
I've been assigned the task of creating a sort of paintball/combat system for a class I am taking. I'm not very skilled in LSL but I have a little xp. I was wondering if anyone had some suggestions as far as what scripting techniques to use, I basically just want the gun, which I have one of already but it could be better, to shoot a paintball and when it hits another player, that player raises his hands, the shooter receives a point (also need a score kept) and both players are returned to a starting point. Any helpful suggestions for this project would be greatly appreciated.
Randy MacMoragh
Registered User
Join date: 15 Sep 2008
Posts: 6
Please
12-01-2008 09:22
Ok maybe I was unclear in my previous post, essentially I am looking for suggestions as well as wondering what my options are as far as: is there a command to make an avatar raise his/her hands? how about setting a spawn point and returning avatars to said spawning point? I have a "popgun" script that fires little balls but how can I make those explode on impact and trigger other events?
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
12-01-2008 09:38
This is more or less possible, but it is not a beginner's project. Do you have all semester, or is this due next week?

Let's suppose you are in a paintball arena of some kind.

x Can an avatar detect when it is hit by a paintball? Yes. That is called a collision.
x Can an avatar raise his hands? Yes. When hit by the paintball, start an animation. You might have to make the surrender animation yourself, but meanwhile you could have him dance. 8-)
x Can avatars be made to return to a starting point? Yes, several ways, such as having the pop-gun move to the starting point...the avatar will follow.

The two guns can communicate using chat on a private channel. That way, when I hit you, your gun tells my gun and we both retreat to the start position.

These are only high level ideas to get you started. We don't like doing other people's homework.
_____________________
So many monkeys, so little Shakespeare.
Randy MacMoragh
Registered User
Join date: 15 Sep 2008
Posts: 6
thx
12-01-2008 12:17
Thank you Lee, these are the kind of ideas I was looking for. I will post back as I run into problems, and yes this is due friday... but don't worry I have plenty of concerta.
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
12-01-2008 12:57
Best bet would be a two-part system. Ever play Laser Tag? Each participant wears a vest with sensors on it, that detects when you are hit, and deactivates your gun for a while. The shooter also detects the hit with their gun, and scores points.

The bullet would be scripted to do an llRegionSay on a non-zero channel, communicating back to the shooter's gun with the fact that they scored a hit, and who was hit (Key of the target avatar). You use llRegionSay so the target can be more than 30M from the gun and still talk back to the shooter. The bullet also whispers something to the person it hits, so their attachment can hear it.

Make an attachment that each person wears, which listens for the bullet's whispered "you have been hit" comment. This activates your animation and your "walk to your starting box" sequence, while deactivating your gun.

The gun has to listen to its own bullets (to collect score for hitting others), and to the attachment that you are wearing that scores hits on yourself, to deactivate the gun until you get back to the start box.

The start box is scripted to reset everything when you step into it, or after a suitable delay once you have gone back to start.

Bonus points: Script it so each person's gun and hit detection gear can ONLY respond to hits that should be scored, and so it doesn't score a hit on both Players if they are within whispering distance of each other.

Extra bonus: Script it to allow for more than two Players, with scores for each target.

Good luck!
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
Randy MacMoragh
Registered User
Join date: 15 Sep 2008
Posts: 6
any ideas?
12-02-2008 18:11
any ideas how you would make a paintball splatter and create a temporary blue mark?
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-02-2008 19:19
From: Randy MacMoragh
any ideas how you would make a paintball splatter and create a temporary blue mark?

Particles! Go see the Particle Laboratory to get the parameters you will need.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Yingzi Xue
Registered User
Join date: 11 Jun 2008
Posts: 144
12-03-2008 03:09
Here's a simple particle effect I threw together. Change the color to what you want. Start color and end color should be the same if you want the effect to remain the same color. Otherwise, if you want the color to fade from one to another make the start and end different.

From: someone

llParticleSystem([
PSYS_SRC_MAX_AGE,1.000000,
PSYS_PART_MAX_AGE,0.500000,
PSYS_SRC_BURST_PART_COUNT,30,
PSYS_SRC_BURST_RADIUS,0.500000,
PSYS_SRC_BURST_RATE,1.000000,
PSYS_SRC_BURST_SPEED_MIN,2.000000,
PSYS_SRC_BURST_SPEED_MAX,5.000000,
PSYS_PART_START_COLOR,<0.00000, 0.00000, 1.00000>,
PSYS_PART_END_COLOR,<0.00000, 0.00000, 1.00000>,
PSYS_PART_START_ALPHA,1.000000,
PSYS_PART_END_ALPHA,1.000000,
PSYS_PART_START_SCALE,<0.22756, 0.22756, 0.00000>,
PSYS_PART_END_SCALE,<0.22000, 0.22000, 0.00000>,
PSYS_SRC_ACCEL,<0.00000, 0.00000, 0.00000>,
PSYS_SRC_OMEGA,<0.00000, 0.00000, 0.00000>,
PSYS_SRC_ANGLE_BEGIN,0.000000,
PSYS_SRC_ANGLE_END,0.000000,
PSYS_SRC_PATTERN,PSYS_SRC_PATTERN_EXPLODE,
PSYS_PART_FLAGS,PSYS_PART_EMISSIVE_MASK | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK
]);
Randy MacMoragh
Registered User
Join date: 15 Sep 2008
Posts: 6
help
12-03-2008 20:24
Ok, so I basically have everything built... but I'm having trouble teleporting players to their starting bunkers. I have the chest sensor set to listen for "teleport" and when it heres teleport it calls llSitTarget to move to the pos of the bunker (1,1,0) offset. I feel like maybe the chest sensor can't sit the avatar or something, any input?
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-03-2008 20:37
From: Randy MacMoragh
Ok, so I basically have everything built... but I'm having trouble teleporting players to their starting bunkers. I have the chest sensor set to listen for "teleport" and when it heres teleport it calls llSitTarget to move to the pos of the bunker (1,1,0) offset. I feel like maybe the chest sensor can't sit the avatar or something, any input?

Sitting on an attachment doesn't work very well. You would have to move the avatar instead.
How far would you need to move the avatar?

Look in the wiki at llMoveToTarget & llApplyImpulse.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Randy MacMoragh
Registered User
Join date: 15 Sep 2008
Posts: 6
any way to...
12-04-2008 11:30
any way to center an object between two fixed objects?