PDA

View Full Version : movement, copying objects, est.


taboo games
06-05-2009, 10:22 PM
okay, i'm new here, as well as to alice. i have a pretty good grasp of the basic functions of alice, though anything beyond methods is lost to me....

right now, i am trying to make a game that is similar to kingdom hearts(like a personal sequel or something), and have come across several problems, as well as just a lack of knowledge.

first. i haven't created any personal characters for alice, but was am useing anim8or (oh please no! i'm so used to 3ds max, which is only at school....:( ) i found that i can use biturn to import the .an8 files into alice, but how do i make a character out of them? do i have to make individual parts for the arms and such or will one peice work?

second, and more pressing at the moment, i am using a pre-created object for the moment that has the walk ability. i can get it to move forward or turn on command. my problem is that i cannont get it to do these things together. i use the when key is pressed, up for forward 1 and left for turn .05 at .05 duriation.

third, i am trying to create a type of vehicle builder similar to the Gummiship builder in kindom hearts, and have gone through the trouble of setting it up so that all the building blocks of the vehicle will change color if a circle with a color is clicked (codeing that was a pain.... but not my problem)
my problem is that i cannot figure out how to make a/several copy(s) of said blocks to use for the vehicle, nor how to get them to stick together into a vehicle..... this is easier to explain to someone who has played kingdom hearts...

fourth, i want to be able to save the various creations made by such builder for use in flight simulator

5, how do i make character grab onto ledges? but only if ch. is falling or jumping?


6, i'll probably have much more to ask as i get into more minute details of said game....

anonymous1
06-19-2009, 08:06 AM
I would start with something easier. Setting too-high goals is one of the best ways to get discouraged early on. Running, jumping, grabbing ledges, etc. is nearly impossible to recreate well. As for the turning problem, right click on the "When a key is pressed..." box and click "change to" then "while a key is pressed" Instead of using the turn method, use the turn at speed method, (put it in the middle section, "During") which allows the character to simply turn at a constant speed as long as the key is held down, with no set distance. To make the character walk as long as a key is held down, create a boolean variable and and at the beginning (in a do together with everything else, but be sure to use the do in order where you need it) put "while variable is true, character.walk" then do as before changing to a while a key is pressed box. This time, set variable to true in the first box (beginning) and false in the last (end).

taboo games
06-23-2009, 12:40 PM
okay, the first part about the turning made sence, but i have no idea what a boolean variable is, or how to do what you said......

why would grabing leadges and such be hard? its all about proximity, right? and maybe a few other variables...... i guess i should take your word for it

DrJim
06-23-2009, 05:53 PM
... import the .an8 files into alice, but how do i make a character out of them? do i have to make individual parts for the arms and such or will one peice work?

If you go through Biturn, each mesh with a different texture will be imported into Alice as a separate sub object. (Yes, that seems strange to me too. :rolleyes: )

The problem is that the subobject's local origins may not be where you want them. In that case you have to break up your anim8or object into pieces and convert and import them separately. The positive aspect of this (and it is a pain) is that you can also really optomize your model hierarchy in Alice.

taboo games
07-06-2009, 11:08 AM
so....could you give an exsplination of that?-->> you can also really optomize your model hierarchy in Alice.<<-- modeling and such is easy for me, but i never figured out all the qurdinate stuff and such, so i'm at a loss. i don't even know what a model hierarchy is, though i can guess.

taboo games
07-08-2009, 02:38 PM
i need alittle help with what you said earlier. i made a boolean, with a "while variable is true, character walk" but then i lose you. if i make a "while key is pressed" how am i supposed to change the 'begin' box to true and the 'end' box to false? i can't get it to work, simulation keeps shutting down :(:(:(

taboo games
07-08-2009, 02:42 PM
here's the error message.....

Error during simulation.




Alice version: 2.2 5/26/2009



Throwable that caused the error:

java.lang.NullPointerException

at edu.cmu.cs.stage3.alice.core.Behavior$RuntimeStack .pop(Behavior.java:49)

at edu.cmu.cs.stage3.alice.core.Behavior.popStack(Beh avior.java:360)

at edu.cmu.cs.stage3.alice.core.response.CallToUserDe finedResponse$RuntimeCallToUserDefinedResponse.epi logue(CallToUserDefinedResponse.java:95)

at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.childrenEpiloguesIf Necessary(CompositeResponse.java:67)

at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.epilogue(CompositeR esponse.java:73)

at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.childrenEpiloguesIf Necessary(CompositeResponse.java:67)

at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.epilogue(CompositeR esponse.java:73)

at edu.cmu.cs.stage3.alice.core.response.CallToUserDe finedResponse$RuntimeCallToUserDefinedResponse.epi logue(CallToUserDefinedResponse.java:94)

at edu.cmu.cs.stage3.alice.core.behavior.AbstractCond itionalBehavior.internalSchedule(AbstractCondition alBehavior.java:112)

at edu.cmu.cs.stage3.alice.core.Behavior.schedule(Beh avior.java:226)

at edu.cmu.cs.stage3.alice.core.Sandbox.scheduleBehav iors(Sandbox.java:70)

at edu.cmu.cs.stage3.alice.core.World.scheduleBehavio rs(World.java:444)

at edu.cmu.cs.stage3.alice.core.World.schedule(World. java:486)

at edu.cmu.cs.stage3.alice.core.clock.DefaultClock.sc hedule(DefaultClock.java:99)

at edu.cmu.cs.stage3.alice.authoringtool.AuthoringToo l$7.run(AuthoringTool.java:702)

at edu.cmu.cs.stage3.alice.authoringtool.util.Default Scheduler.simulateOnce(DefaultScheduler.java:115)

at edu.cmu.cs.stage3.alice.authoringtool.util.Default Scheduler.run(DefaultScheduler.java:76)

at edu.cmu.cs.stage3.scheduler.AbstractScheduler.run( AbstractScheduler.java:45)

at java.awt.event.InvocationEvent.dispatch(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierar chy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)

at java.awt.Dialog$1.run(Unknown Source)

at java.awt.Dialog$2.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.awt.Dialog.show(Unknown Source)

at java.awt.Component.show(Unknown Source)

at java.awt.Component.setVisible(Unknown Source)

at edu.cmu.cs.stage3.swing.DialogManager.showModalDia log(DialogManager.java:60)

at edu.cmu.cs.stage3.swing.DialogManager.showDialog(D ialogManager.java:128)

at edu.cmu.cs.stage3.alice.authoringtool.AuthoringToo l.play(AuthoringTool.java:5159)

at edu.cmu.cs.stage3.alice.authoringtool.Actions$15.a ctionPerformed(Actions.java:168)

at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)

at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)

at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)

at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Source)

at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

at java.awt.Component.processMouseEvent(Unknown Source)

at javax.swing.JComponent.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierar chy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

onij
07-18-2009, 12:13 PM
I tried out the same methods described above for turning and moving speed, and I get the same error message.

I even get the same error message just by simply assigning a key to turn at a constant speed. All I've done is set a key to my "turn left" method. My method is the simple "turn at speed" command. It worked like for 2 seconds the first couple of times, and now the simulation will crash after it barely starts to turn. Could it be because the keypressed event needs a beginning and an end?


Edit: I just made methods for the beginning and end for the key press to simple animations. The turning works flawlessly until I let go of the key. I have changed the end key to a number of different methods, and they all end in a crash.

DrJim
07-18-2009, 02:07 PM
This is pretty difficult to explain - especially since I don't really completely understand it myself. :o

But basically the problem is that when the "event" ends - it stops in the middle of a loop - leaving the index undefined or at least indeterminate. That causes the error you're getting - since the program doesn't know what to do next.

I would suggest a search of the forum on walk methods - I know there are better explainations there plus some good working examples.

onij
07-22-2009, 10:10 PM
Thanks so much for the reply, the explanation, and the suggestion! I will go search and see what other people have done for effective walking methods and other situations like you've suggested.