Scrolling Game Development Kit Forum
SGDK Version 2 => Help, Errors, FAQ => Topic started by: Tanja on 2007-11-16, 01:57:11 PM
-
wanted to try out "add sprite at plan"-method. added a rule at a plan for it. it works fine, so fine that after a few seconds that error occurs: sprite limit of 100 reached.
i guess i have to say "only add one sprite". couldn't find thet "processSprites"-method or "lastCreatedSprite", if they are necessary at all.
-
To make sure that only 1 sprite gets created, you could use a counter or a sprite parameter. Set the parameter/counter to 1 when you want to create the sprite. Then make the rule check if the parameter is 1. If so, then create the sprite and set the parameter/counter to 0. But then maybe you have the same problem -- how do you set the parameter/counter to 1 only once? To help you more, we'd need to know more about what you are creating the sprite for.
-
one suggestion:
when one suspends a rule, all the appendant under-rules should be also suspended.
is there a chance, to give out some text for debugging purporses? i think of sth. like the debugger of flash. when you run it, a window appears beside your flash movie. in the debugger window you can find all objects currently in the movie, and all variables with their values. this would it eventually make easier to find out if a value is set right or wrong and how they change at runtime.
-
There are the LogDebugLabel and LogDebugValue rules which output a string or number to the upper-left corner of the display. An actual window with information on various maps, sprites, plans, etc. would be very helpful, but I think that's probably going to have to wait until 2.1
-
oh thanks, that's helpful :-)
-
bluemonk, what do you think of changing the function/checkbox "suspend rule" to a "suspend this rule including all children"?
i have a rule composed of about 7 children rules, sth is not working and i spent a lot of time with checking and unchecking the suspend box.
-
That would be confusing when looking at the child rules. What would the state of the box be if some grandparent's checkbox has been checked, and the parent's box has been un-checked? I think it would be better to have separate buttons to automatically check or un-check the box for all children, but leave the existing checkbox as an indicator for only the current rule.
-
i haven't so much scripted at all. but i ask myself whether or not it's usefull only to suspend a parent rule without children. because the parent rule is often(?) a condition, and not suspending the children changes the whole structure.
but, you have to know that. however, a checkbox for "suspend this rule including all children" would be very usefull, i think.
-
It's true that suspending a parent rule without suspending the child rule is an odd and uncommon thing to do. But the way the data is laid out, it's more straightforward in the implementation (and more flexible) to suspend individual rules. I feel that when a program takes too much control away from the user and tries to be too "smart", it will often have the opposite effect and confuse and frustrate many users in other ways. But I do see the value in having a shortcut to suspend a parent rule and all child rules. I think a button (not a checkbox) to suspend or un-suspend all child rules would work well, don't you? The checkbox would exist as an indicator of whether the current rule is suspended (and chould be toggled), but the button could be used to change it and all the child rules.
-
What you should really do is have the tree itself contain the checkboxes so you can easily see what's "commented out"
-
yeh thats a good idea.
-
I think a button (not a checkbox) to suspend or un-suspend all child rules would work well, don't you? The checkbox would exist as an indicator of whether the current rule is suspended (and chould be toggled), but the button could be used to change it and all the child rules.
i totally agree with you *g*
and, perhaps it would do good for the overview, a suspended rule could be shown automatically in grey text. like a "greyed out" checkbox one can't click. or the text would become italic.
(but i don't know what it would look like on a computer with a non-standard color scheme. maybe the user could customize this color at his wish)
-
FollowPath:
i noticed there is no parameter how the sprite shall be aligned at the path.
i am curious, blue monk. all that methods like "isInState, GetNearestSpriteIndex" and so on, did you define them at your own? in order to allow people making games with all important functions already predefined by you?
-
FollowPath:
i noticed there is no parameter how the sprite shall be aligned at the path.
That's because the path is only used to determine the sprite's position, so it doesn't need to allow sprites to have different positions relative to the path. The path can just as easily be defined (or moved) to always indicate the top left corner of the sprite, since it doesn't need to have a particular position for any other purpose. I suppose it might be a handy feature, but certainly not necessary.
i am curious, blue monk. all that methods like "isInState, GetNearestSpriteIndex" and so on, did you define them at your own? in order to allow people making games with all important functions already predefined by you?
I'm not sure I understand the question, but I think the answer is yes. If I hadn't defined them, where would they have come from? (What other answer could there be?) And they can all be customized too (except the operators like "+", "=" and "<") so you can make them behave however you want. Every function that has letters in it is a function defined in the SourceCode folder, which can be customized. There is nothing hard-coded in the IDE for these functions. They come entirely from the source code folder (you could create your own project template with a very different framework and a completely different set of rule functions with different names and parameters, without changing any of the SGDK2 internal source code).
So back to the first question, you could add a parameter to your project's FollowPath function if you want!
-
you understood my question right. :)
-
The path can just as easily be defined (or moved) to always indicate the top left corner of the sprite
but in order to move a whole path around one has to type every x/y in new.
i remember from version 1 there was the possibility to define one path, and then to position several sprites at the map, all moving accordingly to the path at their own place.
to do that with sgdk2, would i have to add/substract pixels from the sprites x/y at every frame?
-
I did not think it would be a common thing to make multiple different sized sprites follow the same path, so I didn't design a solution for it, but you're right -- that would be a good reason for FollowPath to have a RelativePosition parameter. Do you think you could figure out how to add such a parameter to your project's FollowPath function? (That would solve all your problems, right?)
-
i will see when the right time is there.
until now i haven't much thought about enemies and their paths, you know? the main point is defining other things, because it shall be NO fighting game.