Iwant the pool cue to rotate around the cue ball as the player drags the mouse, I've played some pool games on the internet and they all seem to work this way. This will eventually be a browser game.
You could probably test for greater than zero or 0.01, but 0.03 is about two-degrees from straight up and allows for some slop in physics. This works by comparing the distance between A) a point in space 1m directly above the pin's Z-axis and B) a point 1m above the prim on the world Z-axis..
Take a look at moving_start and moving_end
Both will trigger an event where you can look at change in position and change in rotation
You also have the collision_start event that will trigger when the pin is hit
That all helped a lot. I actually hadn't actually started the script just yet but that was exactly what I needed to know to at least get the collision detection down and such. Now I just have to get the rotation to be compared.
Below is what I have. It worked until I added rot = llGetLocalRot(); and got a mismatch error and not sure what is wrong. Also I might later add a timer, or something, instead of waiting until the pin stops moving so that a turn doesn't last too long but we'll see. I need to test more to see if that is ever a problem.
I wish to draw your attention to this part of your code. Consider what happens when the bowling ball hits 10 pins in RL: A LOT of collisions in a very short time. Pins will be hitting other pins, the ball might be banging into any given pin a number of times, everything bouncing off the alleyway and walls; that's the "CRASSSHHH!" you hear at the moment I bowl a strike.*
Now, when more than one collision with a task takes place in less than 1/45th of a second, ALL of them together become available to the collision_start event handler. That's the purpose of having "integer num", so you can determine how many you need to process during that event trigger. And "llDetectedName(0)" is going to address only the first in the list of all the collisions. So, I don't know what you intend to do with the "trigger" boolean but you may want to rethink this a bit more.
Oh that project is amazing, Can't believe that exists. Though if I follow that entirely I would feel like I am cheating. At least I might be able to modify it to work with the features I am hoping... but after looking it over a bit I'm not sure. The scripts themself could be helpful to learn, so thank you. but it is quiet a bit more complex to use than I am hoping to make mine. I'll see what I can do.
@LepreKhaun - That was supposed to make sure that the pins were only going to get hit by the ball. After what you have said it made me realize I am going to need to rethink it. The ball wont be the only thing that is hitting the pins and having them knocked over. Another pin might hit a pin and knock it over.
You don't have to make the collision some kind of rocket science
When all have settled down and nothing moves, just count how many pins are still standing
That's what you do in real life anyhow
Yea that would be the simplest but I don't want anyone to be able to use anything but the ball. Is there a way to do that without it being to over complicated and without anyone being able to just name anything ball.
Well, in RL the pins wouldn't know the name of whatever knocked into them. If some rowdies got into the bowling alley and started lobbing softballs down the alley, the pins would still fall over if they got hit. Why should SL be any different? Just make the pins physical, roll the ball into them, and see what's standing when the fun stops. If someone cheats by throwing a softball, kick them out of the game.
Still I'm not making this just for myself. I am making this for others and to hopefully sell. If it stops others from cheating that might be a wanted feature. Then again if I am going for realism, as you compared, then cheating shouldn't be my problem. That should be the issue of the alley owner. It would substantially make the script simpler anyway and for me, who is a scripting newbie, simpler is better.
Exactly. All flippancy aside, I suggest that you take a look at pool tables on the market in SL. You'll find that the balls on a pool table are handled as I described: physical spheres that collide with each other, roll around a bit, and eventually stop or fall into a pocket somewhere. They don't care which other ball hit them. They just respond to being bumped. Bowling pins and pool balls have a lot in common that way in RL. Why not in SL?
(Actually, it's not quite that simple, since physics in SL doesn't play by the same rules as in RL. You do have to take care to model friction properly so that a pool ball or a bowling pin rolls to a satisfying stop and doesn't start moving on its own in a crowd of other balls or pins. That part of the scripting puzzle can be frustrating. Still, it's doable. )
Last year I shared some PowerShell code on Twitter about this time of year. I have a short script that uses Windows Presentation Foundation (WPF) to create a spooky graphical prompt that allows you to ask questions of a Magic 8 Ball (this name may be trademarked or otherwise protected). For those of you who may not be familiar with it, this is a toy shaped like a giant 8 ball from a billiards game. You ask a question aloud, shake the ball, and look at the bottom to get an answer. I did the same thing with PowerShell.
Almost everyone uses a bit different pool rules, so this script doesn't restrict you to any ruleset. You can reset the game anytime, and play ball-in-hand (so you can place the ball anywhere) wherever you want. To prevent players from cheating, you must watch the game and stop them from doing so.
Live the life of Basketball Pro with this awesome resource. Allows you to play solo or compete against others - even bet on winning the game! Show your skill with precise shots and awesome trick moves.
However, what ends up happening every time, no matter what I tweak, is that every ball behind the front pool ball is hit with the same momentum, at the same time. I have no idea why this should be happening. If anyone knows how to achieve this sort of collision or if anyone knows how pool physics actually work then please let me know.
I gave a similar answer about 6 years ago. However some things have changed since then. You can now drive the physics system manually doing smaller timesteps might help, however as explained it might not necessarily fix your issues.
Also check your velocity thresholds in the physics settings. Any collision below that threshold is always treated inelastic. This is to stop tiny amounts of energy to bounce endlessly between many bodies. You might want to lower them.
Ok, so I have a script that is basically an internal App Store for our School. The first script runs the 2nd script as another user, then the 2nd script has a #RequireAdmin tag at the top to have the script run elevated. The user that is specified to run the script has to have local admin rights for the elevated privileges to work on the second script.
Cheers - I will take a look and see if that works for me in WIndows 8. I suspect that for my purposes running these 2 small objects as SYSTEM may actually be safer than using encrypted admin passwords where the hash can be found through decompilation. Our admin password is pretty insane so would take a looooong time to decypher it though.
on Win7: Elevated (Administratror) command promt is opened
on Win8: NOT-elevated command promt is opened
How can I easily (without changing any registry/system settings) run elevated command prompt on Win8?
Thank you.
Sorry for dredging up my old topic but as I'm re-building my Windows 8 image from scratch using a Windows 8.1 Enterprise base I thought I'd let you know that I've managed to simplify things a bit this year managing to let users run a couple of commands as admin (well SYSTEM actually!).
One thing I noticed over the last year is that Microsoft tend to use Scheduled Tasks more often than just putting a shortcut into the startup folder these days it seems. And last year for some reason I completely forgot about the great tool that is PSEXEC. PSExec.exe needs to be in the Windows dir for this one...
So what I do is have an autoit script running as SYSTEM at PC startup via a scheduled task with "Run with highest privileges" enabled awaiting for two particular files to exist using the following little bit of script...
Also I think you have misunderstood - I don't run the PSEXEC command as the user - it is run as SYSTEM (so I probably don't need the "-s" switch in there really) but is watching for a file to be dropped in a certain location by a non-admin user to run the command. In the scheduled task that starts the main loop as SYSTEM it's set to run with highest privileges.
The title of the thread is "Run as Elevated Admin from Standard User Account without prompt", if you have "solved" can you provide a working script, run example powercfg -setactive 123456789, that require admin rights, without any UAC prompt, from an standard account? The complete procedure please, including the scheduler task if is a part of the procedure.
I have this script looking for two files as I need to only run two commands but you could have it look for any file and any number of items or look for one file but vary the contents and do a FileReadLine if desired.
So the user simply creates a file in an area they have rights to and the script running as SYSTEM catches the existence of that file and runs a PSExec command as required. In my case it runs a couple of PowerShell scripts that only work as an admin.
Bear in mind that this DOES NOT run the command as the user (there is simply no way to run commands elevated to administrator by a standard user account as Windows cannot do it) instead it runs it as SYSTEM but visible to the user so anything that relies on modifying the user's profile files or registry then you will need to do a little more to check for the console user - but these commands can normally be run as the user anyway). I don't recall if powercfg is per user or per computer but I'd presume it's per computer as you can only run one power profile at any one time so this should work without any modification as far as I'm aware.
3a8082e126