Hectic HQ! http://hectichq.com/forum/ |
|
Topic about derping around with MDK2's scripts/console. http://hectichq.com/forum/viewtopic.php?f=7&t=57 |
Page 1 of 1 |
Author: | Egor305 [ 29 May 2014, 12:55 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Post subject: | Topic about derping around with MDK2's scripts/console. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I found some really intresting stuff in game scripts, like this thing: I will post cool things that I find. --- Related Links: Gob/Object/Item IDs are found *here* --- First one going to be slow-mo command thing: If you don't know how to open console - You just press ~ to open console, and ESC to close it. Also remember, all things are case-sensitive. Now type one of those:
Here's video with me using 1/60 and 1/2: *click*. (Note: I bound those commands to keys. This is not easiest thing to do, so I will post how to do it later.) Seems like 0.2 (1/5) and higher breaks parachute mechanics. --- Because this is first time I'm posting those, here's a bonus:
--- Let's spawn some doc stuff in!
Thing you didn't knew: Toaster + Baguette = Toast. Note: Your game will crash, if you use Plutonium without having Hyde created. This is done automatically on levels 6, 9 and 12 (a.k.a. 10 with Doctor), but for other levels you will need to type this:
Now, this is science! --- Before we move on, there's similar commands to previous one:
I don't think I have to explain it. Also there's two more for doctor:
--- Now it's time to kinda explain gobs and bobs. Basicaly, gob is any object in-game that's not static. Each gob type have an ID. Bob is gob that's controled by player. This is code that creates function for spawning gobs in front of bob.
Note: You can type it all in one line. Let's go through it really quick:
Note 1: due to nature of lua (especially the version they used in MDK2) you never need to update b, because lua transfers pointers and not values. What that means: if you have x=5, and you do y=x, then do x=x+1, in the end y==6. That doesn't seem to work everywhere, but it works with gobs. It's really hard to explain if you don't know programming, but I guess I could do it: In lua things stored using pointers, i.e. variables are storing pointers instead of values. Pointer is basicaly memory address to value, so when I have y=x they point at same address, because = operator transfers address instead of value. Note 2: After this operation, gob will be in 1 unit away from 0,0,0 in direction you're looking at. Now you can use it using make(OBJ_something) --- Time for difficulty info! Difficulty is floating point value. That means it's can be any number:
Side note: In MDK 2 HD those didn't changed. They tweaked difficulty some other way. I recommend you try anything from 2 to 10 and also try 100, -1 and 0. Now on how to add new items to New Game menu. (Side note: Menu manipulation is huge! More on this later.)
--- Now onto auto save info: Here's auto.sav
(Level 1 - Easy) You can see 0x8 and 0xC are 1 and 9, which is starting level/room combination for first level. Last four bytes are difficulty, but if we convert it, we will not get 0.2. Conclusion: Things are little endian, and 0xCD 0xCC 0x4C 0x3E are actually meaning 0x3E4CCCCD, which is 0.2. Oh, I think I forgot to say that floating point numbers are stored in IEEE 754. Full file format can be written as:
I will make my own program for generating those. --- I'm actually runing out of material. I'm making new one slower than I post old one.
--- Time to do put some information about gob manipulation:
Note that bob is equal to last player gob created with CreateSomething() command Also note that if you do x=bob.position.x, x will not auto update, but if you do pos=bob.position, bob.x will auto update. This is because lua pointers are weird. There's really alot of stuff you can do with those... --- Comming Soon:
|
Author: | Mnich [ 29 May 2014, 21:38 ] |
Post subject: | Re: Topic about derping around with MDK2's scripts/console. |
Hi Egor! It's nice to see you here after your problems with registration. I hope everything is good now. You've found very interesting things, I must say. Can't wait for more info I've found something similar some time ago. This is a command for spawning enemies. We can spawn almost every enemy (it works only on the second level [first room]) : mdkCreateObjectLua("grunt", OBJ_GRUNT, mdkGetScene()) And here is the example of script for spawning weapons at certain points : SpawnObject(l2_r1, OBJ_UZI,"l2_r1magnum1"). l2 - level 2 r1 - room 1 obj_uzi - weapon to spawn, in this case - uzi l2_r1magnum1 - this is a point where our weapon will be spawned KurtGetNaked() - this will allow us to play as Kurt in boxer shorts. There is also a command for changing / creating player's model : CreateKurt() CreateMax() CreateDoc() CreateHyde() But unfortunately we can't move after this. |
Author: | Egor305 [ 30 May 2014, 11:16 ] | ||||||||||||||||||||||||||||||||||||
Post subject: | Re: Topic about derping around with MDK2's scripts/console. | ||||||||||||||||||||||||||||||||||||
Thanks!
Actually, there's way more parameters to this function, but for now, I will say that you can use scene instead of mdkGetScene(). Also mdkCreateObjectLua/SpawnObject are interchangeable functions (i.e. you can do SpawnObject(l2_r1,OBJ_GRUNT,"l2_r1magnum1"))
That's well known one. :/ One thing that I recently found, is that there are 6 unused keybinds: COM_CHEATEN1, COM_CHEATEN2, COM_CHEATA, COM_CHEATB, COM_CHEATX, COM_CHEATY (leftovers from dreamcast version) and if you bind all of them, you can actually activate this cheat. To do so, you hold CHEATEN1 and CHEATEN2, and they you press X,X,Y,X cheat buttons. This works only on title screen. There are more cheats, but most of them won't work unless you modify scripts (i.e. they are commented out)
Yeah, I know those. There is a way to move player around. -- I will edit my first post later this day, and will add info on spawning items with doctor. EDIT: edited first post. |
Author: | Mnich [ 31 May 2014, 07:54 ] |
Post subject: | Re: Topic about derping around with MDK2's scripts/console. |
I really need to install my MDK2 again. I always wanted to spawn an enemy or weapons. It's not like I want to cheat, but you know, after all these years .. it can be fun! |
Author: | Egor305 [ 01 Jun 2014, 09:42 ] |
Post subject: | Re: Topic about derping around with MDK2's scripts/console. |
Added info on mdkDocRemoveItem() and mdkDocRemoveHeldItem() EDIT: Also added mdkDocGetHeldItem() EDIT: Added auto-save/difficulty info. |
Author: | Mnich [ 03 Jun 2014, 13:09 ] | |||||||||||||||||||||||||||
Post subject: | Re: Topic about derping around with MDK2's scripts/console. | |||||||||||||||||||||||||||
Write something more about this. Besides,
This isn't slo-mo. It's quite fast actually. |
Author: | Egor305 [ 04 Jun 2014, 08:26 ] | |||||||||||||||||||||||||||||||||||||||||||||
Post subject: | Re: Topic about derping around with MDK2's scripts/console. | |||||||||||||||||||||||||||||||||||||||||||||
Still doing research on those, so probably going to post info about it tomorrow. (EDIT: I might post it little bit late than usual)
Well, people at Bioware called this slow-mo in their debug menu. You can use some thing like 0.009 or 0.005 for slower results. --- EDIT (6 june): Today I'm not posting anything, because I'm lazy |
Author: | Egor305 [ 08 Jun 2014, 18:21 ] | ||||||||||||||||||
Post subject: | Re: Topic about derping around with MDK2's scripts/console. | ||||||||||||||||||
Sorry for not posting this long. General lazyness hit me. Here some code for you:
Note 2 in last command. It's the actual keycode. (1 = escape, 2 = 1, 3 = 2, 4 = 3, etc) Also there's few button modes:
Also, COM_VV1 through COM_VV0 are unused keys for variable view. You could use any number instead of those, but you will need to make sure, it doesn't overlap with any constant. |
Author: | Egor305 [ 03 Oct 2014, 15:27 ] | ||||||||||||||||||
Post subject: | Re: Topic about derping around with MDK2's scripts/console. | ||||||||||||||||||
Woo, hi there. I'm back. Just wanted to show off my code golfing skills. I can make this:
into this:
23 chars diff, and no spaces! *such swag* Disclaimer: Tested it in lua 5.1. MDK2's lua might have more strict syntax. Syntax rules are inconsistent even between lua builds. For example: Windows build of 5.2 from LuaBinaries allows x=1337y=7331, but that only works if letter following number isn't any from a to f (hex digits). On other side, somebody told me that on their build of 5.2 there must be space between number and letter. |
Author: | p3rsh1ng [ 24 Jan 2016, 15:47 ] |
Post subject: | Re: Topic about derping around with MDK2's scripts/console. |
Is there a command to make the game play certain sound effects on demand? I thought I could use this method to extract sounds "the hard way". |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |