English keyhitxx script not working for me

11 replies
Goto Page
To the start Previous 1 Next To the start
Up
ModJuicer
Super User
Offline Off
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.)

My code that doesn't work in game.inf >



my debugging code >



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
file stranded2 Stranded II Enhanced (3) ---0o~~"Juicing Stranded II Mods Since 1999.99"~~o0--- thread stranded2 Stranded II Enhanced New Update --------------------- > Join Stranded II Enhanced Battle Mod on Discord HERE
07.05.21 03:47:36 pm
Up
JasJack67
Super User
Offline Off
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
scriptkey = 16
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
10.05.21 10:18:15 pm
Up
ModJuicer
Super User
Offline 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? user DC ? user JasJack67 ?
edited 2×, last 18.05.21 07:55:36 pm
file stranded2 Stranded II Enhanced (3) ---0o~~"Juicing Stranded II Mods Since 1999.99"~~o0--- thread stranded2 Stranded II Enhanced New Update --------------------- > Join Stranded II Enhanced Battle Mod on Discord HERE
18.05.21 08:55:25 pm
Up
DC
Admin
Offline Off
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.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
18.05.21 10:43:05 pm
Up
ModJuicer
Super User
Offline Off
How do I raise the number? does it require editing the source code or can it be done by changing scripts?
file stranded2 Stranded II Enhanced (3) ---0o~~"Juicing Stranded II Mods Since 1999.99"~~o0--- thread stranded2 Stranded II Enhanced New Update --------------------- > Join Stranded II Enhanced Battle Mod on Discord HERE
18.05.21 11:17:38 pm
Up
DC
Admin
Offline Off
user DC has written:
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.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
18.05.21 11:36:15 pm
Up
ModJuicer
Super User
Offline Off
hmm.. I have blitz3d. Where do I have to modify the source code?
file stranded2 Stranded II Enhanced (3) ---0o~~"Juicing Stranded II Mods Since 1999.99"~~o0--- thread stranded2 Stranded II Enhanced New Update --------------------- > Join Stranded II Enhanced Battle Mod on Discord HERE
19.05.21 12:55:18 am
Up
JasJack67
Super User
Offline Off
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
The Survivalist_12-24-19 is now available. DOWNLOAD HERE >The Survivalist 12-24-19 | Performance-In options keep Water Detail off
19.05.21 06:31:06 pm
Up
ModJuicer
Super User
Offline 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.

Code that needs this >


user 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.
edited 2×, last 20.05.21 03:07:52 am
file stranded2 Stranded II Enhanced (3) ---0o~~"Juicing Stranded II Mods Since 1999.99"~~o0--- thread stranded2 Stranded II Enhanced New Update --------------------- > Join Stranded II Enhanced Battle Mod on Discord HERE
20.05.21 07:08:12 am
Up
JasJack67
Super User
Offline Off
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.
The Survivalist_12-24-19 is now available. DOWNLOAD HERE >The Survivalist 12-24-19 | Performance-In options keep Water Detail off
23.05.21 09:42:07 am
Up
JasJack67
Super User
Offline Off
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
To the start Previous 1 Next To the start