Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Old
Killerzeron
Member
 
Status: Offline
Posts: 19
Join Date: Dec 2014
Location: Mumbai
Default 01-09-2015, 12:10 AM

Hey raven, Thanks for the help. I managed to make up the codes through ur codings. thanks for the help again and ill let you know when my sim is ready.

Last edited by Killerzeron; 01-09-2015 at 07:56 AM.
   
Reply With Quote
Cool
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 408
Join Date: Oct 2013
Location: Northern Virginia
Default Cool - 01-09-2015, 09:36 AM

Good job And if you ever need help I'm sure me or someone on the forum can do it


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
Reply With Quote
Old
Killerzeron
Member
 
Status: Offline
Posts: 19
Join Date: Dec 2014
Location: Mumbai
Default 01-09-2015, 11:11 PM

Quote:
Originally Posted by RavenOfCode View Post
Good job And if you ever need help I'm sure me or someone on the forum can do it
Hi raven,

do you know how to make a restart command? i mean like:

I just want to make the plane go back to its starting position, i dropped a 3d text at its start position. So what i want is that when the plane gets closer to 0.5-3 meters it goes back to its starting position( at the text acting as a checkpoint-like). I tried using if than else but i dont know how to make up the code for it. If it comes in contact within 0.5-3m of any object, anything, it goes back to its start position. And i want this command to be looped forever which i know how to do but, what i did was


I made a method in the MG-29 on it restart command, I used the proximity functiion on the if/else condition( if MiG-29 is within Threshold of object{how to make it as anything?} then do " MiG-29 move to start position>3D text<)

the problem here is, how to make it as anything??

thanks,

Killerzeron
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 01-10-2015, 02:35 AM

Use a world variable. Make it a object variable. Make it a list as well. Put each object you want collision with in the list. That's one way to do it.


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Old
Killerzeron
Member
 
Status: Offline
Posts: 19
Join Date: Dec 2014
Location: Mumbai
Default 01-10-2015, 06:10 AM

Quote:
Originally Posted by sfunk View Post
Use a world variable. Make it a object variable. Make it a list as well. Put each object you want collision with in the list. That's one way to do it.
Hmmm...thats basically not the only way. One of my friends figured it out but i cant. A method different than urs. Thats why im asking here. I have everything i need but i miss it out rarely.
   
Reply With Quote
Interesting Problem
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 408
Join Date: Oct 2013
Location: Northern Virginia
Default Interesting Problem - 01-10-2015, 08:48 AM

One thing I would do is make separate methods for the different things the plane is colliding with, as Alice currently can only use the centers of the object to collide rather than the polygons that make up the object.

My suggestion is 2 basic colliding methods:
1.this would be for buildings/other planes/whatever.
Make a method called planeCollide > add ifelse statement > add loopInfinityTimes > add the function if Mig29 is within 1 meter of world > make 2 paramerters, 1 for a distance and replace the '1 meter' with this parameter, the other is an object replace 'world' with this > put the ifelse statment inside the loop > make another method > put a doTogether in it > then place planeCollide into this and us the parameters for the object you want/distance you want. (inside the ifelse statement you can put the code you want for it to reset)

2. This would be for the ground.
Make a method called collideWithGround > add ifelse statement > add loopInfinityTimes > put if else into loop > added the function 'mig29 is below ground' > then put in what you want to happen for when it crashes into the ground > then call this method in the events tab.

Hope this helps, also Alice come with a pre enstalled flight sim, in tutorials, you might want to take a look at that


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 01-10-2015, 04:21 PM

You'd still have to make a variable list to use the object parameter if he wants the method to work for all objects this way.


Quote:
Originally Posted by RavenOfCode View Post
One thing I would do is make separate methods for the different things the plane is colliding with, as Alice currently can only use the centers of the object to collide rather than the polygons that make up the object.

My suggestion is 2 basic colliding methods:
1.this would be for buildings/other planes/whatever.
Make a method called planeCollide > add ifelse statement > add loopInfinityTimes > add the function if Mig29 is within 1 meter of world > make 2 paramerters, 1 for a distance and replace the '1 meter' with this parameter, the other is an object replace 'world' with this > put the ifelse statment inside the loop > make another method > put a doTogether in it > then place planeCollide into this and us the parameters for the object you want/distance you want. (inside the ifelse statement you can put the code you want for it to reset)

2. This would be for the ground.
Make a method called collideWithGround > add ifelse statement > add loopInfinityTimes > put if else into loop > added the function 'mig29 is below ground' > then put in what you want to happen for when it crashes into the ground > then call this method in the events tab.

Hope this helps, also Alice come with a pre enstalled flight sim, in tutorials, you might want to take a look at that


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Or
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 408
Join Date: Oct 2013
Location: Northern Virginia
Default Or - 01-11-2015, 09:27 AM

Or... as I said list the objects he wants to collide with, ie. copy the method into a dotogether and set object to house (or something) and a width for the object.


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 01-11-2015, 09:59 AM

That is just an over abundance of code when you can just streamline it with a list variable.


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Yea
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 408
Join Date: Oct 2013
Location: Northern Virginia
Default Yea - 01-11-2015, 12:07 PM

I do realize that and that is what I suggest doing, however he asked for an alternative route, this is the best solution as an easy to understand alternative.


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.