Author Topic: Question on placeable states  (Read 623 times)

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Question on placeable states
« on: August 26, 2011, 05:13:54 pm »


                <dancing around the subject...>

Reading Knight_shield's activation thread on scripting and researching the things that have been done...

Makes me wanna do sumpin :-)

Here's the idea FWIW (knowing it's pretty far down on *my* list :-P

Put in a nice vertical portal frame (like the CEP Stargate)
Create 3 placeable vertical, concentric rings of glowing Address symbols (Edit: 9 states - off & 8 symbols at top)
Create 1 horizontal ring of glowing symbols that the PC stands in the middle of (Edit: 9 states - off & 8 symbols to "north")
Big red "Don't press" button for entering symbols

To dial in location, PC clicks on horizontal ring until symbol he wants rotates to index mark. Clicks the "enter" button.
Dials next symbol.  Meanwhile, from outside in, the address rings on the stargate light up (as activated) and rotate to the selected position.  When all 3 are activated, portal opens.

This would, I think require an absurd range of appearances.
But do the placeable "states" use up appearance rows? That is, if you create a placeable (horizontal ring) and give it 9 states (off, symbol one at north, symbol two, etc.) where are those textures/animations stored?

And of course - if they are guessing symbol order - on the third error, the horizontal ring irises closed and slices them in half =)

<...and getting blood on the carpet>
               
               

               


                     Modifié par Rolo Kipp, 26 août 2011 - 04:21 .
                     
                  


            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Question on placeable states
« Reply #1 on: August 26, 2011, 05:27:11 pm »


               It would be far easier to have the horizontal ring shift, or have the effects, since you could do everything described though clever uses of SetFacing then.
 The address rings would have to be set to orient from the center of the horizontal stargate, so that they could appear to slide in a circle around the outer ring.

 A bit of work for the initial placeable models needed, but the scripting itself to control it would be straightforward done that way.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Question on placeable states
« Reply #2 on: August 26, 2011, 05:46:30 pm »


               As far as I am aware, all the states of a placeable are stored in the mdl file of the placeable. Which means that each placeable only uses one row of placeables.2da regardless of how complicated it is. Aren't states of a placeable just animations?
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Question on placeable states
« Reply #3 on: August 26, 2011, 06:05:17 pm »


               <puts his hands together...>

henesua wrote...

As far as I am aware, all the states of a placeable are stored in the mdl file of the placeable. Which means that each placeable only uses one row of placeables.2da regardless of how complicated it is. Aren't states of a placeable just animations?


That's what I'm hoping :-)

I'll look into it later, though I hope to hear some CC sermons before then :-)

<...and tries to look pious>
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Question on placeable states
« Reply #4 on: August 26, 2011, 06:06:14 pm »


               Well, this is hypothetical at this point but I believe you could possibly make a creature appearance as a placeable (i.e. make a creature look like a placeable) and get 20+ states in the form of Custom Looping Animations which are available to creatures (right?) and exposed in NWScript.  I first saw the effect in the colorable CEP crates which I believe are creatures that look like placeables so I think it's possible.

I've been working on getting those extra states without having to resort to the above shenanigans but haven't been successful so far.  If I can't get it to work I'll probably go that route though.  If you wanted to explore that method, Failed.Bard's suggestion of setting the facing could (again, theoretically) be applied to a creature instead of a placeable which would result in slightly smoother turning, I believe.

@Henusa - Yep.  So if one wants more states one either has to "overstuff" the model base with more animations and hope you can play them with NWScript or change the nature of the model (i.e. from placeable to creature) in order to allow you to do so.  Or some other as yet unknown (to me) trickery.

Any CCers have other methods for creating placeables with more animations (3+ looping) who would share how it's done?
               
               

               


                     Modifié par OldTimeRadio, 26 août 2011 - 05:27 .
                     
                  


            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Question on placeable states
« Reply #5 on: August 26, 2011, 06:17:56 pm »


               <getting excited...>

Failed.Bard wrote...

It would be far easier to have the horizontal ring shift, or have the effects, since you could do everything described though clever uses of SetFacing then.
 The address rings would have to be set to orient from the center of the horizontal stargate, so that they could appear to slide in a circle around the outer ring.

 A bit of work for the initial placeable models needed, but the scripting itself to control it would be straightforward done that way.


I thought of that (SetFacing), but I'd want a smooth animation of the ring rotating to a new position (The ring I'm picturing, btw, is immaterial (walkthrough-able) but a usable placeable.

So, if the states are anim on the mdl, then I can tie the state of the address rings to the status of address registers set by the control ring (still working on terminology). Then I don't need to script anything (animation wise) except a change in state to the four objects (five counting the gate itself). And the exact placement or orientation of the placeables (except that the address rings would be 1cm in front of the gate and previous ring) would not matter.

This has implications for my enchanting system as well. I could use glowing rings of symbols that are selectable several places... Magic in Amethyst is based around the concept of "The Wheel Of Eight" which is actually three eight-element rings perpendicular to each other - Chaos/Order, Light/Shadow & Death/Life - only two of which apply to any given magic (Arcane, divine & natural).

To have the mage manipulate the spell components in a visual way (when composing a spell... not in combat) would be fantastic!

Hmmm...
 
<...and trying not to show it>
               
               

               


                     Modifié par Rolo Kipp, 26 août 2011 - 05:19 .
                     
                  


            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Question on placeable states
« Reply #6 on: August 26, 2011, 06:32:12 pm »


               I'll have to try it out a bit later to see for sure, but I think with a small loop you could do a smooth rotation.
 I'll paste the code in for it later if I get something working decently well to show as an example, likely tonight or tomorrow though.  I'm a bit curious now what sort of an effect I could get out of some of the placeables that way.
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Question on placeable states
« Reply #7 on: August 26, 2011, 06:38:33 pm »


               <shading his eyes...>

OldTimeRadio wrote...

Well, this is hypothetical at this point but I believe you could possibly make a creature appearance as a placeable (i.e. make a creature look like a placeable) and get 20+ states in the form of Custom Looping Animations which are available to players and exposed in NWScript.  I first saw the effect in the colorable CEP crates, which I believe are creatures that look like placeables, so I think it's not impossible.

I saw someone somewhere did this with "Islands creatures" to simulate movement at sea. But then you get into the immersion-degrading conversation thing to get anywhere. Hoping I can go with multi-state placeables :-)

I've been working on getting those extra states without having to resort to the above shenanigans but haven't been successful so far.  If I can't get it to work I'll probably go that route though.  If you wanted to explore that method, Failed.Bard's suggestion of setting the facing could (again, theoretically) be applied to a creature instead of a placeable which would result in slightly smoother turning, I believe.

@Henusa - Yep.  So if one wants more states one either has to "overstuff" the model base with more animations and hope you can play them with NWScript or change the nature of the model (i.e. from placeable to creature) in order to allow you to do so.  Or some other as yet unknown (to me) trickery.

Any CCers have other methods for creating placeables with more animations (3+ looping) who would share how it's done?

There are several placeables with 3 states... usually off/on/destroyed.  

Hmmm... there are 4 placeable animations (activate/deactivate/open/close) defined, but a *bunch* of "custom" animation types that look like you can use them... the question being if the 

ActionPlayAnimation (ANIMATION_ *constant*); (Edit: should be PlayAnimation() :-P)

will work on placeables with *any* animation constant, assuming the animation is present...

You'd have to know what constant was assigned to which anim, of course...

<...and looking into the distance>
               
               

               


                     Modifié par Rolo Kipp, 27 août 2011 - 05:13 .
                     
                  


            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Question on placeable states
« Reply #8 on: August 26, 2011, 06:54:45 pm »


               Good point- I wasn't even thinking about the destroyed state.  I'm 99% sure the open/close animation states are hardcoded for 60 frames (and I believe speed up or slow down as necessary), which is why I went with on/off for my animating placeables as those animations don't have any kind of limit.

Hmmm... there are 4 placeable animations (activate/deactivate/open/close) defined, but a *bunch* of "custom" animation types that look like you can use them... the question being if the 

ActionPlayAnimation (ANIMATION_ *constant*);

will work on placeables with *any* constant, assuming the animation is present...


That's what I had problems with.  In the tests I ran I couldn't make, say, a placeable to play an ANIMATION_CUSTOM_LOOPING1 animation.  I've still not given up on it (I usually ignore test results, even my own, if I don't like the result '<img'>) because I'd really like to have 60+ states for a placeable.  I'm not even sure what kind of crazy things could be achieved with that many states!

But I wouldn't mind finding out...':devil:'
               
               

               


                     Modifié par OldTimeRadio, 26 août 2011 - 06:01 .
                     
                  


            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Question on placeable states
« Reply #9 on: August 26, 2011, 07:14:36 pm »


               <leans back, looking suave...>

*This* is why I post here :-)
Thanks, OTR. Saved me a bunch of OCD this evening.  Save me even more if I knew the approaches you took ;-)

But then, though I'm pretty excited about the whole thing (*enormous* implications for my marvelous modular magic system), I am not ready to work on this yet, except as an intill, intellek, er, thinking excercise :-)

<...in his comfy, worn leather chair with a snifter of Grand Mariner and his old full-bent briar>
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Question on placeable states
« Reply #10 on: August 26, 2011, 07:40:25 pm »


               

Rolo Kipp wrote...
Save me even more if I knew the approaches you took ;-)

Really straight-forward testing.  I made a placeable using off/off2on/on/on2off which (as I mentioned) is my favorite method for doing airships because I can have an unlimited number of frames in each of those animations.  Then, after testing that worked (i.e. hadn't borked something on the model), I added custom1start, custom1lp, & custom1end animations to the model base, having geometry which moved during all three portions of the animation in the specified frame rangers so it should identify itself, visually, if it was working.  All tests were carried out using a lever-activated script which grabbed the placeable by its tag and applied the appropriate animation constant to attempt to switch states.

I may have tried some other animations relating to other animation constants but can't remember what they specifically were.  None of the tests seemed to work, though, so I put the idea on the shelf and went back to other projects.  I still think it's possible to "overstuff" placeables, maybe I botched my tests somehow.  Again, if none of that pans out, I'll turn attention to doing the creature-as-placeable and see if I can get farther.  There's just potential ickyness there that I want to avoid if possible and keep things as simple as I may.
               
               

               


                     Modifié par OldTimeRadio, 26 août 2011 - 06:51 .
                     
                  


            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Question on placeable states
« Reply #11 on: August 26, 2011, 08:02:44 pm »


               <ponders...>

Have you tried naming the anims after the appropriate creature anim for the constant (instead of the custom ones) and coopting a creature anim?

Like "ccastout", "ccastoutlp and "..." (can't find the name) using the constant ANIMATION_LOOPING_CONJURE1?

<...imponderables for fun>
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Question on placeable states
« Reply #12 on: August 26, 2011, 08:46:00 pm »


               I believe I did try using animation names other than the custom looping if that's what you mean, but I can't recall which ones.  If I find the demo module I'll pass it along with the test object otherwise I'll make another one sometime.  Right now I'm (foolishly) trying to outwit the "*out of ammo*" message for custom ranged weapons and when I'm sick of that (I keep coming back to it and not being able to make any progress) I'll probably take another look at overstuffing placeables or at least see if the creature-as-placeable method works like I hope.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Question on placeable states
« Reply #13 on: August 27, 2011, 03:02:43 am »


               Those animation constants are only stand ins for integers. If you want to figure out whether any integers links to the animations stored on the model, you should write a script that cycles through everything from 0 to 255.

The script would announce which integer it is doing, then play animation for that integer. wait 6 seconds or so, then iterate to the next. This would be a full test I think to figure this out.

Another option is to have a wand that tells an object to play the next animation. But this could develop carpal tunnel with all the clicking. I prefer the automated scripted loop. I can sit back with a scratch pad, piece of paper, and a nice drink while watching for good stuf to happen.

I want to add that I have used this same method for creatures. I had some models off the vault, and wanted to know which animations would work for them. It was a success.
               
               

               


                     Modifié par henesua, 27 août 2011 - 02:05 .
                     
                  


            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Question on placeable states
« Reply #14 on: August 27, 2011, 04:20:06 pm »


               Excellent idea- that's really how to do this right.  Lemme see what I can come up with.