Ask a Question related to Macromedia Director 3D, Design and Development.
-
Pelleyoo #1
Hm this is gonna be a tough one..
Have you guys ever played a game named Grim Fandango? Properbly not. Anyway, we
are doing a game smiliar to Grim Fandango, which means its a 3d adventure game.
We've come up with some really clever solutions for the game mechanics, but now
the source is getting so complex that we feel that we want to "split up" the
code into different behaviors with different names.
For example, when the character enters a specified area,
"Trigger_talk_bartender", we want a behavior to get activated. This behavior
will control the characters motions, overlay-text and if the current line is to
be played over and over again or if a new line is to be played the next time
the player enters this area.
Every conversation will have its own "Talk behavior". But how should we get
them to work together? Maybe something like this?;
If char.position = Trigger_talk_bartender then
Go Talk_Behavior_1 me
end
and then the behavior will be "On Talk_Behavior_1 me".
Its so complex to explain but I hope you understand everything and go help me
with problems.
Pelleyoo Guest
-
IDCS2 - SLOW spell checking.. is this gonna get fixed?
Seriously.. I shouldnt have to wait 3 seconds between words that the spell check is looking at. -
tough one IXmlSerializable
I've got an tough question regarding xml serialization and web services... I've got a custom class that I am returning from my web method. ... -
This is gonna sound retarded
What would you folks say is the most efficient way to capture a query variable and use it through a site?? Bill -
Reading Cookies (Tough one!)
Hi all, I wrote a function (C++) for use in my Active Server Object that is meant to read cookies. It gives some very strange behavior in that... -
Old Toad Quiz: tough
http://www.mickweb.com/quiz/ Please check for typos and errors. Passing Scores: NY: 60% USA 55% ROTW: 50% Mick -
extol #2
Re: Hm this is gonna be a tough one..
Hi, Pelleyoo. I actually have Grim Fandango, although I haven't played it in
years. I never thought about handling each character interaction with a
different behavior. But definitely is a way to go. As far as the code you
wrote, that would definitely work. But it mighty be best to do a list (array)
of possible conversations like so:
repeat with j = 1 to interaction_behaviors.count --
cycle through the list of possible interactions
if char.position = interaction_behaviors[j].position then -- if our
character is ready to interact with this person
do interaction_behaviors[j].myBehavior
-- execute the behavior that handles this conversation
exit repeat
-- and stop the cycle
end if
end repeat
Then for each interaction, you could set up an behavior in the list:
add interaction_behaviors, [#position: vector(100, 120, 10), #myBehavior:
"bartender_talk()"]
So when your character gets to 100, 120, 10 (xyz coordinates), it would
trigger the bartender_talk behavior
on bartender_talk me
-- The bartender will say something cool
end
I hope this helps. One thing to note is that you will want to change that
first line
if char.position = interaction_behaviors[j].position then
to some sort of function (which you would write) that checks to see if your
character is in the vicinity of the bartender, not the exact position
if checkProximity(me, char.position, interaction_behaviors[j].position) then
Good luck with this project!
extol Guest
-
Roofy #3
Re: Hm this is gonna be a tough one..
Hi Pelleyoo,
I do not understand why you did not animate the characters in your 3D
application. What I would of done is created animamations in my 3D application,
and then depending on if I was animating the charcter by its bones, then I
would use the bones player modifier, or if I was animating the character
through keyframes, then I would use the keyframe player modifier. However, no
matter which modifier I did use, both of them allow you to put your animations
into a play list que as well as blending one anitmation into the next animation
that is in the play list que.
In addition, to make things easier for me when coding the script, I would also
create an invisible object such as a door for a doorway that when the
collision detection hits the invisible object, then the script would know the
user has entered a certain room. Once the script knows that the user has
entered that piticular room, then I would have the script call a "sendSprite"
command. The arguments for a sendsprite command is as follows...
sendSprite(to which sprite you want the message to be sent to,
#messageHandler, your additional arguments)
for example, the beliow script will send the message playMe to sprite 0, which
is the frame script behaviour area, and also send the argument of the motion's
name "Speek", and which character is suppose to speek
on collisionDetected collisionData
if collisionData.name = "BarRoom" then
sendSprite(0, #playMe, "speek", "barTender")
end if
end collisionDetected
... this line of code is part of the behaviour script that lies on the frame
behaviour script....
on playMe me, motName, CharName
notLooped = 0
startTime = 0
endTime = 60000 -- this is in milliseconds which 60000 milliseconds is equaled
to one minute
member("my3dScene").model(CharName).bonesPlayer.pl ay(motName, notLooped,
startTime, endTime)
end playMe
Roofy Guest
-
extol #4
Re: Hm this is gonna be a tough one..
Hi, Roofy. That is a good point. I assumed that Pelleyoo had already made the
character animations in his 3d app. If not, Pelleyoo, I agree with Roofy that
you should do so. But, I think what Pelleyoo is talking about is handling
interactions. In Grim Fandango, you were given several lists of
questions/responses in each conversation that you could select to say. Then
the character you are conversing with would be animated and speak differently
depending on which question/response you picked. So there are dozens of
animations for each character. So I think Pelleyoo wants to seperate each
conversation in a separate behavior so that it's cleaner for the programmers.
So the behaviors would tell the model what animations to show and when,
depending on what the user did. Then use bonesPlayer.play to show the
appropriate frames of animation. Maybe I am wrong, but that's what I was
thinking.
extol Guest
-
Pelleyoo #5
Re: Hm this is gonna be a tough one..
Extol, you've got it right on spot. I haven't tried the method you recommended, yet, but it makes sense to me and I will report how it went tomorrow when i've tried it.
Pelleyoo Guest
-
Newt99 #6
Re: Hm this is gonna be a tough one..
I also have bought and played Grim Fandango at the time !
You can use sendSprite() indeed if you want to target just one specific sprite
or use sendAllSprites() if you want to send the message to all behaviors.
You can use the scriptInstanceList of a sprite in order to dynamicall assign
behaviors to it.
Best regards,
Karl.
[url]http://www.chromelib.com[/url]
Newt99 Guest
-
Pelleyoo #7
Re: Hm this is gonna be a tough one..
Well Extol. We just want to know really how ones own behaviors can be attached
to a sprite with an internal code already haved.
For example, you can attach as many chrome lib behaviors a member as you want.
But i dont know how to attach my own behaviors. As you understood extol, this
will only be for make the code simple and sliced. thats what we want to have.
it would makes us glad
Thanks on beforehand
Pelleyoo Guest
-
Newt99 #8
Re: Hm this is gonna be a tough one..
You have two solutions:
- The first is the one I told about previously, i.e using the
scriptInstanceList of the W3D sprite in order to dynamically attach as many
behaviors as you want to it.
- Add the standard handlers in your own behaviors like
getPropertyDescriptionList() or is3D(). Just have a look either at the Chrome
Lib behaviors or at the standard 3D behaviors. You will see they all use a
small set of handlers that are the same. These are looked for by Director when
you drag'n'drop a behavior onto a sprite. If they are not there, you cannot
assign the behavior to the sprite.
Cheers,
Karl.
Newt99 Guest
-
extol #9
Re: Hm this is gonna be a tough one..
Click on your sprite in the score. In the Property Inspector window to the
right, click the Behaviors tab. Click the plus sign to make a new behavior.
Name it what you want. it will then appear in the list. Right click it and
then select "script". Then you can add your script. This behavior will now be
in the cast window as well. So if you need to attach that behavior to any
other sprites, just drag it onto them from the cast. If you want a window that
gives you paramaters to enter when you attach the behavior, you need to use
getPropertyDescriptionList(), like Newt99 mentioned. Good luck!
extol Guest



Reply With Quote

