would this be proper?

Support for version 4.9 and earlier.

would this be proper?

Postby Ruffsta » May 24th, 2011, 6:08 pm

If randomnumbers[0] == 1 // If randomnumbers[0] == 2 // If randomnumbers[0] == 3 && PA_GetSpriteAnimFrame(0,0) == 80

basically what i want it to do is if the the randomnumbers[0] is 1 or 2 or 3 AND in the end if the sprite frame of sprite 0 = 80
Ruffsta
 
Posts: 44
Joined: March 3rd, 2011, 1:29 pm

Re: would this be proper?

Postby YoshiInAVoid » May 24th, 2011, 6:22 pm

Code: Select all
If (randomnumbers[0] == 1 || randomnumbers[0] == 2 || randomnumbers[0] == 3) && PA_GetSpriteAnimFrame(0,0) == 80
YoshiInAVoid
 
Posts: 1960
Joined: December 30th, 2010, 11:53 am
Location: England

Re: would this be proper?

Postby Ruffsta » May 24th, 2011, 6:41 pm

yeah that's what i meant.. used the wrong slashes lol - i would have caught it later

so this would be correct too then right?

If (randomnumbers[0] == 1 || If randomnumbers[0] == 2 || If randomnumbers[0] == 3 || If randomnumbers[0] == 4 || If randomnumbers[0] == 5 || If randomnumbers[0] == 10 || If randomnumbers[0] == 11 || If randomnumbers[0] == 12 || If randomnumbers[0] == 13 || If randomnumbers[0] == 14 || If randomnumbers[0] == 15 || If randomnumbers[0] == 16 || If randomnumbers[0] == 17 || If randomnumbers[0] == 18 || If randomnumbers[0] == 19 || If randomnumbers[0] == 20 || If randomnumbers[0] == 21 || If randomnumbers[0] == 22 || If randomnumbers[0] == 23 || If randomnumbers[0] == 24 || If randomnumbers[0] == 25 || If randomnumbers[0] == 26 || If randomnumbers[0] == 27 || If randomnumbers[0] == 28 || If randomnumbers[0] == 29 || If randomnumbers[0] == 30 || If randomnumbers[0] == 31 || If randomnumbers[0] == 32 || If randomnumbers[0] == 33 || If randomnumbers[0] == 34 || If randomnumbers[0] == 35 || If randomnumbers[0] == 36 || If randomnumbers[0] == 37 || If randomnumbers[0] == 38 || If randomnumbers[0] == 39 || If randomnumbers[0] == 40 || If randomnumbers[0] == 41 || If randomnumbers[0] == 42 || If randomnumbers[0] == 43 || If randomnumbers[0] == 44 || If randomnumbers[0] == 45 || If randomnumbers[0] == 46 || If randomnumbers[0] == 47 || If randomnumbers[0] == 49 || If randomnumbers[0] == 50 || If randomnumbers[0] == 51 || If randomnumbers[0] == 52 || If randomnumbers[0] == 53 || If randomnumbers[0] == 54 || If randomnumbers[0] == 55 || If randomnumbers[0] == 56 || If randomnumbers[0] == 57 || If randomnumbers[0] == 58 || If randomnumbers[0] == 59 || If randomnumbers[0] == 60 || If randomnumbers[0] == 61 || If randomnumbers[0] == 62 || If randomnumbers[0] == 63 || If randomnumbers[0] == 64 || If randomnumbers[0] == 65 || If randomnumbers[0] == 66 || If randomnumbers[0] == 67 || If randomnumbers[0] == 68 || If randomnumbers[0] == 69 || If randomnumbers[0] == 70 || If randomnumbers[0] == 71 || If randomnumbers[0] == 72 || If randomnumbers[0] == 73 || If randomnumbers[0] == 74 || If randomnumbers[0] == 75 || If randomnumbers[0] == 76 || If randomnumbers[0] == 77 || If randomnumbers[0] == 78 || If randomnumbers[0] == 79 || If randomnumbers[0] == 80) && PA_GetSpriteAnimFrame(0,0) == 80



but i get this error...
oi.PNG


entire section code:
If (randomnumbers[0] == 1 || If randomnumbers[0] == 2 || If randomnumbers[0] == 3 || If randomnumbers[0] == 4 || If randomnumbers[0] == 5 || If randomnumbers[0] == 10 || If randomnumbers[0] == 11 || If randomnumbers[0] == 12 || If randomnumbers[0] == 13 || If randomnumbers[0] == 14 || If randomnumbers[0] == 15 || If randomnumbers[0] == 16 || If randomnumbers[0] == 17 || If randomnumbers[0] == 18 || If randomnumbers[0] == 19 || If randomnumbers[0] == 20 || If randomnumbers[0] == 21 || If randomnumbers[0] == 22 || If randomnumbers[0] == 23 || If randomnumbers[0] == 24 || If randomnumbers[0] == 25 || If randomnumbers[0] == 26 || If randomnumbers[0] == 27 || If randomnumbers[0] == 28 || If randomnumbers[0] == 29 || If randomnumbers[0] == 30 || If randomnumbers[0] == 31 || If randomnumbers[0] == 32 || If randomnumbers[0] == 33 || If randomnumbers[0] == 34 || If randomnumbers[0] == 35 || If randomnumbers[0] == 36 || If randomnumbers[0] == 37 || If randomnumbers[0] == 38 || If randomnumbers[0] == 39 || If randomnumbers[0] == 40 || If randomnumbers[0] == 41 || If randomnumbers[0] == 42 || If randomnumbers[0] == 43 || If randomnumbers[0] == 44 || If randomnumbers[0] == 45 || If randomnumbers[0] == 46 || If randomnumbers[0] == 47 || If randomnumbers[0] == 49 || If randomnumbers[0] == 50 || If randomnumbers[0] == 51 || If randomnumbers[0] == 52 || If randomnumbers[0] == 53 || If randomnumbers[0] == 54 || If randomnumbers[0] == 55 || If randomnumbers[0] == 56 || If randomnumbers[0] == 57 || If randomnumbers[0] == 58 || If randomnumbers[0] == 59 || If randomnumbers[0] == 60 || If randomnumbers[0] == 61 || If randomnumbers[0] == 62 || If randomnumbers[0] == 63 || If randomnumbers[0] == 64 || If randomnumbers[0] == 65 || If randomnumbers[0] == 66 || If randomnumbers[0] == 67 || If randomnumbers[0] == 68 || If randomnumbers[0] == 69 || If randomnumbers[0] == 70 || If randomnumbers[0] == 71 || If randomnumbers[0] == 72 || If randomnumbers[0] == 73 || If randomnumbers[0] == 74 || If randomnumbers[0] == 75 || If randomnumbers[0] == 76 || If randomnumbers[0] == 77 || If randomnumbers[0] == 78 || If randomnumbers[0] == 79 || If randomnumbers[0] == 80) && PA_GetSpriteAnimFrame(0,0) == 80
Set Sprite Frame 0;0;160
Set Variable hits;hits + 1
Else If PA_GetSpriteAnimFrame(0,0) == 0
Set Sprite Frame 0;0;240
End If
Ruffsta
 
Posts: 44
Joined: March 3rd, 2011, 1:29 pm

Re: would this be proper?

Postby YoshiInAVoid » May 24th, 2011, 7:20 pm

You are using:

Code: Select all
If SomethingHappens || If SomehtingElseHappens


Whereas it should be:

Code: Select all
If SomethingHappens || SomethingElseHappens


Also your code is very inefficient.
YoshiInAVoid
 
Posts: 1960
Joined: December 30th, 2010, 11:53 am
Location: England

Re: would this be proper?

Postby Ruffsta » May 24th, 2011, 7:39 pm

YoshiInAVoid wrote:Also your code is very inefficient.


not to be rude here.. but for someone that doesn't know exactly what i'm trying to do and as someone who bails out on projects.. you shouldn't be saying stuff like that

i don't know this app as much as you or most people on here simply because of 3 things:
1.) james keeps changing shit and doesn't know how to stick to one thing and completing 1 project before starting a second version of it - he shouldn't have started v5 without completing the main version!

secondly.. unlike most of you i am older, i have much more responsibilities in life such as a wife, 3 kids and a real job - so i don't have as much time to waste on this program as most of you. i'm trying to buy a house and yer all still in school...

and last: this program/ds is definitely limited - it's like coding for the freaking Atari 2600

also, i'd like to point out that teens on here have little to no respect to older people.. i've been coding longer than most of you.. so just because you guys know this app better than me - doesn't mean much! so stop being cocky!
Ruffsta
 
Posts: 44
Joined: March 3rd, 2011, 1:29 pm

Re: would this be proper?

Postby cilein » May 24th, 2011, 8:27 pm

Calm down I don't think he meant it offensively, although there was no point in the comment without explanation or suggestions to fix it so its justified to be irritated by it. Seeing as you are moving through the numbers linearly, a loop would let you do the same check with less to type and worry about.

loop from 1 to 80 (give the variable a name like 'i')
if randomNumbers[0] == i ... and the rest of your code
end loop

this will create a variable called i (with the loop action), and cycle through the statements until the 'end loop' incrementing i by 1 each time until it hits the specified end, in this case 80. So the code will check if randomNumbers[0] == 1 then 2 then 3 and so on till 80. Saves a lot of space in your code, makes errors in typing less likely, easier to read and change the code and number of things to scroll through etc later.
cilein
 
Posts: 302
Joined: December 31st, 2010, 12:10 am
Location: EU

No it's not propper

Postby YoshiInAVoid » May 24th, 2011, 8:59 pm

F*** you, I was trying to help you. I just made that comment implying that it could be better done, as your such a good programmer who has "been coding longer than most of you", I didn't bother explaining in too much depth.

I don't even use DSGM.

As Cilein mentions, yes a loop would be alot more efficent.

As for the bailing out on your crappy plant growing game, yes I'll admit that I did but that's because your a pain to work with, you expect everything done in 2 minutes and never post with Capital letters making your posts very hard and ugly to read.

Please don't bring your age and sociall life into this.

Yuck the Atari. How is the DS anything like that? Twice as many screens, 256 colours, touch screen, handheld, ECT. How would it be the same for programming retro home consoles stuff? I work with the SNES alot and I can tell you now that programming for it and most other retro consoles is completly different. You don't know what your saying.

And lastly as I previously mentioned, I hate DSGM5 and have not used DSGM4 for over a year now. I joined the old forum back in 2008 when version 2 was around. I just helped you as your problem was so simple. If your so good at programming and have "been coding longer than most of you" then why don't you leave DSGM and just program the games normally like me and many other users here who rarely use DSGM exept to view it's actions and stuff?


A flamewar is starting so I'm not going to reply here anymore. I'm sorry if I have offended you. But seriously, I'm not going to bow down to you and respect you as an older person than me. Your just agest, because I'm 12 and not even a teenager yet you can just shut up and stop saying things like:
also, i'd like to point out that teens on here have little to no respect to older people.


I would respect you if you stopped treating me and talking to me this way like "Oh your just some dumb kid stop being cocky" when all I stated was that thier are better ways of accieving what you want.

Heres your exact words:
so stop being cocky!


If you respected me and repled saying:

"Oh thanks for your help YoshiInAVoid, please could you explain a little bit more about how to clean up the code efficiently?"

Then maby I woudn't be saying this, but please I'm done with this topic so just stop complaining at me becasue of my age and how I have not been programming since the days of the Atari.
YoshiInAVoid
 
Posts: 1960
Joined: December 30th, 2010, 11:53 am
Location: England

Re: would this be proper?

Postby Ruffsta » May 24th, 2011, 9:25 pm

lol @ yoshi... learn to spell first of all.. secondly you started this "flamewar" with your comment..

and when anyone decides to help, you explain it fully or don't bother helping REGARDLESS how much the person knows/doesn't know. when you offer to help, then do so fully! not half assed and assume everyone gets it!

and as far as me knowing how much i know as far coding goes.. i will draw circles around you outside of dsgm! and if you don't use dsgm.. why be here at all.. not like you can really help without the actual program!

ps:
F*** you
- come say that to this black belt face to face! i dare you!
Last edited by Ruffsta on May 24th, 2011, 9:40 pm, edited 5 times in total.
Ruffsta
 
Posts: 44
Joined: March 3rd, 2011, 1:29 pm

Re: would this be proper?

Postby Ruffsta » May 24th, 2011, 9:33 pm

Cilein wrote:Calm down I don't think he meant it offensively, although there was no point in the comment without explanation or suggestions to fix it so its justified to be irritated by it.


thank you
Cilein wrote:loop from 1 to 80 (give the variable a name like 'i')
if randomNumbers[0] == i ... and the rest of your code
end loop

this will create a variable called i (with the loop action), and cycle through the statements until the 'end loop' incrementing i by 1 each time until it hits the specified end, in this case 80. So the code will check if randomNumbers[0] == 1 then 2 then 3 and so on till 80. Saves a lot of space in your code, makes errors in typing less likely, easier to read and change the code and number of things to scroll through etc later.


please go on..

it's not like it's:
dim i as integer
for i = 0 to 79
ect..

as i am used to... if james had only done this app strictly in vb - i wouldn't have these issues
Ruffsta
 
Posts: 44
Joined: March 3rd, 2011, 1:29 pm

Re: would this be proper?

Postby James » June 3rd, 2011, 4:10 pm

This program is done strictly and entirely in VB. Both versions, and also Dark Flow.

C is the language for the DS, end. Not my design decision!
James
Site Admin
 
Posts: 810
Joined: December 30th, 2010, 3:23 am
Location: Lancaster University, England

Re: would this be proper?

Postby YoshiInAVoid » June 3rd, 2011, 4:51 pm

Just learn to use both. You can't expect everything to function on 1 language. That counts for both programming in different languages and real life speaking in different languages. Niether one will ever happen.
YoshiInAVoid
 
Posts: 1960
Joined: December 30th, 2010, 11:53 am
Location: England


Return to DSGM 4.9

Who is online

Users browsing this forum: No registered users and 1 guest