Scrolling Game Development Kit Forum
SGDK Version 2 => Help, Errors, FAQ => Topic started by: blink3 on 2008-08-19, 10:21:16 AM
-
hey pplz, ok well i set the gravity and everything and react to solid on my player, the solidity and tile category and stuff, so i just want to test how it is so i make a little solid area and place my sprite on top and then i press F5 and i enter and i just fall through it, if you want to see my file i can send it to you, thanks!
-
check your player rules: ReactToSolid must come right before MoveByVelocity.
-
it already is :( and one more thing i come up with an error "Stack Empty" when i try to run my "game"
-
"stack empty" occurs always when you have somewhere an "end"-rule too much. no big thing. happens from time to time. ;)
and move your player a little bit higher on your map.
-
my sprite character is at the highest point it can be on the map, so hopefully theres other options and you know what to do :P!
-
i suppose you have followed the "first steps" help files. maybe you want to read through them another time.
if you have a place to upload your file, maybe i will take a look at it ;D
-
yeah ill try to read the first steps again, i read it a bunch of times already and it hasnt helped but heres the link plz have a look http://rapidshare.com/files/138543475/3rd_Game.sgdk2.html thanks :D i really want to get used to sgdk2
-
well the steps didnt work for me again so... i dunno
-
Make sure:
The tiles you placed are in the Solid category
The sprite you placed has the Solid category selected as its solidity definition (select the sprite and look at its properties window. You may need to scroll down to see the solidity dropdown list).
-
You have way too many rules between ReactToSolid and MoveByVelocity. There should be nothing between these rules, otherwise the velocity calculated by ReactToSolid will be overridden by the other rules. Specifically, you should not have Accelerate and Gravity rules between ReactToSolid and MoveByVelocity. That will override the "reacted velocity" calculated by ReactToSolid. (Your "ReactToSolid" rule is not right before MoveByVelocity as you said earlier.)
-
ok well my sprite seems to react to solids more but it still does NOT land on a tile it just falls down it like stairs
-
okay, this is easy to fix.
#1: move "moveByVelocity" right under "reactToSolid" in both your sprite definitions.
#2: deactivate or delete the two unneccessary rules "End if" and "End climbing" in your Chocobo 1. They are not needed because you have already set a checkmark at "End" at the rule before. you can deactivate with the button right beside the two arrows.
#3: your chocobo on the map has no solidity set. select it (at the layer editor) and look down where a lot of parameters are. there is one called Solidity, click into the empty field beside it and select "Standard".
#4: you need one rule that allows you to control the player with the keyboard. Select the folder "plans" of your layer. create a new plan and in it a new rule. choose "MapPlayerToInputs", set PlayerNumber = 1 and Target = m_ParentLayer.m_Player
#5: look at the moving rules of Chocobo 1. There is "Player.State.Right" instead of "Chocobo1.State.Walk_Right_". This happened because you first defined the rules, and then renamed the sprite and the states. This rules have to be changed then again. change the other moving rules too.
that is supposed to be all by now. the game is running here.
-
thanks all of you this is a great community, man i love ya, time to work on the map now so it can look good
-
OMG! i made the game work thanks to you guys, i saved and exited, then i opened it up again later when i wanted to make more stuff and its back to "falling down the stairs" when i load the game, everything is still changed to how it should be running besides the sprite's solidity and when i change that i load the game and my character bursts into the air and stays there, so Tanja could you post your fixed version of my game? ty i kinda feel really stupid cuz im pretty sure this should be easy to fix
-
i don
-
i dont really understand it either, but thanks anyways
-
do you mind if i ask 1 more thing? ok well how do you make it so you die if say Example -> ____ ____ say there is 2 pieces of land and a gap between them, how would you make it so that when they fall through they would Die like in | | Super Mario? Also, nvm i ask you too much questions
| |
-
you could make an extra tile, perhaps a transparent one, that you put into the gaps. this tile would be in a tile category named "deathly" or so, and then you could make rules that ask if the player touches the category.
-
so would i make the death gap "tile category : touchable" or would i make it a sprite? if it was a tile category would i have to edit the rules in the map?
-
they need their own category, that would be the simpliest. the sprite needs a rule "touchTiles".
-
im sorry but i dont understand "they need their own category and needs a sprite rule?
-
i believe this must be described somewhere in a tut.
you can make a tile category for the deadly tile which is at the bottom of the gaps. your player needs a rule (do TouchTiles). this checks wether the player touches the deadly tiles. of course you need some more rules to tell what shall happen than.
perhaps you should look at sample game. the players use touchTiles to collect the fruits.
you could of course achieve the same with a sprite, this would also be used to make enemies .
-
yeah, do u know a rule to restart level? cuz i've been looking and couldnt find one
-
this is a very tricky thing (to me). maybe some more experienced coder could help here. i would be very glad if a good, clean restart-option would be available in sgdk2 some time.
-
yeah i sent a PM to blue hopefully he'll get it and pm me!
-
i believe he reads your posts here already. and from a public answer more people would benefit.
-
ok, well i hope he does that then :P
-
don't you just use a changemap rule, and then switch to the map your already on? i thought that would reset it.
-
oh maybe ill try that
-
ok i set the transparent tile into Tile Category: Touchable,
In the PLayer rules it looks like:
Rule1 - IF IsOnTile
TileCategoryName.Touchable
RelativePosition.CenterMiddle
Rule 2- DO SwitchtoMap
typeof(Pococo_Map)
false
is that good? also when i set my gap my sprite doesnt fall into the gap if it looks like this ___ ___ The sprite will just move over it like it was a
| | Solid.
-
If the gap is close to the same width as the sprite, the sprite will likely just glide right over the hole. If you make the hole larger, the sprite is more likely to fall into it.
-
ok and about the restart level transparent tile is that a good rule cuz its not working
-
I really don't understand what your last post was meant to say. Can you state it more clearly?
-
in the recently stated rule would you think that it is a rule that would be able to work? If it should work its weird cuz mine doesn't
-
I thought resetting a level would be relatively easy.
- At the beginning of the level, execute a rule to save the state of the maps
IncludeInSaveUnit - SaveUnitInclusion.AllMaps
SaveGame - Slot = 1, InMemory = true
- When the player dies, load the saved state
LoadGame - Slot = 1, InMemory = true
-
OMG! i made the game work thanks to you guys, i saved and exited, then i opened it up again later when i wanted to make more stuff and its back to "falling down the stairs" when i load the game, everything is still changed to how it should be running besides the sprite's solidity and when i change that i load the game and my character bursts into the air and stays there, so Tanja could you post your fixed version of my game? ty i kinda feel really stupid cuz im pretty sure this should be easy to fix
I suspect that you fixed some things, saved the project, then fixed some more and ran the project, but didn't save it. So the compiled project worked, but after you exited and loaded the project again, some changes were lost. I don't know how else to explain it.
-
blue how do i make the player "die" do you mean when he touches the "touchable" transparent tile?
-
Yes, that would be to make the player "die" when touching a deadly tile.
-
Blue I cant get it to work,
The Transparent Tile is set in my Deadly Category,
Its On My map between a gap
I'm able to fall into the gap and what i expected to happen ( teleport back to the beginning of the map) didnt, i fell through the gap and my sprite just sat there at the bottom of the map.
Now Im going to show you my Sprite Rules
Do - IncludeInSaveUnit - SaveUnitInclusion.AllMaps
Do - SaveGame - Slot = 1, InMemory = true
Do - TouchTiles - Category = TileCategoryName.Deadly
Do - LoadGame -Slot = 1, InMemory = True
Is there a tutorial on this? I know your busy so im sorry for asking you for so much.
-
You shouldn't save the map when you fall through the gap, only load it. If you save it when you fall through the gap, then loading it will, of course, put you right back in the gap. Save should be done once when the game/map starts, then load to reset to that state when the player dies. Also, you need to use an "if" rule to test whether one of the tiles that the player touched was deadly. "Do" will always just do the action no matter what.
I don't think there's a tutorial for this yet, but you can look at the sample project and try to understand how its rules are working. It doesn't demonstrate loading the game, but it does demonstrate using "If" rules and TouchTiles.
-
i dont understand, my save game rules are up at the top just under move by velocity and my load game rules are 6 rules down so how is it saving when i fall through the gap?
-
because all your asking the computer to do is
Do - IncludeInSaveUnit - SaveUnitInclusion.AllMaps
Do - SaveGame - Slot = 1, InMemory = true
Do - TouchTiles - Category = TileCategoryName.Deadly
Do - LoadGame -Slot = 1, InMemory = True
As bluemonkmn explained, when something is set as "do" the computer just does it, no questions asked. so telling the computer what to save by the look of the first rule, then its saving, then its declaring the touchtiles "deadly" category, then its gonna load. Before load, you have to put a rule, IF sprite is touching tile in category deadly, then load. (Otherwise when u start the map it will just save load save load save load save load before u can even play the game!) it has to be IF, because IF asks the computer if something is happening or not, and will only continue if it's true.
-
The rules that you define on the sprite rules tab are rules that execute every time a sprite of that type is drawn. So every time the player is drawn (60 times per second) it's going to save and load the game unless you have some condition that limits when to perform these actions (like a counter), and then (for example) only perform it when the counter is a specific value, and then change the counter to something different so it doesn't happen again.
-
since im gonna try to learn as much as i can from this thread, how exactly do counters work in sprite rules.
-
one thing i can recommend to you, start to read the help files from start to finish and then again. no joke, you can learn so much there. for example the counters. you can read how counters work, what they do and how all the functions are named and what they are for. the help will you provide much faster with information than this forum can.