The forum has been set to read-only mode. For community discussion and questions, head over to our Discord: https://discord.taleoftwowastelands.com

New Mod Development: McEnhancements

General help and technical troubleshooting. Ask for help here if you can't find an answer in the FAQ.
Mystical Panda
Posts: 750
Joined: Wed Mar 30, 2016 2:02 pm

pintocat wrote:

Post by Mystical Panda » Sun Jun 12, 2016 6:20 pm

[quote=pintocat]


 


Closest I can think of is JIP's functions


http://geck.bethsoft.com/index.php?title=GetFallTimeElapsed


http://geck.bethsoft.com/index.php?title=GetFallTimeRemaining


http://geck.bethsoft.com/index.php?title=ResetFallTime


[/quote]


Thanks pintocat. I tried those yesterday and for some reason they return a value if I'm standing still then jumping straight up. They'll also return a value if I'm running while my Y axis is changing (like running downhill). But, they won't return a value if I run and jump off a cliff. It's like the game "stops" script processing while falling. I even tried the IsAnimPlaying with the same results, which oddly enough IsAnimPlaying JumpLand didn't work. This was using the 32.10 version of the functions, today I'll see if the 29.00 version returns different results. Just in case. I tried calculating velocity or speed using distance/time, but without a value being returned while truely falling, idk.


I'll be adding more to the MCM options, linking in-game functions to them, and converting the MCM over items over to submenu items. That'll make adding new items easier.



Anacostia Crossing
Posts: 60
Joined: Mon Mar 24, 2014 7:45 am

I can confirm you that

Post by Anacostia Crossing » Sun Jun 12, 2016 8:21 pm

I can confirm you that IsAnimPlaying returns wrong values for most animgroups, so I'd exclude that solution.

This is the second time in these days where an apparent simple problem reveals being harder than I could expect. The other one is "how can Chesko's Campfire orienting the objects on the ground? is there something to return some terrain feature in Papyrus, that helps with it, or he's doing some mystical math?" - I'm really struggling with this

Mystical Panda
Posts: 750
Joined: Wed Mar 30, 2016 2:02 pm

Anacostia Crossing wrote:

Post by Mystical Panda » Sun Jun 12, 2016 8:47 pm

[quote=Anacostia Crossing]


"how can Chesko's Campfire orienting the objects on the ground? is there something to return some terrain feature in Papyrus, that helps with it, or he's doing some mystical math?" - I'm really struggling with this


[/quote]


Maybe set the object, the campire (havok enabled), as initially disabled, then PlaceAtMe or using X,Y - 10,Z (if -Y is the correct direction) in relation to the player, then enabling it, so havok would place it on the ground? The problem with placing it too high, is, you would see if fall, and it might not land/settle correctly. Ive seen campfires "phase in", and I've noticed that similar to what I did with Arthur the Protectron when activating him the first time. Maybe he's doing the same with that.


It seems like we could check height data against the player's position + height (Y axis), give or take small variance (maybe an optional parameter passed to the function): return 1 if withing that variance, 0 if not. At least I could check manually in the script, since I'm not on the ground, I must be in the air. Or better would be:


(ref.DistanceToGround)


Then, even if it returned a small variance, that can be ignored, since I wouldn't care if I was falling, 1-2.



Mystical Panda
Posts: 750
Joined: Wed Mar 30, 2016 2:02 pm

Looking through the source

Post by Mystical Panda » Sun Jun 12, 2016 10:41 pm

Looking through the source for JIP NVSE as an example:


It looks like NVSE (the parent) defines pointers to the executable's (falloutNV.exe or the 4gb "copy") game data block which controls the flow of logic/conditionals in the game and is maintained by the game's engine. A child dll (which works through NVSE like JIP NVSE) then references that data block pointer, changing values within it or just checking it (referenced by an understanding of how that data is arranged).


- So, I would ask NVSE where is the data block for the game. NVSE would give me a memory pointer (reference) for that.


- I would need to know the layout of the data block to know where to look and what size/format the data I'm looking for is at.


Without that "data map" it would be difficult to know just what in that giant block of data is what or how the game actually uses it. I image part of that data block could be monitored in real time, then report back for analysis- to see how the engine actually uses it.


 



Mystical Panda
Posts: 750
Joined: Wed Mar 30, 2016 2:02 pm

When using "PlaceAtMe" does

Post by Mystical Panda » Mon Jun 13, 2016 4:55 am

When using "PlaceAtMe" does the new object being placed use it's own personal "copy" of the base object's script, or is the base object's script shared between all references of it?



User avatar
RoyBatty
Gary
Posts: 7742
Joined: Sun Apr 27, 2014 10:26 am
Location: Vault 108

It's shared for activators

Post by RoyBatty » Mon Jun 13, 2016 7:45 am

It's shared for activators and such, and unique I think for NPC/Creatures. Remember if you use placeatme you need to clean up after it in your script with disable and markfordelete on death after 3 days, the game doesn't clean these up automatically and you can break saves with it.


Image

Mystical Panda
Posts: 750
Joined: Wed Mar 30, 2016 2:02 pm

Ok, i'll need to use arrays

Post by Mystical Panda » Mon Jun 13, 2016 8:24 am

Ok, i'll need to use arrays then.



Mystical Panda
Posts: 750
Joined: Wed Mar 30, 2016 2:02 pm

Added a simple power armor

Post by Mystical Panda » Mon Jun 13, 2016 1:36 pm

Added a simple power armor 'station' using vanilla assets; an early proof of concept wip. The scripting is written with appending arrays (if I understood their function correctly), so an unlimited number of stations can be added throughout the wastelands either using the geck, in script, or by the player in game.  Hopefully later, I can change the vanilla console into a real power armor rack. There's an MCM menu option for "power" boosting any power armor your wearing using fission batteries. I've got a few ideas on how to apply that concept game wise as I go along. I'll create a misc item to drop, move, which will let me dynamically place these anywhere in wasteland on the next pass.


https://www.youtube.com/watch?v=AQfait8JfVo&feature=youtu.be



Mystical Panda
Posts: 750
Joined: Wed Mar 30, 2016 2:02 pm

I didn't notice this anywhere

Post by Mystical Panda » Wed Jun 15, 2016 3:13 am

I didn't notice this anywhere, and I could've missed it, but is there a:


GetMCMUpdated


flag? Just to tell if the MCM was used by any plugin? This might help to facilitate "refreshes" of specific variables when changed within a script using the MCM. In a script or other "script part" it wouldn't help much. Something like


If GetMCMUpdated == 1


; some program just used the mcm to change something. could be local, could be a shared game variable


; might want to check and see if something needs to be set back if overriding.


Endif



Mystical Panda
Posts: 750
Joined: Wed Mar 30, 2016 2:02 pm

I was thinking to provide the

Post by Mystical Panda » Fri Jun 17, 2016 8:39 am

I was thinking to provide the most compatibility with any new mod we develop, and other existing/ yet to be existing mods, we should place new objects using scripts instead of actual cell edits. I can see "placeatme" but is there a general "place (object) x y z" function? or do scripters just use "placeatme" then "disable" (which should make the object invisible before it fades in, then use setpos x ;y ;z to place it, then enable it? I'd prefer the former, but can easily do the latter.



Post Reply