Fun with SetObjectVisualTransform function
ShadowM
Member Posts: 573
Post edited by ShadowM on
9
Comments
Overland maps.
Lotsa ideas.
Thanks, Beamdog!
-JFK
This is so cool.
Bosses that grow bigger as they near their enrage timer! Alice-in-Wonderland-shrinking players! Kinda-sorta-faked vertical-position-adjusting flying!! Pseudo-randomized random encounter forest areas with rotating, rescaling, and repositioning trees? Statue-ifying creatures is going to get amazing with this, too, especially if they can figure out how to make the statues stay stable. Blink dogs? Magic weapons that grow bigger until you can't carry them anymore? Magic weapons that grow smaller until they vanish when you equip them? Floor and wall spike traps where the spike models are hidden in the floor/walls and moved out via scripting rather than animating the model? Hidden compartments covered by non-static non-usable placeables that get moved aside? Falling-towards-the-ground sequences? Birds that are actually flying up in the air at varying height levels!!
An actual solution would to make an on-enter script for your area (or a bigger one on module load so you don't get loaded down with tons of scripts) that makes certain placeables different sizes. Something like below, adding another line with a different tag each time.
void main() { SetObjectVisualTransform(GetObjectByTag("placeable"), 10, 1.5); }
There's probably a more efficient manner this can be done using a loop function and variables, but my last experience with loops gave me a headache (granted, what I was trying to do was a lot more complicated than this). After a little thinking it would also probably be better to add the above to the bottom of a module's OnModuleLoad script instead of the Area's OnEnter script so you don't have to make one script per area and it doesn't constantly fire every time you enter the area.
Seem height does not affect the combat engine, so cannot move the creature high enough that the pc have to use range weapons for flying creatures ,but should be able to integrate it with the old system I was going to use to make it work.
Levitating furniture in haunted houses! Alien abduction beams that grab and pull in cows and people! Chopping rotor blade traps! Walls that slowly move in, crushing people! Trapped-fairy-bottles that shrink and trap the player when they release the fairy! Doors that jump to the ceiling when you try to open them! Furniture that sticks to ceilings! In fact, players that walk on ceilings!
We're going to need an M.C. Escher tileset.
Flipping bladed weapons around! Holding all holdables at whatever angle one needs! A rip in reality that gets bigger and shrinks and damages everything in it's vincinity! Slime monsters that grow bigger by consuming other things! Circumventing the fight with the ginormous boss by shrinking them to adorably tiny size! Cake that gets bigger when you eat it! Putting the tiny player in the bird cage placeable model! Thieves on windowsills and running over roofs! Growing blazing inferno by scaling up fire placeables! Planting trees that grow over time! Falling anvils and pianos!
... umber hulk piggyback rides! If we could link two creatures together, attaching one to the other based on one of the other creature's nodes kinda like it's with the beam VFX, we could turn all existing creatures into usable, separately targetable mounts. Possibly even ones that can carry multiple players at once. ::headscratch:: Heck, let's have players who are mounts and can carry other players. Bosses that can pick players up and throw them! Want!
::psyched!::
Maybe there could be a SetIsRangedTarget function that prevents something from being attackable save for with ranged weapons and spells? Like with the dartboard - that had no really satisfying scripting solution. hmm.
eeeeee there can be spiders swarming through cave tunnels now, ceiling, walls, floor, just spiders everywhere effing heck yeah spiders make everything better
Also, this means no more making different size variants of the same placeable, ever!! :'-D
Video LINK
So, the model is rotated, but the movement isn't. Thus, rotating a creature 90 degrees will make it move sideways while playing the walk forward animation. I'm not complaining, because this is still a great step (ugh, no pun intended) in the right direction.
Gonna play some more.
-JFK
Yes, toolset support will come. Full persistence (server vaults, etc) is already in. Adding toolset UI, live manipulation and render support needs to come as well.
No, there aren't any limits on the values you can insert (you can even set animation scale to 0 for example). programmer-defined values have a habit of being ran into needlessly so I tend to avoid them where possible, even if that results in more unhandled edge cases down the road.
Changing the walk mesh seems out of scope for me for this feature, but adding functions to adjust the AABB separately is something I'd like to do. If you have suggestions on how to design this, please speak up.
All the same if you find issues or things that could be better in some other way please say so too and we can still change them before they hit stable. That is what the dev branch is for.
This is what was show in the 8169 delvolopment shows new script commands.
int OBJECT_VISUAL_TRANSFORM_SCALE = 10;int OBJECT_VISUAL_TRANSFORM_ROTATE_X = 21;
int OBJECT_VISUAL_TRANSFORM_ROTATE_Y = 22;
int OBJECT_VISUAL_TRANSFORM_ROTATE_Z = 23;
int OBJECT_VISUAL_TRANSFORM_TRANSLATE_X = 31;
int OBJECT_VISUAL_TRANSFORM_TRANSLATE_Y = 32;
int OBJECT_VISUAL_TRANSFORM_TRANSLATE_Z = 33;
int OBJECT_VISUAL_TRANSFORM_ANIMATION_SPEED = 40;
// Gets a visual transform on the given object.
// - oObject can be any valid Creature, Placeable, Item or Door.
// - nTransform is one of OBJECT_VISUAL_TRANSFORM_*
// Returns the current (or default) value.
float GetObjectVisualTransform(object oObject, int nTransform);
// Sets a visual transform on the given object.
// - oObject can be any valid Creature, Placeable, Item or Door.
// - nTransform is one of OBJECT_VISUAL_TRANSFORM_*
// - fValue depends on the transformation to apply.
// Returns the old/previous value.
float SetObjectVisualTransform(object oObject, int nTransform, float fValue);
I know what SCALE, ROTATE AND ANIMATION_SPEED do. What does the TRANSLATE part do?
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectPolymorph(46), oPC, 0.6);
This work around works for pc also. Copy the PC lines in the appearance.2da and place them lower down. Adjust each one size category up and save. When you want to increase the size of the pc change the appearance with SetCreatureAppearanceType function to the new matching size and run
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectPolymorph(46), oPC, 0.6);
After that the engine will recognize the PC new size. I will post a video example with a halfling that has enlarge spell cast on it and then be treated as a medium creature. This enables me to do a fully function enlarge person spell / Reduce person spell for PC. This works great for PC, but NPC tail/scale system has noticeable de-synchronization of weapon attack animation of humanoid characters so a New BD SetSize function that incorporates the polymorph effect would be ideal.
VIDEO SAMPLE LINK