Misc. questions... Pahts, regions, physics on/off

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Re: Misc. questions... Pahts, regions, physics on/off

Postby Nadnerb » Sun Mar 01, 2009 5:06 pm

yes, it looks like the callbacks aren't being exported. This probably means you don't have the trunk version of pyprp. If pyprp from this link doesn't work, then you'll need to try downloading it via an svn client..
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Misc. questions... Pahts, regions, physics on/off

Postby Jojon » Mon Mar 02, 2009 9:40 am

Actually I did update from the trunk with a SVN client and when that didn't work, I deleted all files and let the client fetch new fresh copies of them all. However, I find that whole SVN stuff very confusing; the terminology alone leaves me befuddled ("checkout"? huh?), so it's likely I'm not using it correctly.

The archive you linked to worked though, BUT only the first of my defined callbacks appears in the WaitToCmdTable. The others have their definitions there, within the plAnimCmdMsgs, but have no items in the list. I tried simply adding items for them and bumping plResponderState.NumCallbacks accordingly, but that didn't help me. :7

I'll keep trying. :8
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Misc. questions... Pahts, regions, physics on/off

Postby D'Lanor » Mon Mar 02, 2009 11:23 am

Shouldn't the user/msg be the same for all?
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Misc. questions... Pahts, regions, physics on/off

Postby Nadnerb » Mon Mar 02, 2009 11:52 am

Okay, unfortunately, I don't have the time to attempt to debug this remotely, so I'll just try to give you all the raw info you need to figure this out...

You can check to see if you really have a version of pyprp that can export eventCallback messages by looking for these lines at line 83 in prp_Messages.py:
Code: Select all
elif self.msgtype == 0x024B:
                self.data = plEventCallbackMsg(self)


This is the PRC from the exported responder that worked for me in TunnelDemo.
Code: Select all
<?xml version="1.0" encoding="utf-8"?>

<plResponderModifier>
   <plKey Name="SluiceOpen" Type="plResponderModifier" Location="1071;0" LocFlag="0x0000" />
   <SynchParams flags="0x00000010">
      <ExcludePersistentStates>Responder </ExcludePersistentStates>
      <VolatileStates></VolatileStates>
   </SynchParams>
   <ModFlags>
      <hsBitVector></hsBitVector>
   </ModFlags>
   <ResponderModParams CurState="0" Enabled="True" Flags="1" />
   <States>
      <plResponderState NumCallbacks="0" SwitchToState="1">
         <Commands>
            <Command>
               <plEnableMsg>
                  <Sender>
                     <plKey Name="SluiceOpen" Type="plResponderModifier" Location="1071;0" LocFlag="0x0000" />
                  </Sender>
                  <Receivers>
                     <plKey Name="PowerBox1" Type="plLogicModifier" Location="1071;0" LocFlag="0x0000" />
                  </Receivers>
                  <MessageParams TimeStamp="0" BCastFlags="0x00000800" />
                  <Command>
                     <hsBitVector>kDisable </hsBitVector>
                  </Command>
                  <Types>
                     <hsBitVector></hsBitVector>
                  </Types>
               </plEnableMsg>
               <WaitOn value="-1" />
            </Command>
            <Command>
               <plOneShotMsg>
                  <Sender>
                     <plKey Name="SluiceOpen" Type="plResponderModifier" Location="1071;0" LocFlag="0x0000" />
                  </Sender>
                  <Receivers>
                     <plKey Name="PowerBox1LeverDown" Type="plOneShotMod" Location="1071;0" LocFlag="0x0000" />
                  </Receivers>
                  <MessageParams TimeStamp="0" BCastFlags="0x00000800" />
                  <plOneShotCallbacks>
                     <Callback Marker="LeverDown" User="0">
                        <plKey Name="SluiceOpen" Type="plResponderModifier" Location="1071;0" LocFlag="0x0000" />
                     </Callback>
                  </plOneShotCallbacks>
               </plOneShotMsg>
               <WaitOn value="-1" />
            </Command>
            <Command>
               <plAnimCmdMsg>
                  <Sender>
                     <plKey Name="SluiceOpen" Type="plResponderModifier" Location="1071;0" LocFlag="0x0000" />
                  </Sender>
                  <Receivers>
                     <plKey Name="SluiceBoxSwitchHandle" Type="plAGMasterMod" Location="1071;0" LocFlag="0x0000" />
                  </Receivers>
                  <MessageParams TimeStamp="0" BCastFlags="0x00000800" />
                  <Callbacks>
                     <plEventCallbackMsg>
                        <Sender>
                           <plKey NULL="True" />
                        </Sender>
                        <Receivers>
                           <plKey Name="SluiceOpen" Type="plResponderModifier" Location="1071;0" LocFlag="0x0000" />
                        </Receivers>
                        <MessageParams TimeStamp="0" BCastFlags="0x00000800" />
                        <EventCallback EventTime="0" Event="1" Index="0" Repeats="0" User="1" />
                     </plEventCallbackMsg>
                  </Callbacks>
                  <Command>
                     <hsBitVector>kContinue kSetForwards kAddCallbacks </hsBitVector>
                  </Command>
                  <AnimParams Begin="0" End="0" LoopBegin="0" LoopEnd="0" Speed="0" SpeedChangeRate="0" Time="0" />
                  <Anims AnimName="HandleDown" LoopName="" />
               </plAnimCmdMsg>
               <WaitOn value="0" />
            </Command>
            <Command>
               <plAnimCmdMsg>
                  <Sender>
                     <plKey Name="SluiceOpen" Type="plResponderModifier" Location="1071;0" LocFlag="0x0000" />
                  </Sender>
                  <Receivers>
                     <plKey Name="MainSluice" Type="plAGMasterMod" Location="1071;0" LocFlag="0x0000" />
                  </Receivers>
                  <MessageParams TimeStamp="0" BCastFlags="0x00000800" />
                  <Callbacks>
                  </Callbacks>
                  <Command>
                     <hsBitVector>kContinue kSetForwards </hsBitVector>
                  </Command>
                  <AnimParams Begin="0" End="0" LoopBegin="0" LoopEnd="0" Speed="0" SpeedChangeRate="0" Time="0" />
                  <Anims AnimName="SluiceOpen" LoopName="" />
               </plAnimCmdMsg>
               <WaitOn value="1" />
            </Command>
            <Command>
               <plAnimCmdMsg>
                  <Sender>
                     <plKey Name="SluiceOpen" Type="plResponderModifier" Location="1071;0" LocFlag="0x0000" />
                  </Sender>
                  <Receivers>
                     <plKey Name="SluiceGear1" Type="plAGMasterMod" Location="1071;0" LocFlag="0x0000" />
                  </Receivers>
                  <MessageParams TimeStamp="0" BCastFlags="0x00000800" />
                  <Callbacks>
                  </Callbacks>
                  <Command>
                     <hsBitVector>kContinue kSetForwards </hsBitVector>
                  </Command>
                  <AnimParams Begin="0" End="0" LoopBegin="0" LoopEnd="0" Speed="0" SpeedChangeRate="0" Time="0" />
                  <Anims AnimName="GearOpen1" LoopName="" />
               </plAnimCmdMsg>
               <WaitOn value="-1" />
            </Command>
            <Command>
               <plAnimCmdMsg>
                  <Sender>
                     <plKey Name="SluiceOpen" Type="plResponderModifier" Location="1071;0" LocFlag="0x0000" />
                  </Sender>
                  <Receivers>
                     <plKey Name="SluiceGear2" Type="plAGMasterMod" Location="1071;0" LocFlag="0x0000" />
                  </Receivers>
                  <MessageParams TimeStamp="0" BCastFlags="0x00000800" />
                  <Callbacks>
                  </Callbacks>
                  <Command>
                     <hsBitVector>kContinue kSetForwards </hsBitVector>
                  </Command>
                  <AnimParams Begin="0" End="0" LoopBegin="0" LoopEnd="0" Speed="0" SpeedChangeRate="0" Time="0" />
                  <Anims AnimName="GearOpen2" LoopName="" />
               </plAnimCmdMsg>
               <WaitOn value="-1" />
            </Command>
            <Command>
               <plEnableMsg>
                  <Sender>
                     <plKey Name="SluiceOpen" Type="plResponderModifier" Location="1071;0" LocFlag="0x0000" />
                  </Sender>
                  <Receivers>
                     <plKey Name="ResSluiceWater" Type="plSceneObject" Location="1071;0" LocFlag="0x0000" />
                  </Receivers>
                  <MessageParams TimeStamp="0" BCastFlags="0x00000800" />
                  <Command>
                     <hsBitVector>kEnable kDrawable </hsBitVector>
                  </Command>
                  <Types>
                     <hsBitVector></hsBitVector>
                  </Types>
               </plEnableMsg>
               <WaitOn value="-1" />
            </Command>
            <Command>
               <plEnableMsg>
                  <Sender>
                     <plKey Name="SluiceOpen" Type="plResponderModifier" Location="1071;0" LocFlag="0x0000" />
                  </Sender>
                  <Receivers>
                     <plKey Name="PowerBox1" Type="plLogicModifier" Location="1071;0" LocFlag="0x0000" />
                  </Receivers>
                  <MessageParams TimeStamp="0" BCastFlags="0x00000800" />
                  <Command>
                     <hsBitVector>kEnable </hsBitVector>
                  </Command>
                  <Types>
                     <hsBitVector></hsBitVector>
                  </Types>
               </plEnableMsg>
               <WaitOn value="-1" />
            </Command>
         </Commands>
         <WaitToCmdTable>
            <Item Wait="0" Cmd="0" />
            <Item Wait="1" Cmd="1" />
         </WaitToCmdTable>
      </plResponderState>
   </States>
</plResponderModifier>


And this is the AlcScript that created it. What I'm not seeing in your PRC is the <plEventCallbackMsg> in the <Callbacks> tag of your <plAnimCmdMsg>, and the <Item> tag in the <WaitToCmdTable>, and I can't quite make out why, as they should be there, even if you have the wrong (but relatively recent) version of pyprp. I'd say it's probably an indentation error, but your script looks right to me.
Code: Select all
MainSluice:
    logic:
        actions:
          - type: responder
            name: SluiceOpen
            responder:
               states:
                - cmds:
                   - type: enablemsg
                     params:
                        receivers:
                         - logicmod:PowerBox1
                        cmds:
                         - disable
                     waiton: -1
                   - type: oneshotmsg
                     params:
                        receivers:
                         - oneshotmod:PowerBox1LeverDown
                        callbacks:
                         - marker: LeverDown
                           receiver: respondermod:SluiceOpen
                           user: 0
                     waiton: -1
                   - type: animcmdmsg
                     params:
                        receivers:
                         - 006D:SluiceBoxSwitchHandle
                        animname: HandleDown
                        callbacks:
                         - type: eventcallbackmsg
                           params:
                              receivers:
                               - respondermod:SluiceOpen
                              user: 1
                              event: 1
                        cmds:
                         - addcallbacks
                         - setforewards
                         - continue
                     waiton: 0
                   - type: animcmdmsg
                     params:
                        receivers:
                         - 006D:MainSluice
                        animname: SluiceOpen
                        cmds:
                         - setforewards
                         - continue
                     waiton: 1
                   - type: animcmdmsg
                     params:
                        receivers:
                         - 006D:SluiceGear1
                        animname: GearOpen1
                        cmds:
                         - setforewards
                         - continue
                     waiton: -1
                   - type: animcmdmsg
                     params:
                        receivers:
                         - 006D:SluiceGear2
                        animname: GearOpen2
                        cmds:
                         - setforewards
                         - continue
                     waiton: -1
                   - type: enablemsg
                     params:
                        receivers:
                         - scnobj:ResSluiceWater
                        cmds:
                         - drawable
                         - enable
                     waiton: -1
                   - type: enablemsg
                     params:
                        receivers:
                         - logicmod:PowerBox1
                        cmds:
                         - enable
                     waiton: -1
                  nextstate: 1
                  waittocmd:
                   - key: 0
                     msg: 0
                   - key: 1
                     msg: 1
               curstate: 0
               flags:
                  - detecttrigger
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Misc. questions... Pahts, regions, physics on/off

Postby Jojon » Mon Mar 02, 2009 2:48 pm

@D'Lanor:

Hmm, then how do I tell them apart? I want to trigger events a few at the time, each group waiting for the previous one to finish.

(My initial guess was that "user" refers to the sender of the message, but there seems to be an actual "sender" element, to a a callback message, so I remain clueless... :7 At least another of my guesses seems solidly refuted: the NumCallback element does not appear to be there to tell a command how many callbacks is in its list, given that Nadnerb's listing has two and it's still zero.)

Thanks for chipping in, by the way. :)


@Nadnerb:

Hey! I'm elated that you've spent the effort you have, thanks! In no way do I expect others to do my work for me. :7

Thanks for the PRC -- it would seem that you have only added one callback of this type to the responder (in addition to the oneshot one) and, as I half-suggested, I have it working here too, as long as I only have one. It is when I add several, that things go south and I mean to have a whole series of sequenced events here.

If I figure it out, I'll make sure to make any findings known.


EDIT:

Ok, one (layman-, I'll point out) late night report, before I go to bed: It would seem that one can not pick arbitrary event numbers; you begin with 0 and go upwards. If you have (both event & user) 0, 1, 2, 4, 5 & 6, only the first three will be added to the command list - the rest will be skipped, because no event no.3 was spotted. This is per command, so for the next state we have to begin at 0 again, which causes a conflict, since the event numbers appear to be common to all commands in the responder. I assume there is some way to somehow limit the receiver of the callback to the same state it was sent from within -- maybe the "user" or "index" element have something to do with that, maybe even "NumCallbacks", I wouldn't know...
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Misc. questions... Pahts, regions, physics on/off

Postby Jojon » Mon Mar 02, 2009 3:56 pm

Oh and one more question... :P

I had got it into my head, that unticking the Shaders/Shadow button in Blender, would make a material not receive shadows, which appears to be wrong, since I've got a flare with a nice silhouette in the shape of an avatar here. If somebody would be so kind to remind me of the correct way, I'll promise not to attempt any unwished hugging of said person. :P
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Misc. questions... Pahts, regions, physics on/off

Postby Nadnerb » Mon Mar 02, 2009 7:54 pm

If it's a flare, you should be able to just set the material "shadeless" this will stop light from affecting it at all though. If you want it to be lit, but not receive shadows.. then... there currently isn't a way to do that though pyprp, though I think I can add it as a per-object script option. Edit: nevermind, that span flag doesn't seem to work.
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Misc. questions... Pahts, regions, physics on/off

Postby Jojon » Tue Mar 03, 2009 12:04 am

Actually is IS shadeless and still receceives the shadow (..and I think that is as it should). This is in Ahra pahts, mind, where I seem to have extreme difficulties with the transparencies -- I spent an entire day to get one lumiescent object see-trough (add mode) (..and IT also takes the shadow), playing around with huge ranges of passindicies and the flags set via Ztransp and Zoffs and somehow managed (by making sure the texture had an alpha channel, whose actual content seems irrelevant) , but then I put the flare in front of it and was back to square one. I have yet to find a way to make that flare a flare, as opposed to a portal-window out to the streets. Persistence, though, sometimes gets results. :7

Well, off to work. Good morning, I suppose it would be, in a few hours. :)
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Misc. questions... Pahts, regions, physics on/off

Postby D'Lanor » Tue Mar 03, 2009 7:32 am

Jojon wrote:EDIT:

Ok, one (layman-, I'll point out) late night report, before I go to bed: It would seem that one can not pick arbitrary event numbers; you begin with 0 and go upwards. If you have (both event & user) 0, 1, 2, 4, 5 & 6, only the first three will be added to the command list - the rest will be skipped, because no event no.3 was spotted. This is per command, so for the next state we have to begin at 0 again, which causes a conflict, since the event numbers appear to be common to all commands in the responder. I assume there is some way to somehow limit the receiver of the callback to the same state it was sent from within -- maybe the "user" or "index" element have something to do with that, maybe even "NumCallbacks", I wouldn't know...

We are all laymen when it comes to new features (often even the person who implemented them). I thought I had an idea of how this worked with the oneshot callback but I can throw all of that overboard now. Too many variables... what do they all mean?... head spins.

Anyway, to work around that limitation: do you really need multiple states within one responder? Can the same be done by adding a second responder?
(Note: doing this with a second responder will make it easier to hook things up later using the global Python scripts that exist for saving SDL states)
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Misc. questions... Pahts, regions, physics on/off

Postby Jojon » Tue Mar 03, 2009 9:23 am

D'Lanor wrote:... head spins.


Heh, intentional? :)


D'Lanor wrote:Anyway, to work around that limitation: do you really need multiple states within one responder? Can the same be done by adding a second responder?
(Note: doing this with a second responder will make it easier to hook things up later using the global Python scripts that exist for saving SDL states)


You are probably right, since there will be quite a few conditionals. (To get the lift back down, there will have to be a reverse action (by the avatar), on the object manipulated to control it and if you're at its base, you can bring it down by cutting its power supply.

I'll have to read up on the resonder/scripting/SDL stuff first though - I have a hard time grasping the info on it in the wiki, already. :)

This age I intend to be what we might call a "chain-mail" project: I do some little thing on it and pass it it on to the next person volunteering, who do whatever (and I really mean *whatever*) (s)he decides, before returning it to me. I then publish the latest version of the age, keep an archive of every verson, in case there is need to revert and pass the project files to the next contributor and so on, starting at the top again when everyone has had a go and then we see where we wind up.
I just thought I'd get a tiny bit of functionality in there, before setting the ball (hopefully) rolling, but that is probably stupid - I am going to need skeleton animation for parts of that elevator anyway. I'm probably going to start gagueing interest in the next day or two, without even trying to clean up the mess I've made of the (few) rough meshes and their texturing. :7
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

PreviousNext

Return to Building

Who is online

Users browsing this forum: No registered users and 8 guests

cron