A cool script idea, help?

Rakaesa

Member
Reaction score
5
Okay, as i'm sure, some of you have played twilight's eve. It's an ORPG on wc3 b.net. Anyways, as you know, the newer versions have included a few proffessions. One of these professions interests me the most: Fishing. Not because of the fishing itself, but how it's done. It asks you to press certain arrow keys, and if you press it imediately after the message shows up, you get "Perfect". The slower you are, the worse of a mark you get.

Now, what I want to use this for is my idea i've come up with. I want to make a map in the modern times sort of like an orpg with a storyline. Where this system of arrow keys would come in is hacking. Yes, hacking.

Along the journey of this map you would encounter many computers. Some you would have to hack to progress in a mission, such as to unlock a locked electronic door, or hack into a database. I contemplated it and the first system was merely you somehow magically being able to hack in without any effort in the least, and it just gave you a list of commands you could use inside of the computer. Such as checking system messages, or checking the database for imortant information. But like I said, this required 0% effort. You just walked up to the computer, said "yes" when it asked you if you wanted to hack, and voila.

So I want to incorporate this arrow key system into the computer hacking. Kind of like a mass effect decryption thing. You have to press the buttons almost immediately, or you're kicked out of the system. Not permanently, obviously, I want them to be able to retry as many times as it takes.

So I want to know how to make this arrow system, and with only one grade. No perfect and good, but you just know you did good if it lets you advance to the next button at all. Otherwise I want them to be kicked out. So in total, the arrow system, with only one chance and it has to be pressed ALMOST imediately after it tells you what arrow to press, otherwise you're kicked out of the system and have to retry. And I want the order of the arrows to be completely random for every try on any terminal, so they never know what's coming.

Not sure if it's possible, but if it's only possible in vJASS, please give me a demo map or something I can easily copy paste, because I'm only good in GUI. I'm not completely sure how i'll add in the computer's commands and database and stuff afterwards, as I don't know how you would have the trigger sense if they get into the system or not, so let me know that too please :)
 

Risen

New Member
Reaction score
4
Arrow key detection is really slow for some reason, even with a delay reducer < 50.

If you do decide to do this, it would probably be a good idea to adjust the timer length (interval a player gets to press the arrow key) to delay (in seconds) + Interval.

TL;DR:
JASS:

local real r = INTERVAL + DELAY
 

evilwolf

Member
Reaction score
11
Actually it might be better to not use a arrow key system
Abilities are a better choice
You can make dummy abilities, change everything to zero and the hotkeys to W, A , S, D
W=Forward
A=Backward
S=Left
D=Right
Now the actual trigger. its pretty basic
Code:
kl
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Ability being cast) Equal to W 
                (Ability being cast) Equal to A 
                (Ability being cast) Equal to S 
                (Ability being cast) Equal to D 
    Actions
        Set KeyCount[(Player number of (Owner of (Triggering unit)))] = (KeyCount[(Player number of (Owner of (Triggering unit)))] + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                KeyCount[(Player number of (Owner of (Triggering unit)))] Greater than or equal to 4
            Then - Actions
                Game - Display to (All players) the text: You hacked the system!
            Else - Actions
        Wait 1.00 seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                KeyCount[(Player number of (Owner of (Triggering unit)))] Less than 4
            Then - Actions
                Game - Display to (All players) the text: You have failed!
            Else - Actions
Its MUI, tell me if it works...
I hope you know what it means...
 

Rakaesa

Member
Reaction score
5
That would work but there's a few problems, evilwolf.
1. The hacking is not based on an ability, but it's based on when the hero actually aproaches the computer or terminal.
2. I don't see anything that detects how fast the player has pushed the button? As I said, i'd like it to end up having to be almost immediately. Your system just checks if they've actually pressed the button.

So is there any way to improve this and make it the way I wanted? I don't mean to seem rude but the system has to be very precise in the way it's used.
 

Risen

New Member
Reaction score
4
That's what we're telling you, if you use arrow key detection (E.G: TriggerRegisterArrowKeyEvent) there's an unknown delay in the code itself, so it's impossible for a system like such to detect an immediate keypress.

The reason he suggested an ability is because it's faster than using arrow keys.
 

evilwolf

Member
Reaction score
11
That would work but there's a few problems, evilwolf.
1. The hacking is not based on an ability, but it's based on when the hero actually aproaches the computer or terminal.
2. I don't see anything that detects how fast the player has pushed the button? As I said, i'd like it to end up having to be almost immediately. Your system just checks if they've actually pressed the button.

So is there any way to improve this and make it the way I wanted? I don't mean to seem rude but the system has to be very precise in the way it's used.

Hmmm....
I don't think you're too good with triggers
The variable key count is the detection
Every time someone uses an ability it sets it to keycount +1
If keycount=4 after 1 second then you hacked the system, you decide what to do when that happens.
If keycount=3 or less after 1 second then you failed, you decide what to do when that happens.
You could add a condition to check if a Hero is in region when he/she is casts the ability.
*Note can I please see the trigger you've created? I could help you, I just want to see the trigger.
 

Risen

New Member
Reaction score
4
I'll provide you with my own arrow key system, which is currently used as an admin activator. I'll take the irrelevant code out, but you'll need to modify the actions trigger. You can use a part of the admin system, which supports using a simple string to determine the key sequence. For example..
JASS:
set AdminKeyPressString<i> = &quot;15263748&quot; // = press up, down, left right.
</i>


Do you want it?
 

Rakaesa

Member
Reaction score
5
Lol risen that looks like complete gibberish to me so I don't think i'll use it.

Evilwolf, I see what you mean, but you don't see what I mean xD. I don't want the keycount to be 4 over 1 second, then they'd have to randomly press WASD in 1 second. I want it to actually tell them WHICH button they have to press, and then they have to press said button in less than say 2 seconds. Then it gives them a second random button of WASD, doing the same thing. After maybe 5 buttons are sucessfully pressed they would get in. If they mess up a button, they get kicked out.
 

NeuroToxin

New Member
Reaction score
46
So use Evilwolf's method, just change it, its not that hard. Just make a boolean, if its true after 2 seconds, then set it to false and redo everything. Create an integer value to keep track too.
 

Rakaesa

Member
Reaction score
5
I suppose that could work, i'll give it a try when I get time. Thanks for the help guys, + rep to all of you.
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top