Encoding/Decoding

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

Arabidnun
Forum Staff
Posts: 506
Joined: August 5th, 2007, 1:38 pm
Title: Gui Expert
Location: *Unknown*

Encoding/Decoding

Post by Arabidnun »

I am currently working on a EXP system that is kinda of like NOTD. Risker challenged me and I am going to try and do it lol. Currently, I am trying to figure out how to create a encoding system in jass, that I can use a simple Trigger like this one below.
Spoiler:
Events
Player - Player 1 (Red) types a chat message containing -save as An exact match
Conditions
Actions
-------- Those values need saving --------
Set Save[1] = 123(exp)
Set Save[2] = 456(Creep kills)
-------- The number of values we have --------
Set SaveCount = 2
-------- Turn values into code --------
Custom script: set udg_Code = SaveLoad_Encode()
-------- Show code to player --------
Quest - Display to (Player group((Triggering player))) the Secret message: Your code:
Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code
The only problem is, I don't know how to display the code to them or how to even make an encoding section. Any help would be appreciated, I will even throw out this idea if you have a better one.
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Encoding/Decoding

Post by initialD »

couldn't you just made it in GUI and then transfer it to JASS?
I don't think that's a challenge at all. Just extract the already existed codes from NOTD?
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Encoding/Decoding

Post by weirdone2 »

It's pretty simple to display you would just have to encode it first and then display w/e you got from the encode, and to encode it you pretty much just assign numbers differently from what they normally are aka you could put them in binary. -.- But that wouldn't be very nice, anyway something as simple as making it say i'm just going to use lowercase and numbers, 0=9 1=8 2=7 3=6 4=5 5=4 6=3 7=2 8=1 9=0 a=10 b=11 and so forth and then using a multiplation to encode them so that say 123 exp then it'd turn into something like 7f which broken down looks like this 36 place, 6=3 3*36=108 1's place, f=15 decoded number, 108+15=123.

Hope this helps a little.
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: Encoding/Decoding

Post by Ozzapoo »

Custom script: set udg_Code = SaveLoad_Encode()
Where did this come from?
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!