Scrolling Game Development Kit Forum

SGDK Version 2 => Help, Errors, FAQ => Topic started by: Tanja on 2007-11-16, 11:57:27 AM

Title: Copy behaviours from Version 1
Post by: Tanja on 2007-11-16, 11:57:27 AM
i don't know and it's not mentioned at the faq if there is still the possibility, to quickly add a behaviour (f.e. "follow left wall") to a sprite?
if not, can i create a sprite in version 1 and copy the script code into sgdk2?
actually, will there be more tuts for scripting sprites to come?
Title: Re: Copy behaviours from Version 1
Post by: durnurd on 2007-11-16, 12:48:38 PM
There is no built-in way to copy data from Version 1 to version 2 aside from graphics.

The method to create a certain sprite type is to import it from the library.  Right-click on the Sprites folder, click Import, then in the library, navigate to Sprites and find the sprite behavior you want to use.
Title: Re: Copy behaviours from Version 1
Post by: Tanja on 2007-11-16, 01:49:03 PM
um, i can't find a library. did you mean right click on the sprite definitions folder?
Title: Re: Copy behaviours from Version 1
Post by: durnurd on 2007-11-16, 11:25:46 PM
Yes, right-click on the sprite definitions folder, go to import, and it will bring up a wizard.  Click browse, navigate to the folder where SGDK2 is installed (C:\program files\SGDK2 by default) and you should see the Library folder.  Under that, there is a Sprites folder with several .SGDK2 files containing standard sprite definitions.
Title: Re: Copy behaviours from Version 1
Post by: Tanja on 2007-11-17, 06:40:27 AM
woohoo! hey, that's great! i go and work through the sprite scripts... ;D
i don't remember to have listen about that option in the help files.

what is up with these fx/music libs one can download extra? i imported them and looked into the script. do i need to import some of the music which is also provided in my sgdk2 folder? how to use the fx?
Title: Re: Copy behaviours from Version 1
Post by: durnurd on 2007-11-19, 10:02:00 PM
I created a new sprite template and submitted it to http://sgdk2.enigmadream.com.  It's based on LeftRightFlat.  It shoots at a target in the Player sprite group when within a given range.  The sprite stops moving when shooting, and only shoots when facing the target sprite.

Hopefully this should as a reference for creating sprites.  It's also another piece to help me convince BlueMonk to allow default values for sprite parameters other than zero, since if you leave the parameter HorizontalRange at zero, it will never shoot unless you're standing directly on top of it, and if you leave FireDelay at zero, it will create a new shot sprite every single frame. (Good defaults: HorizontalRange==200, FireDelay==50)
Title: Re: Copy behaviours from Version 1
Post by: bluemonkmn on 2007-11-20, 07:21:37 AM
I have approved the new submission (after resetting my password -- I forgot how to log in!).

Another (possibly better) idea for defaults is that you could use 0 as the indicator that the sprite wants to use the default values and have them hard coded into the sprite definition.  Then it would be possible to change the sprite definition and have every instance that is using the default values (zero) be affected.  Just a thought, but I see your point.
Title: Re: Copy behaviours from Version 1
Post by: Tanja on 2007-11-20, 12:19:39 PM
I have approved the new submission .

can i have can i have can i have pleez???
Title: Re: Copy behaviours from Version 1
Post by: durnurd on 2007-11-20, 12:36:04 PM
I have approved the new submission .

can i have can i have can i have pleez???

just go to the website and download it
(http://sgdk2.enigmadream.com ->Project Listings -> Templates -> Sprites -> Shooting, moving sprite)
Title: Re: Copy behaviours from Version 1
Post by: Tanja on 2007-11-20, 12:50:41 PM
oh good, i thought i would need a password, so i didn't try.
i stick to scripting. i have set some goals, i have to reach them. i appreciate the help of both of you very much.
Title: Re: Copy behaviours from Version 1
Post by: Tanja on 2007-11-28, 05:16:25 AM
is it possible to copy a whole bunch of rules and paste it? i know i can export a sprite definition, but than the graphics and tilesets and o lot of unnecessary crap is exported too.
and i would find it very useful, when i could select more than one rule to easily move several rules up and down. (it is very tricky to move a rule with children through some other rules with children, because they interact all)
maybe it can be build into the next fix?
Title: Re: Copy behaviours from Version 1
Post by: bluemonkmn on 2007-11-28, 07:34:35 AM
Look in the "Sprite Definition" menu (if you are on the Sprite Definition screen) or in the "Plan" menu (if you are on the Edit Plan screen).  There are commands "Copy Rules" and "Paste Rules".
Title: Re: Copy behaviours from Version 1
Post by: Tanja on 2007-11-28, 07:44:47 AM
yes, i know, but the question was about several rules at one time ;)
Title: Re: Copy behaviours from Version 1
Post by: bluemonkmn on 2007-11-28, 07:51:41 AM
Yes, these commands can me used to copy several rules at once if you select the right sub-command.
Title: Re: Copy behaviours from Version 1
Post by: Tanja on 2007-11-28, 07:59:36 AM
ok then. can i select several rule at one time? (f.e. with shift or ctrl)
if not, i create an "if" rule above all to be transferred. this rule sucks up the others and i can copy it. easy.
Title: Re: Copy behaviours from Version 1
Post by: bluemonkmn on 2007-11-28, 08:18:28 AM
Only one rule can be selected, so in order to copy multiple rules, you have to either copy all rules, or copy all the children of the current rule.