Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Xmas Engine Q&A


OverbounD

Recommended Posts

Question 1

Another question after the monitor is destroyed using scrPlayerHandleObjectsMonitor. Where is it decided which action to perform by this I mean where is the code that decides whether to create a shield, add 10 rings, or hurt Sonic? Where is the code that determines this?

Question 2

What does consAnimationsSubAnimation do? The reason I'm asking is because I have an animation that I want to stay on one frame unless I'm moving left or right. I thought SubAnimation might be a second set of frames I could call on.

Link to comment
Share on other sites

It does however shake a bit any idea why its doing that?

Because the player's x and y are floor'd when the sprite is drawn to the screen. You'll have to fiddle with the platform offsets using rounding functions for a while.

Question 1

Another question after the monitor is destroyed using scrPlayerHandleObjectsMonitor. Where is it decided which action to perform by this I mean where is the code that decides whether to create a shield, add 10 rings, or hurt Sonic? Where is the code that determines this?

objMonitorIcons.

Question 2

What does consAnimationsSubAnimation do? The reason I'm asking is because I have an animation that I want to stay on one frame unless I'm moving left or right. I thought SubAnimation might be a second set of frames I could call on.

SubAnimation is for special frames played at the same time as another animation. By default, Tail's tails are a SubAnimation.

If you want an animation to stay on a certain frame, use AnimationFrame.

Link to comment
Share on other sites

Thanks that answered my two question, I'm actually getting somewhere now, I've added time travel, a few badniks, a peelout, a hang gimmick, background graphics, and a swing gimmick. The engine is so smoooooth.

One thing though I'm not quite sure what platform offset is could you explain what it is and where I can edit it. Stupid question I know.

Link to comment
Share on other sites

Got another question of course. I'm having a bit of trouble with my hanging object. What happens is if the player is at either edge of the poll and jumps on to grab on the Action Variable switches back and forth between Normal and the Hanging Action making the character jiggle. Because its only happening at the edges of the poll this leads me to believe its a problem with the collision checking. I have yet to be able to figure this out myself. Here's the code and a screen shot for reference.

// ==== FUNCTION ====================================================================
// scrPlayerHandleObjectsShimmy()
// ==================================================================================
//

_ObjectHandle = instance_nearest(x, y, objShimmy);
if(_ObjectHandle = noone)
{exit}
if (scrPlayerPresiseCollisionCheck(x, y, objShimmy) && Action != consActionHurt)
{
Action = consActionHang;
}
else if(Action == consActionHang){
FlagsAllowY = true;
Action = consActionNormal;
}[/CODE]

attachment.php?attachmentid=918&stc=1&d=1222989744

post-252-13863976259_thumb.png

Link to comment
Share on other sites

The piece of code somewhat goes against how the Action states machine should go. All actions should be internally managed by them so all the flags and values are treated correctly when doing a transition between states. Only very exceptional cases should be used to exit from a state.

Anyway, the problem with the edges is probably caused due the fact the precise collision check tests the Skin against the selected object. Once the action state changes, the animation does so, and it may detect a new collision with the edge. You should instead use the top sensor, and not the skin.

Link to comment
Share on other sites

Here's what I wrote about that:

Collision ("Global Objects/Player/Collision")

Circular collision around the player is simulated using circular sprite masks and x/y positioning with sine and cosine. The player's angle is calculated by pushing two seperate points out until they both return a collision, then obtaining the angle between the two points. "Limiters" serve as a pre-check, in order to avoid defaulting or crashing when determining the player's angle - either limiter returning false signifies that there isn't enough ground beneath to correctly form an angle, usually meaning you're at an edge or in the air.

scrPlayerCollisionCheck holds all possible solid objects the player can collide with, which are used for the "normal" version of the collision scripts (the "Object" version checks for collision with a user-specified instance). By default, there is solid terrain, layered terrain (collision only occurs if objPlayer shares the same layer), and "platforms" which can only be collided with directly from the top (the same as a tile solidity of "01" in a Genesis Sonic game).

Link to comment
Share on other sites

  • 3 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...