damage from enemy and destroying object
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: damage from enemy and destroying object
Hi.
Simon made a point. You may not make (easily) Call of Duty 9, but you can surely make your app. I was merely trying to make you see that certain languages have certain strengths. Many new users, often young, come here and want to make games. Fine and good. Richard Gaskin just posted an excellent exposition on just this sort of thing. See the thread "Re: Livecode vs Other Cross Platform Development Tools" in the intermediate section.
But I am an LC advocate through and through. I say bring it on...
As for your stack locking up, you may have a loop that starts on openCard or someSuch, and that is what appears to be frozen. Have you tried Cmd-Period during that time?
You also can open another stack, and in some manner "edit the script of stack "yourFrozenStack". But know that if there really is something wrong, or a loop is running, then you may be blocked from that option. But if you can get to any part of that stack that is NOT frozen, then try editing scripts( or commenting large sections out). That stack has to either open or in memory for you to do that. Good Luck...
Craig
Simon made a point. You may not make (easily) Call of Duty 9, but you can surely make your app. I was merely trying to make you see that certain languages have certain strengths. Many new users, often young, come here and want to make games. Fine and good. Richard Gaskin just posted an excellent exposition on just this sort of thing. See the thread "Re: Livecode vs Other Cross Platform Development Tools" in the intermediate section.
But I am an LC advocate through and through. I say bring it on...
As for your stack locking up, you may have a loop that starts on openCard or someSuch, and that is what appears to be frozen. Have you tried Cmd-Period during that time?
You also can open another stack, and in some manner "edit the script of stack "yourFrozenStack". But know that if there really is something wrong, or a loop is running, then you may be blocked from that option. But if you can get to any part of that stack that is NOT frozen, then try editing scripts( or commenting large sections out). That stack has to either open or in memory for you to do that. Good Luck...
Craig
Re: damage from enemy and destroying object
Before you open your stack, suppress all messages and errors. That will allow you to find and fix the offending line
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
-
- Posts: 46
- Joined: Sun Feb 14, 2016 9:08 am
Re: damage from enemy and destroying object
I know what you mean. I am not one of those people. lol. Like I said, I wouldn't even know what LC is if it wasn't for this class. Not saying I don't like LiveCode. It just takes some getting used to. But I definitely would not use it to make games.dunbarx wrote:
I was merely trying to make you see that certain languages have certain strengths. Many new users, often young, come here and want to make games.
Re: damage from enemy and destroying object
You're okay, the code is probably in an infinite loop. There is a button on the top toolbar labelled "Messages". Click that so it gets bolded. That stops your scripts from running. Then you can go to that card and fix the script that is hanging things. Remember to click Messages again when you're done so your revised scripts will run.ethanCodes wrote:I completely agree with you guys that this is not the program to use for making this game, however it is an assignment for a class, and the choices of games were limited. Thank you for some of the answers. I will continue to look into these. I have run into a bit of a snag. While experimenting with some bits of code, I seem to have done something that immediately freezes the program when it gets to the card with the problem code. The problem is that I must have accidently saved it after this code was activated, because now every time I open that program, it freezes. Is there any hope to somehow get back to the source code so I can delete that code? Or am I doomed to start over from scratch...
Edit: BTW, I've made several games with LC, just not battle/action games. Mine are more sedate.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: damage from enemy and destroying object
Ethan.
Chek out Jacque's "Blocks" in the sample stacks section. Addictive. I went to a support group to kick the habit.
Craqu
Chek out Jacque's "Blocks" in the sample stacks section. Addictive. I went to a support group to kick the habit.
Craqu
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: damage from enemy and destroying object
I'm impressed that your instructor chose this exercise. I'm collecting info on uses of LiveCode in education, and if your instructor would be interested in helping me identify ways we can improve the LiveCode experience for educators please pass along my email address: richard AT livecode.orgethanCodes wrote:...it is an assignment for a class, and the choices of games were limited.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 46
- Joined: Sun Feb 14, 2016 9:08 am
Re: damage from enemy and destroying object
You are a life saver! Thank you so much man! So, the code that caused this whole catastrophe was "on openCard wait timeStart seconds" where timeStart was a variable holding 180. Why would this cause the program to freeze?jacque wrote:
You're okay, the code is probably in an infinite loop. There is a button on the top toolbar labelled "Messages". Click that so it gets bolded. That stops your scripts from running.
Re: damage from enemy and destroying object
It didn't "freeze", it was just doing what you told it: wait 3 minutes.
You need more patience.
Craig
You need more patience.
Craig
Re: damage from enemy and destroying object
dunbarx wrote:Chek out Jacque's "Blocks" in the sample stacks section. Addictive. I went to a support group to kick the habit.

I'll have to check the version in the sample section, I updated the graphics and images a while back but I don't remember if I uploaded that one. It looks better now.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 46
- Joined: Sun Feb 14, 2016 9:08 am
Re: damage from enemy and destroying object
but why would it not let me stop the code? I put the amount of time in a variable so that I can use a button to change that variable to 0, thus skipping the wait time. But it didn't seem to work.dunbarx wrote:It didn't "freeze", it was just doing what you told it: wait 3 minutes.
You need more patience.
Craig
Re: damage from enemy and destroying object
The "wait" command is blocking, that is, nothing else happens until the wait period finishes. You can add "with messages" to allow other events to occur, but the handler that contains the wait command will still not continue until the waiting period is over.ethanCodes wrote:dunbarx wrote:but why would it not let me stop the code? I put the amount of time in a variable so that I can use a button to change that variable to 0, thus skipping the wait time. But it didn't seem to work.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 46
- Joined: Sun Feb 14, 2016 9:08 am
Re: damage from enemy and destroying object
Oh I see. so I am trying to set a wait time before the enemies start advancing, but I need to be able to set that wait time to 0 and start them immediately if a button is clicked. Right now I have the wait command set at 180 seconds, and the 180 is held in a variable. the start now button has code that says on mouse up put 0 into timeStart, which I believe should change whatever is in timeStart to 0, thus ending the wait period. But it's not working. Any ideas?
Re: damage from enemy and destroying object
If I get what you are saying, you want to get rid of that constant 180. Perhaps, instead, wait until an action is performed. Something like:
Do you see what that last option simulates? Remember that wait is still blocking; this is a way out, that seems to act as if clicking a button kills the block.
Or, as Jacque mentioned, if you allow messages, you can do other things, but this might still hang you up
Better never to wait at all. There are better methods entirely. I would need to know more about your desired sequence to advise you
Craig
Code: Select all
wait until the mouse is down
or
wait until the mouse is down and the mouseLoc is within the rect of button "start"
Or, as Jacque mentioned, if you allow messages, you can do other things, but this might still hang you up
Better never to wait at all. There are better methods entirely. I would need to know more about your desired sequence to advise you
Craig
-
- Posts: 46
- Joined: Sun Feb 14, 2016 9:08 am
Re: damage from enemy and destroying object
each level of the game needs to wait 180 seconds before enemies start to come, but the player also needs to have the option of skipping the wait time. Here is the code I tried to use, but it is giving me an error:
Code: Select all
wait for timeStart seconds or until mouse is down and mouseLoc is within rect of button "Start Now"
Re: damage from enemy and destroying object
Hi,
Exercise left for you: What does the "Stop" button do, what happens here, and how do you use it in your stack? ;-)
Have fun!
Guess "wait for ... or until ..." will not work :) But you could have a look at this card script:ethanCodes wrote:Code: Select all
wait for timeStart seconds or until mouse is down and mouseLoc is within rect of button "Start Now"
Code: Select all
global WaitEnd
on opencard
put Empty into fld "txt_fld"
put the seconds +180 into WaitEnd
WaitInit
end opencard
on WaitInit
if WaitEnd is 0 then
put "ACTION!" into fld "txt_fld"
exit WaitInit
else
if the seconds < WaitEnd then
put WaitEnd - the seconds into fld "txt_fld"
send "WaitInit" to me in 1 second
else
put "ACTION!" into fld "txt_fld"
exit WaitInit
end if
end if
end WaitInit
Have fun!
- Attachments
-
- DEDO.zip
- a little example stack ...
- (789 Bytes) Downloaded 233 times
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!