Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Wyzemann

Pages: [1] 2
1
Help, Errors, FAQ / Error Reporting
« on: 2011-03-31, 09:28:06 AM »
The error reporting seems to be working fine. If I run into any failures of the error reporting I'll let you know. In this case it directed me to the source code since I have made it a function.


2
I discovered that the PixelX and PixelY properties return an integer. Using this will fix the aforementioned problem.

this.SelectLastCreatedSprite();
               // SetLSWRelativePosition
               this.SetTargetParameter("y", (PixelY + 23));
               this.SetTargetParameter("x", (PixelX - 23));

3
Help, Errors, FAQ / Re: Precise positioning of bullet sprite
« on: 2011-03-30, 08:41:41 AM »
The first solution will not fully solve the problem because I am testing it against reacting to solid tiles. However this gives me ideas once I have other sprites on the board.

The second solution is not working. I keep getting the error "cannot convert double to int" whenever the variable y is used.

here's the code:

this.SetTargetParameter("y", (18 + y));


Without the y it will compile. Not sure how to fix this.

Chris

4
Help, Errors, FAQ / Precise positioning of bullet sprite
« on: 2011-03-29, 08:24:50 PM »
I could not find any documentation on how to solve this problem. The player shoots a "bullet", but it appears in the wrong place from the sprite. It should appear in front of the barrel of the gun but appears too low. It also does not appear the same distance from the player's center if facing left or right. However I have been careful to adjust the sprite's offset have a very precise collision rectangle.

My strategy was to create two framesets, one for left, and one for right so that it would appear in the precise location. I tried the different "addspritehere" relative positions but didn't find one that worked.

I went into the frameset and changed the bullet sprite's offset so that appears in the right place upon shooting, but now it does not match up to the sprite's collision.

I don't see an obvious or documented solution on the forums or the help file. Please advise.

Chris.

5
General Discussion / Re: Looking for a very good tutorial.
« on: 2011-03-29, 07:53:03 PM »
If you go to the help file under the Help > Contents menu, the tutorials will be in the left pane.
It is a good place to start. I'm a beginner too.

6
Help, Errors, FAQ / Re: Issue with counting frames too fast
« on: 2011-03-22, 07:33:02 AM »
I have extra options with isAgainstTile since I can specify tile categories and relative alignment. I think this could be useful if I were to, for instance, have some tiles on a level where jumping is prohibited. Chances are I will never do that, but I thought, what the heck. I got it working I might as well use it.

7
Help, Errors, FAQ / Re: Issue with counting frames too fast
« on: 2011-03-21, 09:32:11 PM »
Sounds like a really bad strategy then. I'll stick with IsAgainstTile.

8
In response to what I think SnapToGround does, I have made these conclusions based on my reading of the documentation and the forums, but I could be dead wrong.

It is a method that is implemented to bring the player sprite all the way to the "ground", which is defined as the solid tile(s) the player sprite lands on. It is declared with other methods such as ReactToSolid and must come immediately after react to solid.

There is a threshold for the SnapToGround method to activate defined in pixels. Once it detects that the player is close enough it alters the y velocity of the player to make sure it does not stop above or below the solid tile and will always reach the same y position relative to the tile.

The method can also be used as a test, since it returns true when it is activated. In my game the test occurs in a place where it must return true for the jump to be possible. Whether it is the SnapToGround method, or the other methods (I have used Blocked, and IsAgainstTile successfuly).

This exercise is merely academic, since the other two methods work without fail. I expect that the player should be "Snapping to the ground" each time it reaches the threshold. It should return true in my "OnLanding" test each time where I have implemented it as a test. It seems to be that most of the time it is doing that, but for reasons I don't understand, sometimes it does not. This makes it so the IsJumping parameter does not get reset and subsequently malfunctions preventing the player from jumping.

The inputs are the same. Press left, or right, and jump at the same time. Do this about 20 times and one of those times will probably result in a failure.

I also expect that the threshold would only need to be 1 pixel, but it requires 11 or 12 before it works. I am unsure of what it uses as a reference. I think would be the same thing the other methods use, but it something seems to be offsetting it. Perhaps there is something else wrong that I am not aware of.

As a precaution I did check the sprite's frameset. I thought maybe that had something to do with it. I found that all of them have a y offset of 5 except for a couple of frames. In the project you have been sent you'll see this inconsistency. I fixed that and it didn't fix the problem so it doesn't seem to be that.


9
Help, Errors, FAQ / Trying out different methods
« on: 2011-03-20, 02:29:24 PM »
I was able to get bluemonkmn's code "Against Tile" to work nicely, but am still not able to get the SnapToGround method working consistently. I have uploaded my project if you would like to check it out. The offset must be set at at least 12 before there is a result.

In the project the character will not jump unless the ground is detected using the rule called "OnLanding". You should be able to get it to fail when you turn and jump (while on the ground) simultaneously, but not every time.

Chris


10
Help, Errors, FAQ / Learning from player example
« on: 2011-03-20, 08:24:45 AM »
I actually did learn from the player example, but now that I look at it again I am understanding more since I've learned a lot since I started.
In fact I wouldn't have got past going left and right without it. The player example is much simpler. My player now has different states for jumping and switches left and right states in the air, and now, thanks to Vincent, the jump can be interrupted based on the input being released.

I will be glad to try out your suggestions and new rule and see how they all work, probably some time this evening. Next I will work on adding some new animations for climbing and shooting and see how I can make those work.

Chris

11
Help, Errors, FAQ / Problem fixed
« on: 2011-03-19, 08:57:54 PM »
I integrated Vincent's strategy into my logic and cleaned things up a bit by consolidating everything back into the Sprite definition.

Setting dx to 0 mid jump is much more elegant than using a timer to block an input. I also reconfigured the animation to prevent the double framerate problem in case I use timers in the future. The only thing I had a problem with was using the "snaptoground" method. It seems to work intermittently and requires a high threshold to function at all (around 12). I tried implementing the "IsOnTile" method and that does not work either, ven when I set to detect all solid tiles. It's a mystery.
 
The only thing that does work for me is the "Blocked" method and it works consistently.
So far progress is very slow and I'm learning through trial and error, and of course, your suggestions.

12
Help, Errors, FAQ / Re: Issue with counting frames too fast
« on: 2011-03-18, 07:00:24 PM »
That's cool. I didn't think that would overlap like that. My intention was to apply those to only the L and R sprite states, and had no idea that could happen.
 
I am interested in getting set up with the C# compiler and will get that running soon. Unfortunately it looks like my time will be more and more limited each day as I am in the process of moving out of state and approaching the deadline for vacating.

Thanks for your input,

Chris

13
Help, Errors, FAQ / Submitted sample and clarification
« on: 2011-03-18, 08:05:25 AM »
As of now the game is about as simple as it can be so I simply uploaded it as is to the link you suggested. Right now all I have is a player sprite, a couple of tiles, and some counter displays, and I'm trying to make it behave.

I am grateful for the solutions you guys have proposed. I am looking forward to implementing them ASAP. The counters are just for display (troubleshooting) since I don't know how to draw parameter data directly. They aren't being used to control anything. The rules that affect the behavior of the game are tied directly to the sprite's parameters.

I apologize for using abstract terms. I think it would be easier just to look at what has been done. The counter is tied to the player sprite parameter which is tied to m_ParentLayer.m_Player1.frame. The counter is updated as long as the up input is pressed.

For me this is somewhat of a black box. I understand this is supposed to provide the frames of the animation being displayed in sequence, which I suppose should be at the framerate of the game. (Which I have limited to 30 fps).

It's like it's getting pulsed 30 times per second by whatever pulses it when the jump animation is playing (one data source), and then when there is a horizontal input it's getting pulsed by an additional whatever so it gets too many pulses per unit time. Of course this is speculation and I'll let you be the judge. The bottom line is it is behaving an in unexpected way that could have implications for other things as well.

Thanks a bunch,

Chris

14
Help, Errors, FAQ / Issue with counting frames too fast
« on: 2011-03-17, 03:39:57 PM »
I am trying to set up the player to have controlled jumping (Commander Keen style). This means there is power for a certain amount of time when the jump input is pressed. However you have the option of letting off mid-jump for shorter jumps. You can also move left or right during the jump.

So I have set a parameter to read the frame at which the input is pressed. It adds an arbitrary number of frames to it and stores it to a new parameter. When it reaches that number it cuts off the power until the landing. (I've yet to determine how to prevent multiple jumps within the jump during this time but it's a start).

The jump is now controllable. The problem is that the frames advance significantly faster when you are moving left or right at the same time as jumping which means you barely get off the ground when moving, but can get pretty high when not moving horizontally.

It's almost like the counter is getting two streams of data at the same time whenever you have x motion. The FPS read at a constant rate. The counter is ticking markedly faster when the horizontal input is pressed.  I'm not sure if this is a bug or if it's user error. However if I remove the one data source there is no activity on the counter.

All of the jump handling is done from a level plan. The horizontal motion is done from the sprite definition. Everything thus far is done using basic rules without scripting.

Any suggestions would be appreciated.

15
Help, Errors, FAQ / Re: OpenGL won't work on netbook PC
« on: 2011-02-28, 09:47:11 AM »
That fixed it.

Right now I'm making models in Blender 3d to render to 2d and learning how to rig meshes for animation, which for me is more of a learning curve than I expected. So it will probably be some time before I get into the game engine other than playing around with it. If I don't get back in a day or two please feel free to e-mail me if you would like me to do any further tests.

Chris

Pages: [1] 2