keyhitxx script not working for me
11 replies



07.05.21 01:43:20 am
I have been trying for a while now, and although it seems mind-bogglingly simple I still cannot get this to work.
I am writing code in game.inf to make so different keys would trigger global events to make it easier to write multiplayer scripts because multiplayer scripts don't allow the msgbox command thus I need a new way of doing multiple actions. Also, using keys are simpler.
Even after all my years in modding stranded II, this simple problem has stumped me. I can't figure out why it doesn't work
also, i've tried doing it without "global" added, and it didn't work. (Adding "global" to the end didn't change anything, though.)
note: I misclicked and put this in Maps/Editor. If a moderator sees this, can you please put it in scripts?
I am writing code in game.inf to make so different keys would trigger global events to make it easier to write multiplayer scripts because multiplayer scripts don't allow the msgbox command thus I need a new way of doing multiple actions. Also, using keys are simpler.
Even after all my years in modding stranded II, this simple problem has stumped me. I can't figure out why it doesn't work
also, i've tried doing it without "global" added, and it didn't work. (Adding "global" to the end didn't change anything, though.)
note: I misclicked and put this in Maps/Editor. If a moderator sees this, can you please put it in scripts?
edited 1×, last 07.05.21 02:06:45 am
WARNING: Eating bricks can cause staining of teeth (specifically red staining) along with SEVERE tooth loss. Also, bricks will reduce the strength of windows if thrown directly at them, which may cause property damage.
you probably didn't assign the key to be a scripted key when hit. Add this to the top pf your game.inf file with the other assigned settings.
Code:
1
2
3
4
5
2
3
4
5
scriptkey = 16
scriptkey = 17
scriptkey = 18
etc.
scriptkey = 17
scriptkey = 18
etc.
The Survivalist_12-24-19 is now available. DOWNLOAD HERE
The Survivalist 12-24-19 | Performance-In options keep Water Detail off

It won't work with any ids over 20, which is fine if I just want to only use about five letters, but I need more than that.
Maybe someone knows how to get around this.
Anyone?
DC ?
JasJack67 ?
Maybe someone knows how to get around this.
Anyone?


edited 2×, last 18.05.21 07:55:36 pm
WARNING: Eating bricks can cause staining of teeth (specifically red staining) along with SEVERE tooth loss. Also, bricks will reduce the strength of windows if thrown directly at them, which may cause property damage.
Sorry, this is indeed limited to 20 keys. See https://www.strandedonline.de/s2_definitions.php?#game - description available in German only though. There is no way around this. To change it you would have to change the source code of the game.
20 is a rather arbitrary limit that I used back then because I though that this must be enough and that supporting more keys would be too slow anyway. It probably wouldn't be an issue to increase that value.
20 is a rather arbitrary limit that I used back then because I though that this must be enough and that supporting more keys would be too slow anyway. It probably wouldn't be an issue to increase that value.
How do I raise the number? does it require editing the source code or can it be done by changing scripts?
WARNING: Eating bricks can cause staining of teeth (specifically red staining) along with SEVERE tooth loss. Also, bricks will reduce the strength of windows if thrown directly at them, which may cause property damage.

There is no way around this. To change it you would have to change the source code of the game.
Source code. Not possible via script.
hmm.. I have blitz3d. Where do I have to modify the source code?
WARNING: Eating bricks can cause staining of teeth (specifically red staining) along with SEVERE tooth loss. Also, bricks will reduce the strength of windows if thrown directly at them, which may cause property damage.
you may be over-looking something...or maybe you know this. After you add the "scriptkey = #" you can start the game and go to options/controls and SET THE KEY to what ever key you want.
You are not locked in to using the defaults of the 20 keys available...can change them in the game after you add them.
SourceCode Information: https://www.unrealsoftware.de/forum_posts.php?post=113764#jn
You are not locked in to using the defaults of the 20 keys available...can change them in the game after you add them.
SourceCode Information: https://www.unrealsoftware.de/forum_posts.php?post=113764#jn
The Survivalist_12-24-19 is now available. DOWNLOAD HERE
The Survivalist 12-24-19 | Performance-In options keep Water Detail off

So that was why it was only limited to 20... That helps. I'll check this out.
Edit: That is just for keys that are already being used. I want to use keys that aren't currently in use to avoid accidently doing two things at once. This is for the Battle Mod, by the way, so it's important.
Maybe I'll just skip that and scrap all my complex code for a simpler method, like holding down (using keydownxx) for rapidfire (one of the uses planned) and then using keyreleasexx to stop the shooting. Maybe right click for bomb and so on. The key combos could get pretty complex though, because I'm have script for dropping bombs, shooting bullets, shooting rockets (both types), and there may be even more functions in the future.
JasJack67 : Maybe you could help work on the battle mod. My newest project. If I can fix some of these problems I'm having I'll probably pause progress and Stranded II Enhanced and focus completely on the battle mod, which would finally be something completely original for me.
Edit: That is just for keys that are already being used. I want to use keys that aren't currently in use to avoid accidently doing two things at once. This is for the Battle Mod, by the way, so it's important.
Maybe I'll just skip that and scrap all my complex code for a simpler method, like holding down (using keydownxx) for rapidfire (one of the uses planned) and then using keyreleasexx to stop the shooting. Maybe right click for bomb and so on. The key combos could get pretty complex though, because I'm have script for dropping bombs, shooting bullets, shooting rockets (both types), and there may be even more functions in the future.

edited 2×, last 20.05.21 03:07:52 am
WARNING: Eating bricks can cause staining of teeth (specifically red staining) along with SEVERE tooth loss. Also, bricks will reduce the strength of windows if thrown directly at them, which may cause property damage.
You are mistaken...look carefully ingame in OPTIONS: There is Controls 1 and Controls 2.
Controls 2 is all the scripted keys you added in the game.inf. You CLICK ON THE KEY THERE AND CHANGE IT TO WHAT EVER KEY YOU WANT TO.
When you zip the game for others to download, the keys will be saved/set to what YOU set them to.
I have no time currently to work on my mod, or a new mod, thank you for the invite though. However, I will try to help you through any issues, as you move forward...as we do here in the forum.
Controls 2 is all the scripted keys you added in the game.inf. You CLICK ON THE KEY THERE AND CHANGE IT TO WHAT EVER KEY YOU WANT TO.
When you zip the game for others to download, the keys will be saved/set to what YOU set them to.
I have no time currently to work on my mod, or a new mod, thank you for the invite though. However, I will try to help you through any issues, as you move forward...as we do here in the forum.
The Survivalist_12-24-19 is now available. DOWNLOAD HERE
The Survivalist 12-24-19 | Performance-In options keep Water Detail off

Thanks. I'll see if I can make more progress on it.
It worked!
Here's some pictures of the results:
https://www.mediafire.com/view/e9uvd2kbidthlhh/screen_00019.bmp/file
https://www.mediafire.com/view/ahxaatp471ax9am/screen_00018.bmp/file
https://www.mediafire.com/view/b8knyp8u1y4syk0/Screenshot_%2528111%2529.png/file
https://www.mediafire.com/view/da1i5i39j201eh0/Screenshot_%2528110%2529.png/file
It worked!
Here's some pictures of the results:
https://www.mediafire.com/view/e9uvd2kbidthlhh/screen_00019.bmp/file
https://www.mediafire.com/view/ahxaatp471ax9am/screen_00018.bmp/file
https://www.mediafire.com/view/b8knyp8u1y4syk0/Screenshot_%2528111%2529.png/file
https://www.mediafire.com/view/da1i5i39j201eh0/Screenshot_%2528110%2529.png/file
edited 2×, last 20.05.21 11:21:26 pm
WARNING: Eating bricks can cause staining of teeth (specifically red staining) along with SEVERE tooth loss. Also, bricks will reduce the strength of windows if thrown directly at them, which may cause property damage.
very cool! Glad you got the keys figured out now. Cool images!
The Survivalist_12-24-19 is now available. DOWNLOAD HERE
The Survivalist 12-24-19 | Performance-In options keep Water Detail off




