Scrolling Game Development Kit Forum

SGDK Version 1 => Script => Topic started by: v6v on 2008-01-05, 12:21:27 PM

Title: Two Player Script
Post by: v6v on 2008-01-05, 12:21:27 PM
Can Someone send me a two player script? I Don't have any knowledge in scripting so please send it as easy as it can get?
Title: Re: Two Player Script
Post by: Jam0864 on 2008-01-05, 06:43:18 PM
You may wanna try SGDK2, which has inbuilt support for up to 4 players.
If you wanna stick with the original SGDK, then I can say there was definantly a script for two people somewhere, try the little search button up there. :p
Title: Re: Two Player Script
Post by: bluemonkmn on 2008-01-06, 07:24:06 AM
Go to http://gamedevprj.sourceforge.net/files/ (http://gamedevprj.sourceforge.net/files/) and look at GD2Player.zip.
Title: Re: Two Player Script
Post by: v6v on 2008-01-11, 07:47:38 PM
Yeah...... The SGDK2.... Um... Doesn't fit for me as well as the  SGDK 1.4.6 because of terms like:
"If" and "Is input pressed" and all of the trouble for making Inertia and Gravity. I'm retro like that.
Title: Re: Two Player Script
Post by: bluemonkmn on 2008-01-12, 05:05:54 PM
You don't have to deal with any of that if you just use a sprite from a template.  The rules are already set up for you.
Title: Re: Two Player Script
Post by: v6v on 2008-01-12, 09:06:09 PM
Yeah, I know all of the motions on a simple motion engine template... I learned how to tweek inventory items and fuctions on 1.4.6 to get special moves like double jumps on 1.4.6 without any script, so is there a way to tweek the template in SGDK2 to get such marvels? ( attacks and jumping animations )
Title: Re: Two Player Script
Post by: Jam0864 on 2008-01-12, 09:18:38 PM
yes running and jumping animations are quite possible in SGDK2.
http://gamedev.comdel.net/index.php?topic=1139.msg6098#new
you can us that if u want, but it's not finished.
there's also more here. http://sgdk2.enigmadream.com/index.php
Title: Re: Two Player Script
Post by: bluemonkmn on 2008-01-13, 09:45:09 AM
I think it would actually be easier in SGDK2 because you have much better control over how the sprite behaves (and you can embed it into the sprite rules instead of having special functions to support it on every map).  To achieve these things in version 2, you simply insert a rule into the sprite rules that checks what the sprite is doing and switches it to another state (or whatever customization you want).  I don't know how you could manage to make a sprite double-jump in version 1 without scripting.  If you're clever enough to figure that out, you should certainly be clever enough to alter the SGDK2 sprite templates (or create your own).  (How did you implement a double-jump without scripting?  Check for initial keypress of up arrow and switch to a sprite that follows a vector to alter the velocity?  How did you change the velocity?)
Title: Re: Two Player Script
Post by: v6v on 2008-01-13, 05:15:07 PM
Well, I first make four different functions- addinv, subinv, addstamina, and normal state. I then make two sprites- one player sprite- and a double jump sprite (both left/right) and the double jump sprite has a gravity of -10 with "up requires solid checked" the functions are-addinv but the item isn't removed after use. it gives uses an inv item called Stamina+1 with 1 max and 1 int(NOT GLOBAL). I also have a function called sub inv that is simular but subtracts Stamina+1. When the limit is reached of subinv, the function normal state is activated- which switches the player back to the primary state.(New inst, Del old Spr., and Sm loc. as old) Add stamina is global- not inital touch- and uses Stamina +1 but doesn't remove it. It gives you 1 stamina- and if the limit is hit it activates sub inv and resets to its opposite limit. After all of that is done, make a new inv item called doublejump(max2int2) and a new function called jump. It is global, but uses your jump key initial press to add the item called doublejump. Make a function that switches you to your doublejumpsprite but isn't global. And finally make a function that uses 2 doublejump items (remove after use) and your jump key initial press and is global that activates a series of functions... doublejump and then addinv. Then you're done!!!! It looks very long but really isnt. If you want a template for this  I can send it to you as a GDP.


                   It looks like I have outsmarted the creator of SGDK!!! HA HA HA!!!!!!!

                                ( I have an IQ of 210: no lie!)
Title: Re: Two Player Script
Post by: Jam0864 on 2008-01-13, 08:00:48 PM
then try SGDK2... it is actually loads better, just a tad harder to get used to.

Quote
It looks like I have outsmarted the creator of SGDK!!! HA HA HA!!!!!!!
ya, that is actually considered retarded, please don't do that again.
Title: Re: Two Player Script
Post by: Tanja on 2008-01-14, 03:27:37 AM
that is without script? kudos...
(i don't catch the whole thing)
Title: Re: Two Player Script
Post by: v6v on 2008-01-14, 07:07:37 AM
It's really just a mix of the attackIDK and the double keystoke IDK :ugly:


( Oh and I'm not smarter than the creator; if I was I wouldn't be here... :nerd:)
Title: Re: Two Player Script
Post by: bluemonkmn on 2008-01-14, 07:38:17 AM
Wow, what a clever scheme.

                   It looks like I have outsmarted the creator of SGDK!!! HA HA HA!!!!!!!
                                ( I have an IQ of 210: no lie!)
Indeed... that's what's so cool about working on these kits: when people use them in ways that I never could have imagined!  And just think... if you can come up with a scheme this clever in version 1 where I couldn't imagine how you could make a double-jump, what could you do in SGDK2, where double-jump would be pretty straightforward, but what amazing things could you do with a crazy scheme there!?  :surprise:

It'd be awesome to have you around working on games with us long into the future and see what else you come up with.  I bet many could benefit from the templates you would create and share.  I hope you stick around!  We like smart people here... or at least I do :).  Putting up with an occasional smarta** comment is a small price to pay for having a genious around ;).

Honestly, I think someone who can think as broadly/creatively as yourself (as demonstrated by this scheme and probably that test result) could contribute some amazing things to SGDK2, and help make it popular by helping other people see what power is hiding in there (that maybe even I can't see).
Title: Re: Two Player Script
Post by: v6v on 2008-01-14, 04:30:15 PM
Thanks- So do you still want me to send you a gdp for double jumping? Oh and another thing, that
thing you said: double jumping is straight forward in version 2, how do you do that? Maybe I can tweek that too.  :whistle:
Title: Re: Two Player Script
Post by: v6v on 2008-01-14, 04:44:12 PM
[Putting up with an occasional smarta** comment is a small price to pay for having a genious around ;).
Oh... I'll try to limit the smarta**  coments and keep them to myself. honesly, I know absolutely NOTHING on programming. Every script in my games were generated by the wizard!
                  'HostObj_sub (That probably means hosting a party with a sub sandwitch)
I never learned
Title: Re: Two Player Script
Post by: bluemonkmn on 2008-01-14, 05:40:02 PM
Thanks- So do you still want me to send you a gdp for double jumping?
No thanks... I'm not particularly interested in getting too deep into version 1 at the moment (although someone is in the process of trying to submit to me a version 1 game that is hundreds of MB in size... if the quality measures up to the size, that'd be worth stepping back to version 1 for a bit).  Just hearing your description of the double jump cleverness was interesting, though.

Oh and another thing, that thing you said: double jumping is straight forward in version 2, how do you do that? Maybe I can tweek that too.  :whistle:
In version 2, you could add a sprite parameter called "DoubleJumped" which gets set to zero whenever the sprite is standing on solid ground (there's a rule to check when the sprite is standing on solid ground).  Then you could also add a rule that checks if:
1) The player/sprite is pressing up (initial press only)
2) AND The sprite is moving down (dy>0)
3) AND DoubleJumped=0
Then the rule inside that check could set DoubleJumped to 1 and change the sprite's y velocity (dy) to negative 6 or whatever the jump velocity is.

It's still a few steps, but it's all within the sprite rules, and not spread out through counters and special functions and such... and it's a easier to understand, I think.  It also scales up to working with multiple players easily (automatically) because the sprite parameter automatically exists for each instance of the sprite.

Oh, and don't worry about your "smart" comments; I didn't take them too seriously, so don't take my reply too seriously.  As you can see I even agreed with them. :)  (I don't get offended too easily.)
Title: Re: Two Player Script
Post by: v6v on 2008-01-15, 06:28:50 AM
Oh yeah... sorry about the huge game/ the smallest I can get it to is really 470 MB But If you want a demo for the Sequel (WHICH HAS DOUBLE JUMPING!!!) That's much smaller/52.3 MB/ that'll work?


                       Simple Math equation: 470>52.3
Title: Re: Two Player Script
Post by: bluemonkmn on 2008-01-15, 07:08:47 AM
You can still send the original.  I want to see what makes such a big game :).  Are you still unable to FTP?  What FTP program are you using?  Did you try the simple command line FTP that comes with Windows and verify that you're seeing the same text I showed you?