maybesomethingdunno
30th Jul 2010, 10:58 PM
I was hesitant to post in the forums because I don't know how to adequately word my problem. But, I really want to make progress with this.
I have a self-interaction that puts the Sim in a loop. The movement through the loop as well as what subroutine the Sim does depends upon the attribute values of several objects working together in a (hopefully) coordinated effort.
To me the code looks okay. In-game, however, the timing is off and/or the Sim does one subroutine when he/she should be doing another. I don't see why or how.
As some people already know, I'm working on a surfing interaction.
Unfortunately, the wave effect is more than just waves and the waves are not regularly timed. So, I've made a default replacement of the wave effect object. It forces a continuous reset of the effect and enables a timed toggle of an attribute value to indicate the start of a new wave. It also adds a routing slot. The dark squares on the ocean floor in the video are just terrain paint to indicate where the placeholder object is. ;)
There is a NPC to handle the routing (Position A: the routing slot; Position B: a location relative to the default replacement wave effect object). Also, there is a cart object that will hold the Sim and eventually a surfboard object. (Right now, I'm using a modified version of joninmobile's emptied bookcase for a cart object since it has a lot of slots for me to play with and it has a tall mesh for greater visibility while testing. The cart will eventually be invisible and not actually be the surfboard itself. I have my reasons for not having the surfboard function as the cart. ;) )
I'm using two slots in the cart for the Sim. One is to be lowered and at an angle for the paddling animation. The other is for riding along the surface. Since the wave effect starts outside the boundaries of the lot, I shifted the slots over a little. This was to make the Sim appear to be a little further out and appear to have more time on the wave. The routing slot is located about the middle of the swimming area, where the wave dissolves into more of a foamy spray (incapable of realistically holding a surfboard and person).
As you can see in the video, the Sim flies over from one slot to another. Obviously I've failed to simply make the Sim look like he/she is paddling further out to sea and surfing to be just back inside the lot boundary. :(
You can also see the main problem I mentioned earlier: the timing on the surfing is off and/or the Sim does one subroutine when he/she should be doing another (one bleeds into another?). Although, it does seem to be in sync at times (e.g. about the 15th second of the video).
In the wave effects object, the main bhav loop toggles the value for the "WaveStart (0=Not Started, 1=Started)" attribute.
In the NPC, there are 3 attributes.
"WaitingForSim? (0=Sim on surfboard, 1=Sim not on surfboard)" to make the NPC wait for the Sim to get on board before it leaves its starting position at the routing slot.
"Direction (0=Facing ocean, 1=Facing shore)" value is toggled whenever the NPC reaches Point A or Point B on its path back and forth. It would make sense to me that whenever this value is 0, the Sim is paddling out to sea to catch a wave.
"WaitingForWave? (0=Wave caught, 1=No waves caught yet)" value is to make the NPC wait until the wave effect object's "WaveStart (0=Not Started, 1=Started)" attribute has a value of 1. Facing the shore, the Sim is just relaxing on the surfboard and is neither surfing nor paddling.
In the self-interaction, the Sim routes to the nearest wave effect object and stores its ID in a Local. The Sim then spawns the NPC and the cart (already snapped into the NPC's slot), storing their IDs in Locals as well. This way, the self-interaction has access to check/edit the attribute values of the objects involved.
This project seems so doable. (There are even animations that seem to work for it!) I'm sure it's just a logic fail on my part. :lol:
Movie Clip (http://yfrog.com/5umoviefvz) (Alternate/Direct Link (http://img210.imageshack.us/img210/9913/moviefv.mp4)) -- since neither my words, screenshots, nor diagrams would adequately show the problem(s).
The files are attached. I realize I have a lot more work to do with this (e.g. adding guardian BHAVs for non-beach lots, lots of polishing, the cart object etc). I want to get at least the basic surfing concept/logic correct. (The surf self-interaction has 2 additional bhavs that are not called which are just variations of the main interaction.)
I have a self-interaction that puts the Sim in a loop. The movement through the loop as well as what subroutine the Sim does depends upon the attribute values of several objects working together in a (hopefully) coordinated effort.
To me the code looks okay. In-game, however, the timing is off and/or the Sim does one subroutine when he/she should be doing another. I don't see why or how.
As some people already know, I'm working on a surfing interaction.
Unfortunately, the wave effect is more than just waves and the waves are not regularly timed. So, I've made a default replacement of the wave effect object. It forces a continuous reset of the effect and enables a timed toggle of an attribute value to indicate the start of a new wave. It also adds a routing slot. The dark squares on the ocean floor in the video are just terrain paint to indicate where the placeholder object is. ;)
There is a NPC to handle the routing (Position A: the routing slot; Position B: a location relative to the default replacement wave effect object). Also, there is a cart object that will hold the Sim and eventually a surfboard object. (Right now, I'm using a modified version of joninmobile's emptied bookcase for a cart object since it has a lot of slots for me to play with and it has a tall mesh for greater visibility while testing. The cart will eventually be invisible and not actually be the surfboard itself. I have my reasons for not having the surfboard function as the cart. ;) )
I'm using two slots in the cart for the Sim. One is to be lowered and at an angle for the paddling animation. The other is for riding along the surface. Since the wave effect starts outside the boundaries of the lot, I shifted the slots over a little. This was to make the Sim appear to be a little further out and appear to have more time on the wave. The routing slot is located about the middle of the swimming area, where the wave dissolves into more of a foamy spray (incapable of realistically holding a surfboard and person).
As you can see in the video, the Sim flies over from one slot to another. Obviously I've failed to simply make the Sim look like he/she is paddling further out to sea and surfing to be just back inside the lot boundary. :(
You can also see the main problem I mentioned earlier: the timing on the surfing is off and/or the Sim does one subroutine when he/she should be doing another (one bleeds into another?). Although, it does seem to be in sync at times (e.g. about the 15th second of the video).
In the wave effects object, the main bhav loop toggles the value for the "WaveStart (0=Not Started, 1=Started)" attribute.
In the NPC, there are 3 attributes.
"WaitingForSim? (0=Sim on surfboard, 1=Sim not on surfboard)" to make the NPC wait for the Sim to get on board before it leaves its starting position at the routing slot.
"Direction (0=Facing ocean, 1=Facing shore)" value is toggled whenever the NPC reaches Point A or Point B on its path back and forth. It would make sense to me that whenever this value is 0, the Sim is paddling out to sea to catch a wave.
"WaitingForWave? (0=Wave caught, 1=No waves caught yet)" value is to make the NPC wait until the wave effect object's "WaveStart (0=Not Started, 1=Started)" attribute has a value of 1. Facing the shore, the Sim is just relaxing on the surfboard and is neither surfing nor paddling.
In the self-interaction, the Sim routes to the nearest wave effect object and stores its ID in a Local. The Sim then spawns the NPC and the cart (already snapped into the NPC's slot), storing their IDs in Locals as well. This way, the self-interaction has access to check/edit the attribute values of the objects involved.
This project seems so doable. (There are even animations that seem to work for it!) I'm sure it's just a logic fail on my part. :lol:
Movie Clip (http://yfrog.com/5umoviefvz) (Alternate/Direct Link (http://img210.imageshack.us/img210/9913/moviefv.mp4)) -- since neither my words, screenshots, nor diagrams would adequately show the problem(s).
The files are attached. I realize I have a lot more work to do with this (e.g. adding guardian BHAVs for non-beach lots, lots of polishing, the cart object etc). I want to get at least the basic surfing concept/logic correct. (The surf self-interaction has 2 additional bhavs that are not called which are just variations of the main interaction.)