Modify message

Subject:
Message icon:

Attach:
(Clear Attachment)
(more attachments)
Restrictions: 4 per post, maximum total size 1024KB, maximum individual size 1024KB
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
Type ot the full word: TUR**:
Finish the word: Turok 2: Seeds of ****:
Finish the word: Turok Dinosaur ******:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: DoomMarine23
« on: October 11, 2017, 11:38:19 AM »

Assuming you're still maintaining this guide, I'm gonna dig through some of the undocumented stuff and write up some notes that hopefully will be some use.

I'll submit some github pull requests as soon as I get something worth showing. This guide is way too useful, its only fair to give back. lol
Posted by: Jay Doomed
« on: September 25, 2017, 12:20:41 PM »

Good work Smoke nice to see more helpful info keep it up.
Posted by: BehemothProgrammer
« on: September 25, 2017, 02:44:19 AM »

Oh wow that sucks. I'm going to have to see if it's the same in T2 since it's pretty much the same.
Posted by: Smoke39
« on: September 25, 2017, 01:28:09 AM »

Wasted a bunch of time today trying to figure out what was wrong with my math, only to eventually figure out that the "kVec3 *= kQuat" operator is broken, so I added a big ol' warning to the kQuat page.
Posted by: Smoke39
« on: September 24, 2017, 02:46:01 AM »

Added some info on player lock as it pertains to cutscenes and weapon state.
Posted by: Smoke39
« on: September 11, 2017, 07:21:05 PM »

Added info on actor initialization to ScriptObject, and info on the persistent bit (mostly in ScriptObject, plus some functions in kActor).
Posted by: Smoke39
« on: June 23, 2017, 07:24:18 PM »

Finally added an explanation of native classes (kex-prefixed), and how they work with internal script classes (k-prefixed) and user scripts (the stuff we can change): https://smoke39.github.io/turok/scripts.html#ControlStructure.  It can be kinda confusing, so I hope I was able to make things a little clearer, rather than even more confusing.

Sometime I'd like to put together a proper reference on actor defs, with info on all the native classes.  Currently you can kinda get a feel for what's delegated to the scripts by looking at the callbacks in ScriptObject, ScriptObjectPlayer, and ScriptObjectWeapon, but I think it'll help people develop an intuition seeing examples of the other side of that -- what's handled natively.
Posted by: raul
« on: May 17, 2017, 11:13:46 PM »

Thank you so much Smoke39, this guide is pretty handy!
Posted by: Gazer
« on: February 14, 2017, 04:23:33 PM »

I figured out the problem, 2 bad models - out of 16 total that I added. Sheesh I'm relieved it's not a bad fix. I say mapping for this thing is a real chore. I guess I'm spoiled from using Radiant in the past. There was a lot of people working on the same thing who generated a lot of solutions to problems. It's astonishing the scripting work you've done Smoke.

Thanks - Gazer
Posted by: Smoke39
« on: February 14, 2017, 01:57:31 PM »

Smoke do you have anything on the hexadecimal codes?

No.  I think that stuff's probably not of any use without a debugger and the game's source.
Posted by: Gazer
« on: February 14, 2017, 01:33:26 PM »

My best guess at this point is the models that I copied and retextured. I'm cognizant of the case sensitivity and I checked everything in that respect. So in testing my models now in controlled conditions I'm getting 'memory could not be read' crash log return. (with developer '0')

Eh - the little done, the vast undone. Gazer

EDIT: Smoke do you have anything on the hexadecimal codes?
Posted by: Smoke39
« on: February 14, 2017, 01:27:50 AM »

My first guess would be inconsistent capitalization somewhere.  As I highlight here, unpackaged file names are not case-sensitive, but files packaged in a kpf are case-sensitive.  E.g., having a file named "Banana.map" referred to as "banana.map" in mapInfo.txt will cause problems.
Posted by: Gazer
« on: February 14, 2017, 01:14:44 AM »

Hey Smoke, Howzit?

Hey I posted my level without custom scripting (besides adding my mapid to the mapInfo.txt), but my level doesn't run without the developer "1" flag. Have you run across any information on what would cause that? I do have models in the game that are hakked and retextured, and then re-deposited into the game. That would be the only thing that could cause a conflict with original files. I haven't noticed any conflict though and no error messages besides game crashes at startup when developer set to "0".

Sobek.exe caused and exception - yata yata - hexadecimal code - hexa - hexa

Thanks - Gazer
Posted by: Gazer
« on: February 10, 2017, 06:39:43 PM »

I've noticed your work Smoke! you Rock! I can't do what you do ... ha ha no way no how. My mind gets all kerplunktuated (void) Kstr #sizzledik -% 420 Lsd @boozer

Thanks - Gazer

I just looked at your examples - I am shocked. You did a lot of work Smoke. If I dig into this I will never finish a single map. I generally have to check each character that I type 3 times for syntax. And I flip letters and numbers sometimes, when I tpye. lol (this php has autocorrect damn i7 chip)
So I'm dumbfounded. Gazer
Posted by: Smoke39
« on: February 10, 2017, 02:43:23 PM »

Near the top of main.txt, after all the #includes, you'll see:

funcdef void VARFUNC(const kStr &in, const kStr &in);

This is defining a function type, named "VARFUNC," which takes two strings as parameters, and has no return type.  This allows us to pass functions of this type as a parameter to other functions.  In this case, Add() and SetValue(), in VarFunctor.  Add() is used to add new variables to GameVariables, and SetValue() is used to change the value of variables already in GameVariables.


In main(), you'll see:

SetStateVars(VARFUNC(functor.Add));

This is calling SetStateVars(), passing the Add() function as a parameter.  This is called once when the game is run, and it registers all the persistent, per-save variables.


In newgame(), you'll see:

SetStateVars(VARFUNC(functor.SetValue));

This is also calling SetStateVars(), but this time passing the SetValue() function as a parameters.  This is called every time the player starts a new game, and it resets all the persistent game variables to their default values.


The purpose of all this function passing malarky is that we can specify all the persistent game variables ONCE in SetStateVars(), rather than having to have two copies for adding and setting.

THE BOTTOM LINE is, to add your own persistent, per-save variables, just add them to either SetStateVars(), or InitCustomStateVars() (or even in a new function, and call it from SetStateVars(), however you wanna organize it).  Just use:

setFunc( "var name", "initial value" );

and it'll ADD or UPDATE your new variables, whichever is appropriate.

You can see examples of this in Turok+, where I've added a bunch of my own variables at the end of InitCustomStateVars().
SimplePortal 2.3.6 © 2008-2014, SimplePortal