Hey can anyone help me with a script?
Its going to be a turret on a ship, what it does is you say Target 'Name' then you can say Fire on Target or somthing and it will fire on them. e.g. Target Tom Geer then Fire on target.
Any ideas?
These forums are CLOSED. Please visit the new forums HERE
Targeting, then acting on a command |
|
Tom Geer
Registered User
Join date: 18 May 2005
Posts: 10
|
05-25-2005 11:52
Hey can anyone help me with a script?
Its going to be a turret on a ship, what it does is you say Target 'Name' then you can say Fire on Target or somthing and it will fire on them. e.g. Target Tom Geer then Fire on target. Any ideas? |
Jeffrey Gomez
Cubed™
![]() Join date: 11 Jun 2004
Posts: 3,522
|
05-25-2005 20:39
Try a forum search yet?
It's a common issue, so there's a lot of "linkity link" through some other threads on the issue. You should find some good advice there. _____________________
---
|
Byron McHenry
Registered User
Join date: 21 Sep 2004
Posts: 204
|
05-25-2005 21:07
Try a forum search yet? It's a common issue, so there's a lot of "linkity link" through some other threads on the issue. You should find some good advice there. let me tell ya that dosent help on bit what about for the non scripters who need to actually buy a script. |
Keknehv Psaltery
Hacker
![]() Join date: 11 Apr 2005
Posts: 1,185
|
05-26-2005 11:40
You can use this code fragment with a sensor:
CODE llLookAt(llDetectedPos(0),1,1); To look at the detected avatar. If you then couple it with a gun script, you should be able to get something functional. _____________________
|
Tom Geer
Registered User
Join date: 18 May 2005
Posts: 10
|
05-26-2005 15:43
Cheers.
Also is there someone that can teach me how to script in lessons? I know there used to be mentor classes but there isnt anymore ![]() I just want a mentor of my own really, some one who like gives me a faulty script and helps me make it right to improve my scripting skills, somthing like that. I live in england so ill be on GMT prime time really.. |
Jeffrey Gomez
Cubed™
![]() Join date: 11 Jun 2004
Posts: 3,522
|
05-26-2005 18:16
let me tell ya that dosent help on bit what about for the non scripters who need to actually buy a script. Exactly so. I'm in the business of teaching people who are willing to learn - by offering help to them in the form of learning resources. I am not in the business of selling scripts. If you want me to do all the work for you, all the time, you're out of luck. That said, to address the statements further down the line, I do offer one-on-one help as needed. This is voluntary, and I don't ask for pay for it. Feel free to IM me in-world if you have a question. _____________________
---
|
Tom Geer
Registered User
Join date: 18 May 2005
Posts: 10
|
05-27-2005 02:46
I am trying to learn scripting.
A friend just asked me if i could do this script, i didnt know how so i asked here. I just wanted some pointers or the script to learn from and use snipbits of it later on. |
Jeffrey Gomez
Cubed™
![]() Join date: 11 Jun 2004
Posts: 3,522
|
05-27-2005 03:39
Nah, that's fine. The brunt of those comments are for Byron.
![]() _____________________
---
|
Tom Geer
Registered User
Join date: 18 May 2005
Posts: 10
|
05-29-2005 16:22
any more help on this
![]() EDIT: Ok im using the target thing you quoted. How do u make it so it locks on or points to someone you say? e.g. /target tom geer. I can get it so it targets people who touch it though, which is really cool ![]() |
Tom Geer
Registered User
Join date: 18 May 2005
Posts: 10
|
05-30-2005 02:31
You can use this code fragment with a sensor: CODE llLookAt(llDetectedPos(0),1,1); To look at the detected avatar. If you then couple it with a gun script, you should be able to get something functional. Yes but that only looks at the avatar if they activate it (e.g. by touching the object). I need something that will target a person with a command from the owner. |
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
05-30-2005 04:56
Since you already know where the wiki is try looking up llListen() and llDialog().
You can either use listen to ping for a name that you want to shoot, or llDialog if you're scanning more regularly to let you pick a target from a list of those already detected. Moot about lag - I suspect the former, especially if you use a silent channel and maybe a touch activator for the listen is less laggy than the sensor repeats - but that is an entirely untested opinion. |
Jon Marlin
Builder, Coder, RL & SL
![]() Join date: 10 Mar 2005
Posts: 297
|
05-30-2005 05:43
Yes but that only looks at the avatar if they activate it (e.g. by touching the object). I need something that will target a person with a command from the owner. The simplest way to do this is to trigger a one-shot sensor event looking for the named avatar - look at llSensor in the wiki. You can use llDetectedKey in a sensor event. - Jon |
Keknehv Psaltery
Hacker
![]() Join date: 11 Apr 2005
Posts: 1,185
|
05-30-2005 08:46
This may be what you want...
Just say the person's full name on channel 2, and it will target them. It also tracks them with a sensor repeat. CODE
Hope this helps... _____________________
|
Tom Geer
Registered User
Join date: 18 May 2005
Posts: 10
|
05-30-2005 10:28
Sorry but i am a newb
![]() How do u say somthing on a channel, i know 0 is open but how do i say somthing on channel 2 Also how do i change it so it works with target NAME HERE e.g Target Tom geer (or better /target tom geer) Not just saying tom geer. |
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
05-30-2005 13:13
Sorry but i am a newb ![]() How do u say somthing on a channel, i know 0 is open but how do i say somthing on channel 2 Also how do i change it so it works with target NAME HERE e.g Target Tom geer (or better /target tom geer) Not just saying tom geer. Like this: /2 Tom Geer By typing in the above, you will say "Tom Geer" on channel 2. It wont appear in your chat history or be audible to other avatars near you. Any scripts listening on channel 2 will hear the message. ==Chris |
Tom Geer
Registered User
Join date: 18 May 2005
Posts: 10
|
05-30-2005 14:17
Cheers!
Any help attaching it to a wepon? |
Keknehv Psaltery
Hacker
![]() Join date: 11 Apr 2005
Posts: 1,185
|
05-31-2005 09:58
Well, it doesn't actually work with attached objects. As you may have heard, it is impossible for an attached object to change its position or rotation. Because of this, it wouldn't work...
Now I think I know what you really want. You want an auto-targeting gun, correct? That is a slightly harder feat to manage. Usually, seeking bullets are the means by which it is done. _____________________
|
Tom Geer
Registered User
Join date: 18 May 2005
Posts: 10
|
06-02-2005 06:58
Yea i've been having trouble fixing it so it can be moved. I've also tryed using hinge joints. But it didnt work.
|
Zindorf Yossarian
Master of Disaster
![]() Join date: 9 Mar 2004
Posts: 160
|
06-02-2005 14:04
Don't use hinges. They suck. llLookAt(...) should work with non-physical objects.
_____________________
Badass Ninja Penguin: Killing stuff it doesn't like since sometime in May 2004.
|