Jump to content
ALI131129i

Finding Direction of target

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

Share this post


Link to post
Share on other sites

You are at llGetPos and your target is at llDetectedPos(0). Therefore the vector TO that target is llDetectedPos(0) - llGetPos().  I assume that's what you are already using, so what's not working?

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

You think i didn't know that xD , I wanna make a pusher that pushes in no-push zone Innula Zenovka

Edited by ALI131129i

Share this post


Link to post
Share on other sites

And Rolig I'm not trying to move THAT person back again , I will move myself back after my avi pushes target few meters away.

Edited by ALI131129i

Share this post


Link to post
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...
 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

So basically, if someone bumps into you, you want to shove them.

I was tempted to post code that made you fart repeatedly instead, but meh.

xD

Share this post


Link to post
Share on other sites

Its possible :P I seen it someone using it and works pretty well , trying to contact its creator but no response

position/rotation calculations are confusing

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Oh I figured it out myself , JUST needed to Divide the Pos by Root Rotation . Its True that your Best Teacher is yourself. Thanks anyways guys

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

No no I took that as a project AND that was a challenge for me to boost my skills , I just take an idea and make it my goal. I don't actually want to grief around.

  • Like 1

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...