Brand New! Need a hand

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

mlam91
Posts: 8
Joined: Mon Feb 29, 2016 4:08 am

Brand New! Need a hand

Post by mlam91 » Thu Mar 03, 2016 2:34 am

Hey guys and gals,

Brand spanking new at Live Code, and most languages in general. So, i'm a fish out of water so to speak.
Currently taking a class, and my assignment is to make a game, "fun." The game is, "guess my number," (how the hell you make a game like this fun is beyond me, but whatever.)

Anyway, my plan is to make a solid color background, and have a spider on it (more like a little spec with legs.) and if you poke the spider, it squashes but the double amount appears, and maybe even a timer and score. Not sure if i wanna get that crazy because something tells me I barely will be able to get through the solid background color. :lol: :oops:

But, let me show you what i'm given, and maybe you guys can help me out? I want to take app making seriously, so it's imperative that any uncommon terminology be explained (please?), because honestly i don't know the first thing here.


on mouseUp
put the text of fld "fld_guess" into theGuess

set the randomSeed to the long seconds
put random(100) into theAnswer
if theGuess is theAnswer then
answer "Correct"
else
answer "Wrong! The correct answer was " & theAnswer & "."
end if
put empty into fld "fld_guess"
end mouseUp


in addition, how serious can someone get with live code? is live code the alice of app making? I don't exactly know what i'm working with here or how powerful or not powerful of a tool that's at my fingertips. What's the next step after I get this down (software wise) if this isn't the goto app for app making?

Thanks for all of your patience guys and gals.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10319
Joined: Wed May 06, 2009 2:28 pm

Re: Brand New! Need a hand

Post by dunbarx » Thu Mar 03, 2016 3:09 am

Oh boy.

Hi.

Check out what seems to be inquiries from some others of your classmates:
http://forums.livecode.com/viewtopic.php?f=7&t=26623
http://forums.livecode.com/viewtopic.php?f=7&t=26623

Read through those threads, first for some insight into LiveCode and the community here, and second for what that they are up to.

As for your other questions, LC is possibly the best thing that ever happened to you, but only if you like to build things in software. There are a number of discussion on just this subject. Glance throughhttp://forums.livecode.com/viewtopic.php?f=8&t=26639

And after you do all that, get going with your game. Write back with stuff you need done.

Craig Newman

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10048
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Brand New! Need a hand

Post by FourthWorld » Thu Mar 03, 2016 3:21 am

First, it's usually better to not set the randomSeed. That property is provided in the language for very specialized uses, and if you want better randomness it's usually best to avoid changing the randomSeed.

What problem did you have with that code?

And by Alice, do you mean the Java-based system from Carnegie Mellon?

LiveCode is very powerful, but also forgiving. It lets you get started easily, the once you're addicted you'll discover ever more things it's really good at, and before you know it you won't be able to put it down. :)

As for tech lingo, this video should help make LiveCode seem much clearer:
https://www.youtube.com/watch?v=Ac7G7xOG2Ag
Just remember to never reset the cardinal grammeters and you'll do fine.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

mlam91
Posts: 8
Joined: Mon Feb 29, 2016 4:08 am

Re: Brand New! Need a hand

Post by mlam91 » Thu Mar 03, 2016 5:32 am

Guys, thank-you, and thank-you.
I will go through the specified links and get back to you. :)

mlam91
Posts: 8
Joined: Mon Feb 29, 2016 4:08 am

Re: Brand New! Need a hand

Post by mlam91 » Thu Mar 03, 2016 5:45 am

Okay, so i went through the posting in regard to what Live code is capable of doing. Just so i understand, an individual seemed to challenge the application, and users have shown success with the app's features and coding? The apps that were displayed in the forum, for example, "zcafe," was a product of Live-code? If that's true, thats amazing! Some clarity, if you may.

mlam91
Posts: 8
Joined: Mon Feb 29, 2016 4:08 am

Re: Brand New! Need a hand

Post by mlam91 » Thu Mar 03, 2016 6:06 am

In response to my classmates, that was last assignment. This assignment, we're provided with a "fully-functional" coded guessing-game. The idea here is to add an "element of fun," which in this case was what I proposed above, HOWEVER. after watching a couple of videos and reading into a couple tutorials, i think i'll just make this "fun" by adding a bit of visuals. i.e: backgrund, and play around with the settings of the buttons, fonts, and so forth. So, after doing that, I find myself with a ff7 background, and an altered button (i know, nothing impressive but I'm just starting out! 8) ) Anywho, I wanted to add a background music upon opening the app, but i'm not sure what I'm doing wrong, so let me walk you through what i did exactly.

1. I went to file>Import as Control>Audio File> then i located the file, and loaded it.
I could be wrong here, but my thoughts are that this loads it directly into the application itself? I don't know if that's right, or wrong.
2. With nothing selected, i went to Object>Card Script, and the default code that came with the "functional app," was

on openCard
put empty int fld "fld_guess"
end openCard

So I googled how to put music in and they give me the "play" command, so I typed the play command into line 3 of the code, with the file name in it, and it looks like:

on openCard
put empty int fld "fld_guess"
play "ff7.mp3" looping
end openCard

Doubtfully so, I don't believe the app will ever be opened so there probably isn't a need to loop, but i had added it anyway.

3. I saved the file, closed the file, then opened up the stack hoping to hear it. Nothing! So, is it possible to do this? or isn't it? Would i need an event to occur first, like clicking on an object or something?

Thanks a bunch guys for your patience, and glad to be apart of the community. Referring to a prior post, if possible to create commercial apps, then count me in! Ultimately, id like to utilize this app to contract to small organizations in my local area (I read that game development not so much) but from what I've seen, looks amazing!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Brand New! Need a hand

Post by Simon » Thu Mar 03, 2016 7:39 am

Hi mlam91,
Sorry but I'm going to have to say you are trying to cheat on learning.

Code: Select all

play "ff7.mp3" looping
You have not provided a path to the file. A default folder?
Did you look "play" up in the dictionary? Use the dictionary! It's your best friend in finding out how to use commands.

Go through these;
http://www.hyperactivesw.com/revscriptc ... ences.html

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Brand New! Need a hand

Post by Klaus » Thu Mar 03, 2016 1:16 pm

Hi mlam91,
mlam91 wrote:1. I went to file>Import as Control>Audio File> then i located the file, and loaded it.
I could be wrong here, but my thoughts are that this loads it directly into the application itself? I don't know if that's right, or wrong.
imported sounds and videos do not have any visual representation in the stack itself, but they are part of it.
Unfortunatley LC only support a very small number of formats for imported sounds like uncompressed AIFF and WAVE files and the compressed AU format.

For everything else you need to use external fiules and set up a player object, set its filename ans start/stop that beast.

Code: Select all

on openCard
   put empty int fld "fld_guess"
end openCard
Since LC is VERY english like, this has of course to be:
...
put empty INTO fld "xyz"
...
Do yourself a favour and check the stacks from the scripting conferences in the link Simon supplied in his last post!


Best

Klaus

mlam91
Posts: 8
Joined: Mon Feb 29, 2016 4:08 am

Re: Brand New! Need a hand

Post by mlam91 » Fri Mar 04, 2016 2:44 am

Hey Simon,

Alright, and I'm not exactly sure what you mean by trying to cheat into learning? What I've learned is to ask questions, and I've been researching as well, unfortunately not the correct way it seems. Perhaps I'm not researching how you did, and I apologize if it seems I'm trying to pull a fast-one. Sorry guys! I'll look into whatever links you give me. Navigating through the tutorials I found to be a little difficult, and I saw a couple of resources from other websites, but having people to talk to who are familiar with it makes things a heck of a lot easier.

Klaus,

Thanks sir, now my question is, I did see that I was required to put a path where the file is actually located, but here's my pushback: how does that fair when another individual were to open my stack? Obviously that path in his directory is not the same, and will not have the same file I have, so does it play? I hope i'm not confusing anyone. Thanks, and i'll be sure to check out the links you've provided.

mlam91
Posts: 8
Joined: Mon Feb 29, 2016 4:08 am

Re: Brand New! Need a hand

Post by mlam91 » Fri Mar 04, 2016 2:49 am

Klaus wrote:Hi mlam91,
mlam91 wrote:1. I went to file>Import as Control>Audio File> then i located the file, and loaded it.
I could be wrong here, but my thoughts are that this loads it directly into the application itself? I don't know if that's right, or wrong.
imported sounds and videos do not have any visual representation in the stack itself, but they are part of it.
Unfortunatley LC only support a very small number of formats for imported sounds like uncompressed AIFF and WAVE files and the compressed AU format.

For everything else you need to use external fiules and set up a player object, set its filename ans start/stop that beast.

Code: Select all

on openCard
   put empty int fld "fld_guess"
end openCard
Since LC is VERY english like, this has of course to be:
...
put empty INTO fld "xyz"
...
Do yourself a favour and check the stacks from the scripting conferences in the link Simon supplied in his last post!


Best

Klaus
Appreciate it and will do. As far as, "int" goes, honestly, my professor pre-assembled this, or it was provided to us in the curriculum that way. :lol: However, I will change it and make note of it.

mlam91
Posts: 8
Joined: Mon Feb 29, 2016 4:08 am

Re: Brand New! Need a hand

Post by mlam91 » Fri Mar 04, 2016 2:54 am

Also, where's this dictionary you speak of? :\

Edit: Just Kidding! I Found it on the main start-up menu for it. :roll:
Last edited by mlam91 on Fri Mar 04, 2016 3:25 am, edited 1 time in total.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Brand New! Need a hand

Post by Simon » Fri Mar 04, 2016 2:58 am

Hi mlam91,
The dictionary is in the main menu bar on the right.
It's the main Go To resource for understanding how to assemble code.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Brand New! Need a hand

Post by Simon » Fri Mar 04, 2016 3:02 am

how does that fair when another individual were to open my stack?
You'll have to ship any media files with your app. Add then using the Copy Files Tab in the standalone setting then they can be found in specialFolderPath("resources")

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

mlam91
Posts: 8
Joined: Mon Feb 29, 2016 4:08 am

Re: Brand New! Need a hand

Post by mlam91 » Fri Mar 04, 2016 3:27 am

Simon wrote:Hi mlam91,
The dictionary is in the main menu bar on the right.
It's the main Go To resource for understanding how to assemble code.

Simon
I appreciate it sir.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Brand New! Need a hand

Post by Klaus » Fri Mar 04, 2016 12:00 pm

Hi mlam91,
mlam91 wrote:...
As far as, "int" goes, honestly, my professor pre-assembled this, or it was provided to us in the curriculum that way.
...
don't take everything your professor or curriculum tells you for granted! 8)


Best

Klaus

Post Reply