Jump to content

Finding Direction of target


ALI131129i
 Share

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

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

Recommended Posts

I want to make a script that makes me push the person who comes near me , I used llSensorRepeat and set range to 0.7 , But i can't figure out the position/rotation to push, I want my avi to push the person and return back , I need help how to use llPushObject(llGetOwner(), . . .) , Can't find the direction/position of my target. I used llDetectedPos(i) and llGetPos() then llVecNorm to get the normalized vector and then used that as direction but still not working good.

Edited by ALI131129i
Link to comment
Share on other sites

The pusher needs the direction where it will push my avi to

I want to push the person who bumped me , using llPushObject();

Don't want a constant push just push the target few meters and comeback usind llMoveToTarget(PreviousPosition);

how will i do that

Edited by ALI131129i
Link to comment
Share on other sites

I already told you how to push the target.  That's the vector I gave you. Just multiply it by a scale factor.  There's no way to use llMoveToTarget to move that person back again, though.  llMoveToTarget only works if it is in the scripted object that is being moved.

Link to comment
Share on other sites

10 hours ago, ALI131129i said:

I want to make a script that makes me push the person who comes near me , I used llSensorRepeat and set range to 0.7 , But i can't figure out the position/rotation to push, I want my avi to push the person and return back , I need help how to use llPushObject(llGetOwner(), . . .) , Can't find the direction/position of my target. I used llDetectedPos(i) and llGetPos() then llVecNorm to get the normalized vector and then used that as direction but still not working good.

llPushObject does this for you.   If you check the wiki, you will see it's llPushObject(ID,<impulse>,<angular impulse>, LOCAL).

ID is the uuid of the avatar or object you want to push (so not llGetOwner() in this example, but the uuid of the avatar you want to push).  Impulse is a vector indicating the direction in which you want to push ID, angular impulse we can ignore here because it doesn't apply to avatars, and LOCAL is an integer value for TRUE or FALSE.   If LOCAL is true, that means you want to use ID's frame of rotational reference ("make the direction local" as it's often described), rather than that of the region, to calculate the direction in which to push ID.

So

llPushObject(ID, <-100.0,0.0,0.0>, <0.0,0.0,0.0>,TRUE);

should give ID a hard shove on ID''s negative x axis -- backwards, in other words.

Edited by Innula Zenovka
Link to comment
Share on other sites

10 minutes ago, Love Zhaoying said:

Not possible.

Possible if you use rlv... There are scripted rlv commands that can move an avatar, rather inaccurately, but not advisable, besides which, making something to push other peoples avatars just because they bump into you in some busy place would technically be griefing, and doing it in a way to circumvent no push region settings is naughty...
 

Link to comment
Share on other sites

7 minutes ago, Klytyna said:

Possible if you use rlv... There are scripted rlv commands that can move an avatar, rather inaccurately, but not advisable, besides which, making something to push other peoples avatars just because they bump into you in some busy place would technically be griefing, and doing it in a way to circumvent no push region settings is naughty...
 

Lol fail.

Link to comment
Share on other sites

This Scripts pushes the target pretty well , But only if target in infront he gets the hit :/

 

default
{
    state_entry()
    {
        llSensorRepeat("","",AGENT,0.7,PI,0.05);
    }

    touch_start(integer total_number)
    {
    }
    
    attach(key k)
    {
        if(k)
        {
            llResetScript();
        }
    }
    
    sensor(integer n)
    {
        vector pos2 = llGetPos();
            vector pos = llDetectedPos(0);
            llMoveToTarget(llVecNorm(pos-pos2)*llGetRot(),0.05);llSleep(0.05);
            llPushObject(llGetOwner(),<1,0,0>*999999999,<0,0,0>,1);
            llSleep(0.05);llMoveToTarget(pos2,0.2);llSleep(0.2);
            llStopMoveToTarget();
    }
}

Edited by ALI131129i
Link to comment
Share on other sites

That will not work in a no-pushing zone.  If pushing is not allowed, llPushObject can only be used to push yourself.  Klytyna is right.  Trying to push someone where it is not allowed could get you in a lot of trouble for griefing.  Forget this.  It's a dumb idea.

  • Like 1
Link to comment
Share on other sites

It does push me

See i used "llPushobject(llGEtOwner(),)"

I'm pushing myself xD God , It IS POSSIBLE , My script pushes me so my avi hits the target but only if target is in front of me , i can't do calculations so it pushes no matter where target is

Edited by ALI131129i
Link to comment
Share on other sites

Well, yeah, you can always push yourself. And yay w00t congrats on being able to shove people. Oh, and if you find after a short while that nobody inworld replies to you when you try to chat with them, it'll be because they've derendered you for shoving people. Oh, and expect the ones who don't derender you to file ARs.

Honestly, I think a far better solution would be to emigrate from the kiddie-pool newbie areas where people don't know how to walk and navigate yet, and stay clear of any landing zone on any sim, because people are going to bump into people no matter what.

If someone's shoving you around on purpose though, why not just do what I and every other emotionally mature person in SL does, and simply make them vanish, so they can't push you (or anything you) anymore. It's easier than explaining why you're going around shoving people with a script. Shoving people for bumping into you just makes YOU look like a butt.

  • Like 2
  • Haha 1
Link to comment
Share on other sites

Yeah, sorry if I came off a little harsh, myself. I know that weaponly things are a lot of fun and a major motivation to a lot of newer scripters, because I've already gone there... <-< from flaming bunny launchers to systems for "breaking" shields and all of that kind of stuff. As long as people are responsible, and aren't ruining anyone else's fun, then hey. And as long as everything complies with the TOS, you can make whatever you like, that's the kind of creative freedom SL is supposed to be about, and it's awesomely yay.

But yeah, I'd be careful testing anything without warning people, and it's hard to find places that are "free-for-all" areas (places that let you shoot at people and use pushers and all) anymore, so there really aren't that many places where pushy bumpers wouldn't get a person scolded, or worse, kicked out (except for some particularly cruddy areas where griefing frequently goes unreported).

I have a trunkful of cool things I can't really use inworld, but they were fun to make, anyway. Just be safe. It's easier to get into trouble than it is to get out of it.

Edited by Berksey
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2210 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...