Home   Help Search Login Register  

Author Topic: lock picks  (Read 1961 times)

0 Members and 1 Guest are viewing this topic.

marcus3

  • Guest
lock picks
« on: 15 Mar 2005, 14:05:30 »
is there some script where you can walk up to a car then choose "pick lock"
then based on you skill you ether unlock or fail?

thanks


Grunt249

  • Guest
Re:lock picks
« Reply #1 on: 15 Mar 2005, 14:18:41 »
I don't think there is a script like this yet, but it sounds fairly easy to do. One question I can think will be asked is, how will the skill be based?

It could call for the script to have seperate areas for each skill level, and the higher the level, the more chance of success. For example, at "noob" level the chances are 1/10th...while at "expert" level the chances are 7/10th.

Each locked vehicle would have a trigger near it, and when someone gets within the trigger it calls a script to first detect the skill level, then go to the proper area in the script for that skill. Then, it will pretty much just pick a random number between 1 and 10, and say the person was "noob" level, if the random number chosen was 1 it would unlock, all other numbers and it's a fail.

The part I don't know yet is the script needed to constantly monitor each person to detect their skill level, and to upgrade it as needed. I'm still new to scripting, but maybe this is a start?

marcus3

  • Guest
Re:lock picks
« Reply #2 on: 15 Mar 2005, 14:26:53 »
or
in a int.sqs you can put
guylevelatlockpicking = 1
1 being noob and 10 being grandmaster
then when you walk up to a car a script starts something
where it checks your level then go's to a random number like
you walk up to car click "lockpick" script checks level
then if you level was at 3 lets say then it would do this
choose a random number between 3 and 10. if the number comes back as 10 it unlocked. but if it comes back as 6 then its not unlocked.
so the higher you level at lock picking the better chance at unlocking it.
and after you pick a few locks you will go up a level like this
manlevelatlockpick = manlevelatlockpicking +1
then...
........
.........
..........
............
............
how to do all that?
« Last Edit: 15 Mar 2005, 14:28:37 by marcus3 »

marcus3

  • Guest
Re:lock picks
« Reply #3 on: 15 Mar 2005, 15:30:52 »
here is something after you walk into a trigger you get a action "pick lock" this is the sqs

hint "picking"
~4
?(jasonlockpicklevel<3) :goto "level3lock"

#level3lock
carlock = random 5
?(carlock<4): lockedcar lock false: hint "unlocked"
?(carlock<5): hint "did not work"
?(carlock<3): hint "did not work"
?(carlock<2): hint "did not work"
?(carlock<1): hint "did not work"

its a start what you think?

marcus3

  • Guest
Re:lock picks
« Reply #4 on: 16 Mar 2005, 19:35:08 »
i dont know what to do next......help

marcus3

  • Guest
Re:lock picks
« Reply #5 on: 16 Mar 2005, 22:59:51 »
me thinks that nobody wants to help

Offline Pilot

  • Contributing Member
  • **
Re:lock picks
« Reply #6 on: 17 Mar 2005, 17:09:09 »
Try changing the .sqs to something like this:
Code: [Select]
hint "picking"
ManName playmove "medic"
~4
?(jasonlockpicklevel<3) :goto "level3lock"

#level3lock
carlock = random 5
?(carlock<1): goto "locked"
?(carlock<2): goto "locked"
?(carlock<3): goto "locked"
?(carlock<4): goto "unlocked"
?(carlock<5): goto "locked"

#locked
hint "Did not work"
exit

#unlocked
lockedcar lock false
hint "unlocked"
exit
Where ManName is the name of the lock picker.
« Last Edit: 17 Mar 2005, 17:10:34 by Student Pilot »

marcus3

  • Guest
Re:lock picks
« Reply #7 on: 17 Mar 2005, 19:09:07 »
ok me try

marcus3

  • Guest
Re:lock picks
« Reply #8 on: 17 Mar 2005, 21:06:51 »
thanks this works good!

Offline XCess

  • Former Staff
  • ****
Re:lock picks
« Reply #9 on: 18 Mar 2005, 17:10:52 »
Dude, this would be so easy it's stupid. Just a lot of numbers is all.

=====================================================
; XCess' LockPick Script v0.1b
; Developed at marcus3's request
; Note: This code is untested

; pik_action.sqs
; This script controls the action menu for XCS_LockPick.

; man with pick skills
XCS_Pik_man = _this select 0
; set picklock level to 0
XCS_Pik_lev = 0
; Var to stop action adding more than once
_Pik_act = 0


#loop
; Check to see if a lock is nearby
XCS_Pik_car = nearestObject [XCS_Pik_man, "car"]
?(XCS_Pik_man distance XCS_Pik_car) < 2.5 && locked XCS_Pik_car && (_Pik_act != 1): XCS_Pik_lok = XCS_Pik_man addaction ["Pick Lock","pik.sqs"]; _Pik_act = 1
?(XCS_Pik_man distance XCS_Pik_car) > 2.5 || !(locked XCS_Pik_car) : XCS_Pik_man removeAction XCS_Pik_lok; _Pik_act = 0

; End Script
? XCS_Pik_End : exit
~2

goto "loop"

=====================================================

; ; XCess' LockPick Script v0.1b
; Developed at marcus3's request
; Note: This code is untested

; pik.sqs
; This script deals with the lock picking

_chance = random 10 - XCS_Pik_lev

?(_chance <= 1): goto "unlok"
hint "pick failed"
exit

#unlok
XCS_Pik_car lock false
?(XCS_Pik_lev < 9) : XCS_Pik_lev = (XCS_Pik_lev + 0.5)
hint "car unlocked"
XCS_Pik_man removeAction XCS_Pik_lok
exit

=====================================================

Two scripts. Untested as I don't have flashpoint installed on this computer. Could probably be improved a hundred fold with some testing but it should work as is.

To end the script make the condition XCS_Pik_End true (XCS_Pik_End = true).

Skill will increase after every successful pick. Skill level can be set at any time with the XCS_Pik_lev global. 9 is maximum.

« Last Edit: 21 Mar 2005, 21:20:48 by XCess »

Offline XCess

  • Former Staff
  • ****
Re:lock picks
« Reply #10 on: 20 Mar 2005, 13:13:19 »
i hate it when topics die after i post :(

marcus3

  • Guest
Re:lock picks
« Reply #11 on: 21 Mar 2005, 12:26:59 »
why do you think they die?

Offline XCess

  • Former Staff
  • ****
Re:lock picks
« Reply #12 on: 21 Mar 2005, 17:25:14 »
Lol.. well it must be either everyone one the board hates me or because the threads are solved..
You tried the script? Any good?
« Last Edit: 21 Mar 2005, 17:27:04 by XCess »

Offline Blanco

  • Former Staff
  • ****
Re:lock picks
« Reply #13 on: 21 Mar 2005, 19:03:48 »
Code: [Select]
#loop
; Check to see if a lock is nearby
XCS_Pik_car = nearestObject [XCS_Pik_man, "car"]
[b]?(XCS_Pik_man distance XCS_Pik_car) < 2.5 && locked XCS_Pik_car : XCS_Pik_lok = XCS_Pik_man addaction ["Pick Lock","pik.sqs"][/b]
?(XCS_Pik_man distance XCS_Pik_car) > 2.5 || !(locked XCS_Pik_car) : XCS_Pik_man removeAction XCS_Pik_lok

; End Script
? XCS_Pik_End : exit
~2

goto "loop"

I think the loop will create a new action every 2 second when the XCS_Pik_man is within 2.5m and the car is locked...
No?

Search or search or search before you ask.

Offline XCess

  • Former Staff
  • ****
Re:lock picks
« Reply #14 on: 21 Mar 2005, 21:17:11 »
So it would Blanco.. forgot to add a check for that, as iI said it was untested.. I'll edit the code to solve the bug in the post above. Thanks for spotting it ;D

Done.. I think, minds a bit groggy today after a not so nice wake up call.
« Last Edit: 21 Mar 2005, 21:26:52 by XCess »

marcus3

  • Guest
Re:lock picks
« Reply #15 on: 22 Mar 2005, 00:26:32 »
i am trying right now

marcus3

  • Guest
Re:lock picks
« Reply #16 on: 22 Mar 2005, 00:33:58 »
the code dont work but thats ok man dont worry about it
:)

Offline XCess

  • Former Staff
  • ****
Re:lock picks
« Reply #17 on: 22 Mar 2005, 02:39:52 »
Still no idea why most of my posts are ignored  ::)
I think I'll put together a working version of the script at some point, I've written that code without even opening the game so it was bound to be a bit buggy.

marcus3

  • Guest
Re:lock picks
« Reply #18 on: 22 Mar 2005, 18:29:01 »
well mmm good luck