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:
| | |
| Code: function make(type) -- Define function make with one parameter called type b=mdkGetPlayerGob() -- Set b to bob (See note 1 below) g=mdkCreateObjectLua("",type,scene) -- Set g to new gob, with no name, but with specified type. QuatYDir(g.position,b.orientation) -- This does some manipulations with position of gob. (See note 2 below) VectorMul(g.position,6) -- This multiplies position of gob by 6, so gob will be 6 units away from bob, instead of one. VectorAdd(g.position,b.position) -- This adds bob's position to gob, moving it right in front of gob. end -- End of function
| |
| | |
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:
- Cool trick I discovered, that's not related to scripts/console.
- Keybinds
- Menu manipulation.
- ------stuff above this line was discovered like year ago, but I had technical problems with this forum, and couldn't post it before. I will post it durning this/next week------
- More gob manipulation.
- Demos.
- Some lua lessons (maybe).