Home   Help Search Login Register  

Author Topic: Codepad 1.0  (Read 14400 times)

0 Members and 2 Guests are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
Codepad 1.0
« on: 30 Aug 2004, 20:14:25 »
Codepad1.0Beta by Blanco

Wohoo, here is my first dialog.




Codepad1.0 demomission (editorupgrade required) *Link removed* See lower for 1.1

Used programs.

- Dialogmaker (great tool!)
- Soundforge 5.0
- Photoshop 7.0 & illustrator 10
- Textview
- Chris OFP script editor

Features

- Dialog with a numeric pad. - paper with code
- Display and 2 leds (red & green).
- Custom sounds

For the demo mission (not really a part of the codepad script)

- Scripted gates with custom sounds


Parameters :

- name of the object that represents the codepad (could be a laptop, a vehicle... whatever)
- The code between quotes. Use "-1" when you want a random code at the start of your mission.


Example :

You already know the code from the beginning via the briefing or whatever :

[laptop,"123456"] exec "pad\numpad.sqs"


You have to find the code, a random code is generated from the beginning.

[button,"-1"] exec "pad\numpad.sqs"


Codekeeper

You can give the code to the enemy with the randomassign script.
When this script is running on an enemygroup, somebody randomly carries the code with him.
When you kill him and search his body the code will be yours.
You will see the code on a little piece of paper when you have to enter the code.
The guy with the code is named codekeeper in the script, so you don't have to name him manually.


You need one trigger for the "search his body" action


Code: [Select]
ACTIVATION : none, repeatedly

CONDITION : !codefound && alive player && !alive codekeeper && player distance codekeeper < 1.5

ONACTIVATION : Codeaction = codekeeper addaction ["Search his body","pad\code.sqs"]

ONDEACTIVATION : codekeeper removeaction Codeaction


Run the script on an enemygroup like this

[name of the group] exec "pad\randomassign.sqs"

example :

[enemygrp1] exec "pad\randomassign.sqs"



Codefound = true

When somebody told you the code during the mission via an informant or whatever, use the bolean

Codefound = true

in a trigger or script.

The code (the paper) will be shown aswell when you try to enter the code.

MAXnr
 
A code can only have numbers (0 to 9) and two special characters * and #
A code has 6 digits default, but you can make the code longer if you want.

Just open the codepad.init.sqs in the pad directory and change the MAXNR variable into an other value. 12 digits is the maximum!



Applications :

The codepad can be used in lots of scenario's (stealth missions I guess), just use your imagination...

A code to open a door.
A code for you car
A code to launch a scud
Disarm a bomb...
...
So this script is a bit a do-it-yourself script.

Doors

In the demomission you need a code to open the gates of a garagebox and steal an ammotruck. (very easy)
The doors are nothing more than 2 fences that slide in a certain direction via scripting (setpossing)
(*) I've used code from another script that's not mine
No author was mentioned in the script,  thanks to the guy/girl

The parameters for that script are :

[Name of the object that represent the codepad, name of the leftdoor, name of the rightdoor,direction the leftdoor should slide, direction the rightdoor should slide, slidedistance in Meters] exec "doors\open.sqs"  

Example :

Your doors are facing north : (azimuth 0)

[button,GateL,GateR,275,85,2.3] exec "doors\open.sqs"

The left door should slide to the WEST, so azimuth is 275
The right door should slide to the EAST, azimuth is 85

The slide over 2.3 meter, that depends on the fence you are using in the editor

Use the "doors\open.sqs"

to open the gates, and...

"doors\close.sqs"

to close them again.

btw : This script is activated at the end of the codepadcrack script in the pad directory.  

Should work in MP, but not recommended,, because this script uses a very fast loop when the gates open and close.

Bugs :

- You can use your numeric keypad on your keyboard to enter the code, but the script won't react then, you have to use the dialog buttons!
- There can only be one codepad and code per mission.
- When the codekeeper enters a vehicle and you shot him, the "search his body" action won't show up for some reason.
- Not tested in MP
 
Last minutes notes :

- Some code from the ECLsafe addon was used.
- The zip includes a Dutch readme, check this post for the euh... English instructions. I will update the file later with an English readme.
- In the demomission the randomassign script is running on every member in the enemygroup, One unit in the group is enough tho..
I made a mistake there... I can't update the file now, I have to contact my host first.

That's all folks.







« Last Edit: 20 Jan 2005, 01:05:38 by Blanco »
Search or search or search before you ask.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Codepad 1.0
« Reply #1 on: 31 Aug 2004, 00:24:03 »
Wow, sounds great! I'll try this out soon. One thing though:

Quote
- You can use your numeric keypad on your keyboard to enter the code, but the script won't react then, you have to use the dialog buttons!
Why not? You should be able to save the text that is in the display over the numbers, and then compare that string to the correct codestring.

Anyway, gotta try it out now!
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Blanco

  • Former Staff
  • ****
Re:Codepad 1.0
« Reply #2 on: 31 Aug 2004, 17:29:41 »
Quote
Why not? You should be able to save the text that is in the display over the numbers, and then compare that string to the correct codestring.

Because every button in the dialog updates a variable KeYpad_num
Check the description.ext ,lets take the button ,digit 7

Code: [Select]
"Keypad_num = Keypad_num +1;num=format [{%1%2},(ctrlText 999),7];ctrlSetText [999,num];playsound ""button"""

Everytime you press that button Keypad_num will be updated.

Code: [Select]
Keypad_num = Keypad_num +1

Show the number 7 in the display (id 999) when you press button 7

Code: [Select]
num=format [{%1%2},(ctrlText 999),7];ctrlSetText [999,num]

...then in the numpadcrack script I check the how many times you press a button and compare the code you enter with the actual code.

Code: [Select]
_ok = createDialog "Dialog1"


;; Hide the paper with code, id 599 is the picture with the paper
ctrlShow [599, false];
;; Hide the green led, id 598 is the picture of the green led
ctrlshow [598, false]
;; Hide the red led,id 597 is the picture of the red led
ctrlshow [597, false]

;; Numarray contains the name of the button and the code (check numpad.sqs)
_password = Numarray select 1

;; When codefound = true, show the paper and code (id 600 is the text with code)
?(codefound) : ctrlShow [599, true]; ctrlSetText [600, format["%1",_password]]


;;;blablabla
ctrlSetText [999,"Welcome..."]
~1
ctrlSetText [999,"Enter your code"]
~1
ctrlSetText [999,""]

#start
;; Hide the two leds again in case you enter the code more then once
ctrlshow [598, false]
ctrlshow [597, false]

;; Reset Keypad_num value
Keypad_Num = 0

Wait until Keypad_num is equal to the MAXNR (check numpad_init.sqs)
@(Keypad_Num == MAXNR)
Keypad_Num = 0

; compare the code you entered with the real code, if code is right jump to the "open" label which opens the gate...
? ctrlText 999 == _password : goto "open"
;; if code is wrong, some blablabla :-)
ctrlSetText [999,"ACCESS DENIED"]
;; euuuuuuuuuuuuu!
playsound "wrongcode"

;; Show the red led
ctrlshow [597, TRUE]
~2
Clear the display
ctrlSetText [999,""]
goto "start"

#open
;; Show the green led
ctrlshow [598, TRUE]
;; pidipidibip!
playsound "codefound"
;; more blablabla...
ctrlSetText [999,"ACCESS GRANTED"]
~0.5
Remove the action "enter your code"
(_this select 0) removeaction (_this select 2)
~2
; close the dialog
closeDialog 0

So, thats the reason... I need to find a way to update the Keypad_num by counting the total number of digits in the display.
It's probably possible, but I'm still in my babysteps of dialogmaking, anyways...I'm pretty proud with my first dialog  :P

The position of the colored leds was pretty boring to do, but it was worth the effort (position is still not perfect, just a few millimeters to high)







« Last Edit: 31 Aug 2004, 17:33:10 by Blanco »
Search or search or search before you ask.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Codepad 1.0
« Reply #3 on: 31 Aug 2004, 17:31:56 »
actually da everon cartel already done somin like dat ;) ;D i scripted it ;D  :P

jsut download da EC safe from www.everoncartel.com

even tho ur dialog do look beter ;D :thumbsup:

LCD OUT

[edit] ohh u said dat.... wasnt dere some disclamair u shud request b4 usin shit we did ? ::) :P.... um nywayz right now u have temporary taam till i think bout dat :P
« Last Edit: 31 Aug 2004, 17:33:02 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Blanco

  • Former Staff
  • ****
Re:Codepad 1.0
« Reply #4 on: 31 Aug 2004, 17:57:45 »
 :-\ Yeah, I've used some code of the ECLSafe and didn't asked your permission...(I didn't read disclamer, my fault)

I apoligise for that, I only wanted to make a codepad in a dialog without having any addons.

But I understand... if you don't take my apoligies, i'll delete this post and link.

 



Search or search or search before you ask.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Codepad 1.0
« Reply #5 on: 31 Aug 2004, 18:02:46 »
nah

continue..... im 1 of em sharware ppl ;) ;D nd i want u 2 do dat... jsut dont forget 2 ask for premision next taam :P n put our name in bigger letters ;D ;)

mebe well request noder ting (gotta talk w/ ma team members) but no way well b tellin u 2 delete ur work or not release it, dont wry ;D

in wayz keep it up nd do oder great scripts :thumbsup:

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline MMFF

  • Members
  • *
  • Mission Maker From Finland
Re:Codepad 1.0
« Reply #6 on: 11 Jan 2005, 12:54:34 »
I canÂ't get it it says that the site is forbidden :'(
Do I need to play Operation Flashpoint to be here?

EX-PARA

  • Guest
Re:Codepad 1.0
« Reply #7 on: 12 Jan 2005, 00:06:34 »
Check your PM

BronzeEagle

  • Guest
Re:Codepad 1.0
« Reply #8 on: 12 Jan 2005, 10:57:48 »
What if I want the codekeeper to be one particular man and not a random man?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Codepad 1.0
« Reply #9 on: 12 Jan 2005, 22:03:37 »
i can't get to the script but it looks like you could just give it the name of the unit as the argument instead of the group, but as an array:

Code: [Select]
[[unit1]] exec "pad/randomassign.sqs"

all a group is is an array of each unit in that group

BronzeEagle

  • Guest
Re:Codepad 1.0
« Reply #10 on: 13 Jan 2005, 14:11:08 »
Yeah cuz that'd be awesome if your target was just one man, hard to get access to cuz he has lots of bodyguards and he's well protected and stuff.  Then you'd have to like, get the password off him.  Like Bill Gates.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Codepad 1.0
« Reply #11 on: 14 Jan 2005, 00:24:06 »
hey blanco, could you either post the part of your script having to do with the selection of the random unit or fill us in so we can clear this up for BronzeEagle

BronzeEagle

  • Guest
Re:Codepad 1.0
« Reply #12 on: 14 Jan 2005, 02:02:44 »
That'd be bad if the single man who knows the code is kidnapped, but you have to find him to save the world.  Can you make a scud demo mission using the keypad to where if you don't get the code entered in time the scud will launch for us?

Offline Blanco

  • Former Staff
  • ****
Re:Codepad 1.0
« Reply #13 on: 14 Jan 2005, 02:46:45 »
Well, guys

I had a huge HD crash and I've lost a lot of stuff (this script for example) caused by orphan files...  and I left the OFP community...

forever?
until OFP2 arrives?
for a while?  

I really don't know... time will tell.

But I still check fansites and forums once a while.

Quote
What if I want the codekeeper to be one particular man and not a random man?

AFAIK, don't run the randomassign script, name your guy codekeeper and place the trigger for the "search his body" action





« Last Edit: 14 Jan 2005, 03:05:35 by Blanco »
Search or search or search before you ask.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Codepad 1.0
« Reply #14 on: 14 Jan 2005, 04:37:20 »
Quote
...  and I left the OFP community...

MEDIC!! I think we've lost him! NOOOOOOOOO!!!


that sucks about your comp crash, hope you make it back in one piece