Jump to content

Combat meter


Poltergeist Azarov
 Share

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

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

Recommended Posts

Hello, after some discussions about llcastray limits, I decided to use a system that manually detects avatar positions at each bullet hits for my simple combat meter. Is this a good idea? If so, what is suggested to use? I was checking llGetAgentList for this operation earlier but not really sure if its gonna be fine to get agent list often. Any suggestions?

Link to comment
Share on other sites

You don't give much information about how the combat meter is supposed to work, but remember that (assuming you're not using llSetDamage()), when you hit someone, the script in your bullet knows llDetectedPos(0) and also llDetectedKey(0), which can then be used to determine stuff like llGetObjectDetails(id, [OBJECT_POS]).

I don't really understand why you would need to use llGetAgentList.   

Link to comment
Share on other sites

Calling llGetAgentList multiple times gives you no new info - just the same probably pretty large list of uuids over and over again. The list needs to be processed b4 it is of any use which will lead to a 2nd probably large list.

Since you think about a combat hud - a hud can easily send a message on entering sim, attach, detach so that will be more appropriate to log in/out players.

There will be a network of informations flowing, You need a plan how to organize that. Server based, peer to peer?

Keep in mind: ppl will always cheat - in rl, sl, games, whereever there is a chance so dont make that too easy.

Link to comment
Share on other sites

Why do you think you need to use  llGetAgentList?   How are you going to make use of the information it provides?   That's what I can't understand.    You need to know if you've hit someone.   How does llGetAgentList help you?  

If you're hoping to calculate whether a shot fired from your position and rotation would hit them,  how are you going to know if they're hiding behind a wall to protect themselves from your shots?

 

Link to comment
Share on other sites

Hello Nova, for now I am just going to make a simple meter that I can put it into my gun. Its not something so serios to be based on a server yet. At least for now, we are playing with friends. Needed to make something fast and such... I will focus on your suggestion about llGetAgentList, thanks for it. So far I wrote something like the following script and not sure yet if its simple enough. Let me know your further suggestions please...

on this example, when you face your crosshair against an agent, object starts to blink... 

integer InsideAgent(vector agentpos, vector hitpos) {        vector HAsize=<0.6, 0.6, 2.0>/2;    vector abmax=agentpos+HAsize;    vector abmin=agentpos-HAsize;    vector hp=hitpos;        if (hp.x>abmin.x && hp.y>abmin.y && hp.z>abmin.z && hp.x<abmax.x && hp.y<abmax.y && hp.y<abmax.y) { return TRUE; }    else { return FALSE; }}integer changecolor;default{    state_entry()    {        llRequestPermissions(llGetOwner(),0x400);        llSetTimerEvent(0.1);    }    touch_start(integer total_number)    {        llSetTimerEvent(0);    }    timer() {        vector   campos=llGetCameraPos();         rotation camrot=llGetCameraRot();                list agents;         integer i=llGetListLength(agents=llGetAgentList(AGENT_LIST_REGION, []));        while (~--i) {            key    agent   =llList2Key(agents,i);            if (agent!=llGetOwner()) {                vector agentpos=llList2Vector(llGetObjectDetails(agent,[OBJECT_POS]),0);                vector hitpos=campos + <llVecDist(campos,agentpos),0,0>*camrot;                                if (InsideAgent(agentpos, hitpos)) {                     //llOwnerSay("inside the agent. pos: "+(string)hitpos);                                        if (changecolor=!changecolor) llSetColor(<1,1,1>,1);                    else llSetColor(<1,0,0>,1);                }            }        }    }}

 




Link to comment
Share on other sites

As I realized so far, almost all physical bullet based guns having trouble with the walls since they are not slow enough to detect a wall. I dont know but all the best weapons around has the same problem. The other issue is rezzing bullets often, causes serious problems for a combat game. Thats why am going to try a simple gun with a simple meter which does not force to have a rez right also. When it comes to wall issue, I am planning to use castray to detect surfaces around. However, if you have anything better, please let me know Innula.

Link to comment
Share on other sites

back in the bad/good old days bullets were made with a long tail. a root prim that looked like a bullet. A linked prim long like a tail

the collision event will catch the tail at any time unlike start_collision. The size of the tail relative to the speed of the bullet

some of the tails were pretty long back in the bad old days bc could put multiple force/push scripts in a single bullet. to get massive massive speed. Now today that multipush script way been nerfed. Is still fast but not massive fast like back then

the technique still apply tho

some tails were made transparent. others full bling. like laser pulses etc 

Link to comment
Share on other sites

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...