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

I'm going to to turn this thread into an Xmas Engine Q&A thread. Sonic Worlds has its own forum I think the Xmas Engine at least deserves a thread. Plus I need to be able to ask questions somewhere, but don't think that means I'm the only one that can ask. I will ask and answers questions as I can/need to.

I'm still trying to figure out the xmas engine I think its just difficult because there are so many scripts and its hard to know if you covered everything. Anyway here's what I've done:

I've made a script basically the spin dash script I'll work out the kinks when I actually have it working:

// ==== FUNCTION ====================================================================
// scrPlayerActionPeelout()
// ==================================================================================
//

if (!KeyUp) {
Action = consActionPeelout;
Speed = AnimationDirection*PeeloutRev;
FlagsAllowCommonInput = false;
sound_stop(sndSpindash)
sound_play(sndSpindashRelease);
}
else if (KeyActionPressed) {
PeeloutRev = min(PeeloutRev+PeeloutRevCharge, PeeloutSpeed);
sound_stop(sndSpindash)
sound_play(sndSpindash);
}
else {
PeeloutRev = max(PeeloutRev-PeeloutRevLose, PeeloutMinSpeed);
}[/CODE]

I've also added:

[CODE] case consActionPeelout:
scrPlayerActionPeelout();
break;[/CODE]

to the input management code under the step event. I've added the constant consActionPeelout = 99 cause it doesn't matter what number it is as long as it doesn't conflict with any other constants. This is everything I've done. Obviously there is another place where I have to check to input keys to see if a peelout is happening or not but I cannot find where this code should go. I was just looking for where the spindash input check is but I can't find that.

Link to comment
Share on other sites

What do you mean by Peelout "Startup"? I never said that. Thanks for help I think you've got me on the right track but I still need some assistance.

New Question I've got the basic Peelout Done aside from the Animation I *think*. The Animation I'm still having difficulty understanding the animation the example is great Dami and worked well for figuring out how the frames of animation are chosen, but I'm still having trouble understanding how animations are switched. In the example its just Animation = "Idle"; for instance but this isn't how it works in the xmas engine as far as I can tell. This is the code I've been using:

// ==== FUNCTION ====================================================================
// scrPlayerActionPeelout()
// ==================================================================================
//

if (!KeyUp) {
Action = consActionNormal;
Speed = TopSpeed*AnimationDirection;
FlagsAllowCommonInput = false;
sound_stop(sndSpindash)
sound_play(sndSpindashRelease);
Animation = "Running2";

}
else if (KeyActionPressed) {Animation = "Running2";}[/CODE]

The Animation never changes with that code by the way. I imagine that's because somewhere its just changing back before the step is over but I don't know where that is, and looking at the Spindash script there is no "Animation =" code so the animation much be switched somewhere else. I looked in the step end even but I don't really see where it changes there either. It looks to me it checks if it has changed but doesn't actually do the changing in the step end event.

I also am having trouble understanding the Parallax it looks like scrParallaxAddNode

is where the Parallax is set and that the arguments are each of the layers. But where are the arguments set to specific background images?

Link to comment
Share on other sites

EDIT: If Someone wouldn't mind just walking me through how to create a Peelout and explain what each variable does and everything that wound be awesome. I've probably spent 8 hours trying to figure it out with little luck.

Alright I found that is all under HandleSonic Script. I still don't know about the Parallax though.

I've got a new one YAY! this engine is amazing but its proving to have quite the learning curve for me. Anyway I've got this code for my peelout action

// ==== FUNCTION ====================================================================
// scrPlayerActionPeelout()
// ==================================================================================
//

if (!KeyUp) {
Action = consActionPeelMove;
Speed = AnimationDirection*TopSpeed
FlagsAllowCommonInput = false;
sound_stop(sndSpindash)
sound_play(sndSpindashRelease);

}
[/CODE]

this works fine upon release it shoots you off as top speed but which script do I switch it to to have normal deceleration and movement while at the same time keeping Action = consActionPeelMove; so the animation stays on "Running2" the peelout animation.

Link to comment
Share on other sites

Sigh... I guess this is why no one is using the Xmas engine its difficult to understand and doesn't have to support system like Sonic Worlds does. Its too bad cause its a fantastic playing engine and from what little I can understand from the code looks very flexible too. But I've probably spend the better part of 3 days trying to figure this thing out. So far I've figured out how to switch sprite animations and that's about it. It would be nice if there was some documentation or something to go along with this.

Link to comment
Share on other sites

I really can't imagine why the elements of the engine are so difficult to grasp, but that may be because I've spent so much time with it, I know it inside and out. With you having said this, I think I'll spend some time tomorrow writing up a mock-"design document" for Sonic DASH to close the learning curve.

Link to comment
Share on other sites

That's really great hopefully it will help. I have to confess I kinda feel like an idiot trying to work with this engine. I don't usually ask for so much help I like to try to figure things out on my own but its just not working for me here. I think part of the problem is that its a completely different style of programing then I'm used to.

Link to comment
Share on other sites

As I was writing the tutorial, I thought about how much easier it would be for me if people just figured it out on their own. It's hard to see the difficulty in something after you've come to understand it, so it was hard for me to relate while writing the tutorial without feeling like I'm "babying" the reader. =/

Anyways, to answer your question the "lazy" way: you had it right the first time; you just keep looking in the wrong places.

Look at the very first code block at the top of the end step. consActionNormal changes the running animation based on the player's Speed. Place your "Peelout" animation there at a speed that matches what the lowest speed would be during peelout. If you can't understand what I'm saying:

if (abs(x_speed) > 0  && abs(x_speed) <=  5 && animation != "walking")
            animation = "walking";
        if (abs(x_speed) >  5 && abs(x_speed) <= 10 && animation != "running1")
            animation = "running1";

[B]etc...[/B]

        if (abs(x_speed) > [B](peeloutspeed)[/B] && animation != "peelout")
            animation = "peelout";

[B]etc...[/B]

BTW, the best way to see what each variable does is to use the debug option and view them in action. That's all I can mention about that.

  • Like 1
Link to comment
Share on other sites

I seem to be having a fundimental problem here's the code I'm using:

// ==== FUNCTION ====================================================================
// scrPlayerActionPeelout()
// ==================================================================================
//  

    if (!KeyUp) {
        Action          = consActionPeelMove
        Speed           = AnimationDirection*TopSpeed
        FlagsAllowCommonInput = false;
        sound_stop(sndSpindash)
        sound_play(sndSpindashRelease);

    } 
    else{
    Animation = "Running2"
    Action = consActionPeelout
    FlagsAllowCommonInput = false;
    }

In essence this is the same as the spin dash code without the charge because you don't need one when doing a peelout. What's happening is Action is quickly switching to the consActionPeelout and then quickly switching back to consActionLookUp and I cannot figure out why. Some where in the code of the engine there must be something telling the engine to switch back to consActionNormal and then because I've to the up button help up its switching to consActionLookUp and staying there until I hit space and repeats the whole process again.

Link to comment
Share on other sites

It cannot be in the ActionNormal script. What I am looking for is a place that double checks if the Action variable should be set at consActionNormal. Since consActionNormal activates that particular script that cannot be and I've checked double check and triple checked just to be sure.

I don't think trying harder is going to help me any, I've sat here for probably about 30 hours trying to figure out this peelout. I've looked at every script in the game dozens of times trying to figure it out my problem with no luck. I also already know how to use the debug feature and have attempted to use that several times in an attempt to figure out the problem but no luck. I'm not a total idiot when it comes to Game Maker programing either I did manage to program a lot of different things in Time Twisted.

If anyone can enlighten me on where what I'm looking for is. Or if they have another suggestion or what to look at the code I'd be grateful. The GM file is attached its basically just the Xmas engine with a few minor code additions in an attempt to make a peelout.

The gmk code file

Link to comment
Share on other sites

Well, first of all, the way you're changing animations is not the correct one. Since each character could have different animations on different speeds / situations, modifying what's on "scrPlayerAnimationHandleSonic" and the others, is the way to go.

The problem you're having with the action conflict, isn't exactly between the Peelout action and the Look up action. It's between the Peelout and Peelmove actions, as you forgot to have a "break" sentence in the action table (the giant switch with the different actions and the call to their scripts). That's making the engine switch from action to action everytime.

Anyway, why use that "Peelmove" action? If the functionality is exactly the same as the normal action, then use the normal action. Take a look to my implementation:

DamiRyoshiEnginePeelout.zip

  • Like 1
Link to comment
Share on other sites

I'm not using PeelMove, its just when I first created the peelout I just directly copied the spindash. Then after working on it a bit I realized PeelMove was useless. I believe the animation should already be switched in the handle sonic you both have been a big help. The peelout works correctly now. I'd rep you both but it won't let me anymore because I've done it too much.

Link to comment
Share on other sites

No, it's not fully implemented. Just check if you're standing on one, and then add the difference between the platform's x and xprevious to the player's x (and the same for the y). You're going to get "sliding," which is kinda unavoidable unless you put the code in the Draw step (very tacky).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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