Jump to content

Help to noob maker


CBRTOLLIA
 Share

You are about to reply to a thread that has been inactive for 1737 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi!

I`ve recently start roleplaying in SL, and have many problems with combat situations. 

So i`ve desided to make my own weapon, armory etc.

Please give me links there i can get some information about programming in SL. And what language is used in it.

 

Sorry for my bad english.

Link to comment
Share on other sites

All scripting in SL is done with the Linden Scripting Language (LSL).  You can start at the LSL portal and find links to tutorials, examples, and detailed descriptions of functions.  This forum is designed as a place for LSL scripters to share insights and ask for assistance on specific ideas that they are trying to develop as LSL scripts.  You will also find many resources in world.  You may want to visit, in particular, the College of Scripting, Music, and Science.

Link to comment
Share on other sites

In SL, there are several different combat systems available, all made by residents.  

Most -- probably all -- RP groups use one of these systems.   That is so people's weapons and HUDs can talk to each other, to register hits and so on.   If you are using weapons from one combat system and I am using weapons from another, we will find it difficult to fight with each other, since I will not know when you have hit me, and you will not know when I have hit you.

So I would advise you first to find a RP group you want to join and find out what weapon system they use.   Some systems provide scripts, or even the whole API, for weapon-makers.   Than we probably help you.

But there is no point in learning how to make weapons before you know what weapons system you want to use.

Link to comment
Share on other sites

I`m alredy in such group. This people invited me into SL. The problem is in the sistem they use. METR is ugly,  weapon is terrible, etc. And as i`ve learned couple of programming languages in highschool (Here, in Russia, we have different education sistem, so i could call it wrong way) i`ve desided to make my own METR, weapon, gestures, etc.

Link to comment
Share on other sites

In that case, you need to find out what combat system your group is using, and then find out how to obtain a copy of the API.

The system will be written in LSL, of course, since that's the only programming language used in Second Life, but unless you know the specifical channels your group's weapons system uses to communicate, the format it expects messages to be in, and how the damage system works, you can't make anything for that system.

What is your group's combat system called?

 

Link to comment
Share on other sites

They have used few options: it  was "METR_DiabloCS - BOX  Uniform edition" for mele and "STRIKEBALL - WEAPON & EQUIPMENT" for distace fight. The next stap was rescripting of some free AK-47. And all of them have same issues: first of all there isn`t any diversity in the hit zones, second: there are very few of us and we have to play the entire sqad by 3 or 4 players. So new sistem is supposed to solve this issues and idealy, if i find the way take different damage fromm different weapon.

 

Link to comment
Share on other sites

The main idea is to write my own combat sistem. For this moment i have not an idea how to detect collision with different body parts to recive different damage pionts. If you can help with figureing it out it would be great =) I`ll certanly try sistem you`v gived lik to.

For now me and my friend have rescripted https://marketplace.secondlife.com/p/Realistic-Health-Meter-body-hit-detection/3879751 few times. There damage differencing by fractions of height that help to get hadshots and lower damage to legs. We use it to learn but it do not work propely fo some undetected reasons. As we understood there is some not obvious connections between coordinats of avatar, coordinats of script and height of both.

Link to comment
Share on other sites

You probably won't like this answer, but I'd defintely look at something more straightforward. There's no easy way to detect bodypart-collisions in Second Life, the only agent-collision you can get is with the bounding box - which is 0.45m x 0.6m x <Agent Height>

When I built a system that detects hit locations, I ended up having to work out how to code:-

  1. A method to turn the collisions into x-y grid results (to work out the hit location).
  2. A lot of angular mathematics (to work out which way the agent was facing when hit).
  3. An estimate of where the avatar's limbs are likely to be for each generic animation (sat, standing, walking, running, etc) (to work out where the avatar's arms, legs and head probably were when they got hit).

I don't know that anyone's going to sit here and walk you through any one of these steps - let alone all three - just to end up with something that might not be accurate enough to work for you. Mine only works because it has a very limited use.

It would be easier to create a system that only detected headshots, you'd only need to figure out step 1, provided you didn't want to track sit/stand status. Just one idea to simplify your request, make it more achievable.

Link to comment
Share on other sites

Some background to Freya's excellent advice (and if Freya says she finds something difficult to script, then it really is difficult!).

When you detect a collision with an avatar, the position detected is that of the avatar, not the point of collision.   That's simply the way Second Life works, and the only way round it is the sort of complicated work-round that Freya describes.    

The problem is made worse by the fact that the simulator has no idea where an animation places you.   It knows that it's sent an animation to your computer for your CPU and GPU to play, but it has no idea what that animation is making you do.   As far as the simulator is concerned, you're simply standing or sitting there without moving unless you're actually pressing a movement key.

I'm not an expert in weapons-making or game design but maybe one approach would be  to detect a hit by calling llSensor with a very narrow beam (or  use llCastRay) and then let the weapon or HUD decide where exactly it's hit the avatar using probabilities, as they do in table-top RPGs.   

 

Link to comment
Share on other sites


CBRTOLLIA wrote:

Starting this i`v understood it would not be easy. 

Is there any way to run script inside weapon by pointing it and clicking to run skript in other person`s avatar? (for the usual touch any gestures and poses works)

Yes, that's easy.   Messages sent by the function llRegionSayTo(id, channel, message) are, if id is the uuid of an agent on the region, heard by any object that agent is wearing (or sitting on) that is listening on channel.

 You might also, if you are writing your own combat system, want to consider using the new Experience Tools.    They offer huge conveniences to the scripter, since you can use them to store persistent  key-value data pairs on LL's servers and read them, and also they greatly simplify permissions requests.

http://wiki.secondlife.com/wiki/Category:Experience_Tools

Link to comment
Share on other sites

To my mind, Experience Tools have two main advantages.   First, the experience tools system allows you to use LL servers to store and retrieve player data.    This is a great improvement on the alternative -- which was, for many years, all we had -- of stroring the individual player's data locally, in his HUD, and having the HUD handle all communications.

The other advantage is that Experience Tools greatly simplify the permissions system, since -- for example --  any script that's set to the experience can animate any avatar who is part of the experience.   It doesn't have to send a request to an item the avatar is wearing (or put up a dialog message asking for permission to animate him).     

I am not sure I fully understand what you mean by "llRegionSayTo could be pointed on the attached prim".  As I said earlier, if id is the UUID of an agent, llRegionSayTo(id, channel, message) sends the message to all attachements that agent is wearing that are listening on the channel.   So if you want to send a message to an attachment worn by a particular player, llRegionSayTo(player, channel, message) is the way to do it.   You don't need to know the uuid of the actual attachment.

I don't understand what you mean by the "pretty solvable issue with auto/semi auto" fire.  Normally, you would use the control event to tell when a player is pressing down the left mouse button, and you can use the two integer values, level and edge, to decide whether he's keeping the button pressed down (automatic fire) or releasing it and then pressing it again (sem-automatic).    

Link to comment
Share on other sites


Innula Zenovka wrote:

So if you want to send a message to an attachment worn by a particular player, llRegionSayTo(player, channel, message) is the way to do it.   You don't need to know the uuid of the actual attachment.

As i understend i have to use attachment UUID to take different damage for different body parts. (Makeing wearing hitboxes for every body part seems to be a good idea)


Innula Zenovka wrote:

 

Normally, you would use the
 to tell when a player is pressing down the left mouse button, and you can use the two integer values,
level
and
edge, 
to decide whether he's keeping the button pressed down (automatic fire) or releasing it and then pressing it again (sem-automatic).    

This is the way to describe automatic weapon mode. If i want get single shots every time  with no matter how long click takes there maust bethe second mode.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1737 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...