rotation angle snaps..

Ask questions, discuss ideas, get answers
Post Reply
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

rotation angle snaps..

Post by fo0k »

possible to make a player controlled object that will rotate when a button pressed... but only rotate by say 10 degrees each time you click?
User avatar
archer
Posts: 54
Joined: Fri Feb 05, 2010 4:40 pm
Location: Übertów
Contact:

Re: rotation angle snaps..

Post by archer »

RotationalBundle works in a continuous manner, so it can't be reliably used for discrete steps.

Maybe a trick with animations? When player input advances the animation by one frame, and each successive frame contains the the object rotated by 10 degrees? I'm not sure if that's possible since my experience with animations is limited.

Or maybe use the health bar as a frame counter? Export a few meshes of the object, each one rotated by 10 degrees more than the previous one. Attach them as geometries to simpleobjects, and then add them to your main object via AddArmorEffect. So that with 100% hp, the non-rotated mesh is used, at say 95% it shows the mesh which is rotated 10 degrees to the left, then at 90% 20 degrees and so on. Finally make two FireArms and attach them to mouse buttons. One would repair the object by precise amount, the other one would damage the object by the same amount.
This of course stops working properly the moment your object takes damage from external factors, i.e. other players.
dzn.battlefield.pl - my Bf1942 modding website
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: rotation angle snaps..

Post by fo0k »

I like it, archer..

hmm..

so I'm looking at making a kind of combination lock.. the easiest way to control this was going to be a pco where when the player enters they will see the first reel. then can change seats to adjust each wheel. once in the seat they will basically be able to rotate each reel (which will have some numbers on) There will be small health modifiers added as templates to specific numbers on each reel. when correctly aligned they can then trigger something.. a spawner.. whatever..

but, rather than sit in the object to control the reels I guess they could just be shot at etc.. not thought about attaching the health modifiers to an animation though.
Attachments
reels.jpg
reels.jpg (49.82 KiB) Viewed 8161 times
User avatar
archer
Posts: 54
Joined: Fri Feb 05, 2010 4:40 pm
Location: Übertów
Contact:

Re: rotation angle snaps..

Post by archer »

It's possible to do that by abusing SupplyDepots.

You build a main "lock" pco object with 1000 hp and with a SupplyDepot that heals it by 5000 hp per second. Then, each combination dial is a separate PCO that can be damaged by gunfire and rotates the dial depending on the hp (using armor effects as described in my previous post.) Within a very specific range of HP, each dial, besides showing a proper digit, would also spawn (also as Armor Effect) a SupplyDepot that damages the main lock by 1000 hp per second.
So, if you get 5 digits correctly, the lock stops repairing itself. if you get the 6th digit correctly, then the lock will take 1000 hp of damage and therefore will die in a second, thus either open the safe or trigger a spawner or whatever.
The most tedious part is adjusting the damage system, so that when hit by any projectile, the dial rotates exactly by 1 digit.
Dials would also need another SupplyDepot that shows up when they are about to die and repairs them to 100% hp (so that they'd show the first digit again.)
It'll work nicely for as long as you use big hp ranges (in thousands) so that an improperly placed expack wouldn't destroy your mechanism.
dzn.battlefield.pl - my Bf1942 modding website
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: rotation angle snaps..

Post by fo0k »

thanks.. have already mastered these damage effect style triggers on a few objects. they are a great way to trigger events!

the only issue with shooting things is when people might try to guess the code.. making the same reel go round and round.. would require a huge/infinite amount of damage variables to avoid running out of health.

perhaps just very slow rotation controlled in each seat would give a more subtle approach that shooting stuff and avoids the need for many damage effects.. would just need one for when the correct code is entered.
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: rotation angle snaps..

Post by Swaffy »

What on earth ...

You guys are way too complicated for me. Making me feel like a toddler when it comes to modding, heheh.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Post Reply