PDA

View Full Version : help on homework assignment


tacpdaddy
03-21-2015, 10:07 PM
Hello,

I decided to get back into programming through online courses since I'm nearing retirement from the military.

I'm a little stumped on how to finish my homework assignment. I'm no expert with ALICE, but I feel like I have a decent handle on things.

I've created the environment per the instructions, and multiple methods. My sailboat is supposed to pick up all of the object when it's within 3m (which it does), but I'm having issues with the ending..

I've spent about three hours troubleshooting and I can't figure it out... What am I doing wrong in order to have the 3D text show correctly AND only when all 7 objects have been collected?

-thanks in advance!

MrMoke
03-22-2015, 03:07 PM
Didn't look at the project, but:
One way is to setup the 3D Text object, load the characters, place it in somewhere in front of the camera.

Lastly, set it's vehicle to the Camera, and set it's opacity to 0%

Whenever you need it, reset the opacity to 100%

And, yes, It's a good field to enter.

Funnybone
03-22-2015, 04:58 PM
I'd go with what MrMoke said.

And you're in the military?!

tacpdaddy
03-22-2015, 05:24 PM
Yeah, I'm active duty Air Force.

I'm playing with calling the 3dtext/changing it's opacity. That's simple enough to do, thanks.

I'm now stuck on how to add each object to the picked up object list once it's been picked up so that the text opacity will be called once I have all the objects from the initial object list.

Edit, I found a lame way of doing it.. By saying If object 7 is within 1m of an object, set opacity of 3dtext. It works, but it's not ideal if the user picks up the 7th object prior to the previous 6.

Funnybone
03-22-2015, 06:22 PM
Edit your post...





starting now. The A word is not allowed here.

RavenOfCode
03-22-2015, 06:29 PM
Dude the Air Force is awesome, Im trying to get into the Air Force academny... :) They have a great computer science school...

RavenOfCode
03-22-2015, 06:31 PM
Edit your post...





starting now. The A word is not allowed here.

And you say others are rude to you? Can you please stop just spamming every post with stupid comments, its really annoying and immature...

fourbros
03-22-2015, 06:37 PM
And you say others are rude to you? Can you please stop just spamming every post with stupid comments, its really annoying and immature...

Yes, I second this.

And pertaining to this post, you could make a variable that raises by one each time that you pick up an object. Once you get to the seventh object, then you do what you did with the opacity. Sounds like an ambitious project though.

Funnybone
03-22-2015, 07:09 PM
I was trying to point out to him that swearing isn't allowed here. Just helping. Jeez, next time you can do it.

Funnybone
03-22-2015, 07:13 PM
Yeah, I'm active duty Air Force.

I'm playing with calling the 3dtext/changing it's opacity. That's simple enough to do, thanks.

I'm now stuck on how to add each object to the picked up object list once it's been picked up so that the text opacity will be called once I have all the objects from the initial object list.

Edit, I found a lame way of doing it.. By saying If object 7 is within 1m of an object, set opacity of 3dtext. It works, but it's not ideal if the user picks up the 7th object prior to the previous 6.

I remember there being 2 ways of doing it. Turns out the newer version of Alice 2.0 no longer lets you build custom characters, nor does it let you use 2 ways of doing said option (what tacpdaddy said)

tacpdaddy
03-22-2015, 07:38 PM
Thanks. I'll try working a variable option and have it call the text when it reaches 7. I'll just submit it as is if I can't resolve the issue in an hour or so. I've spent way too much time trying to figure it out :/

RavenOfCode
03-23-2015, 06:13 AM
I was trying to point out to him that swearing isn't allowed here. Just helping. Jeez, next time you can do it.

I didnt see anything in his post, so i thought you were referencing the Air Force...
My mistake...

MrMoke
03-23-2015, 11:42 AM
1) Assume that you know the length of the list of objects to be picked up.
2) Create a numeric variable set to 0
3) Increment the variable every time you pick up an object.

And then you...

Kudos to you from a Wounded Warrior

chickentree
03-23-2015, 02:45 PM
Hello,

I decided to get back into programming through online courses since I'm nearing retirement from the military.

I'm a little stumped on how to finish my homework assignment. I'm no expert with ALICE, but I feel like I have a decent handle on things.

I've created the environment per the instructions, and multiple methods. My sailboat is supposed to pick up all of the object when it's within 3m (which it does), but I'm having issues with the ending..

I've spent about three hours troubleshooting and I can't figure it out... What am I doing wrong in order to have the 3D text show correctly AND only when all 7 objects have been collected?

-thanks in advance!

The first problem with your approach is that the pickedUpBuoys list is a list of numbers not objects. The second is the "contains" function looks to see if any item in pickedUpBuoys matches the whole list allBuoys.
There are a couple of ways around this. One is to take each buoy off the allBuoys list and put it on the pickedUpBuoys list and continue doing this until the allBuoys list is empty.
An easier way might be to get the length of the allBuoys list at the beginning of the movie and use a for loop to count from that value down to 0 at which point all the buoys are picked up.

By the way the second If statement in world.pickUpBuoy copies the whole list of buoys into the pickedUpBuoys list. This means that when the first buoy is found the pickedUpBuoy list goes from empty to containing all the buoys.

One last thing, if you Right Click on the pickedUpBuoys list and select "watch this variable" you can see what is happening when you run the movie.

Hope this helps,
Mark

tacpdaddy
03-24-2015, 07:14 PM
You guys are awesome, thanks!

MrMoke,

That helped a lot. I was not thinking in that direction (literally). I kept trying to add to 7. My final version was a lot better than what I posted, but it was still just a work-around.

--

Mark,

I went back to modify my methods after this post (even though I submitted my "jerry-rigged" work-around), and it helped a lot, thank you!

I see my error of not making my list objects.. Can't believe I missed that.

My biggest issue was (and still is) how to move an object from one list to another once it has been picked up. I feel that if I was able to accomplish this, I would have resolved my previous omissions.

I played around with a few ideas, and I did 'watch' the variable. The problem I had was that once one object was picked up, it just kept getting picked up as a number, not an object. I'm still learning, but thank you again for providing insight. I don't yet have the ability to think outside the box, but I plan on kicking the walls down :D

I spent so much time attempting to resolve the issue that I submitted my pathetic assignment 'as is' so I could spend some of the weekend with my family.

chickentree
03-25-2015, 03:31 AM
create an object variable
Set its value to the item you want to move.
Delete the item from the list.
Add the variable you saved to the other list.

It's still better to use the length of the list in most cases.

Always remember: The darn thing does exactly what I tell it to.

Mark