Menu

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.

Show posts Menu

Messages - Jaffles

#121
Hey guys, as you may recall, a few of you graciously helped me put together a scrolling background a few weeks back.
Upon returning to that section of my project, and trying to script some racing action on top of the background, I've run into a few problems. This is the script I'm using.

function room_RepExec()// this scrolls the background
{


  if (oRoad.Visible==true && oFinish.X >= 400) {
    oStart.X -=20;
    oRoad.X -= 20;  // speed
    if (oRoad.X <= -640) oRoad.X += 640;
  }
  if (oDracoRacer.X >= 350) {
    oFinish.Move(400, 349, 20, eNoBlock, eAnywhere);
}

function room_AfterFadeIn()// this controls the racer's (oDracoRacer) movement
{
oDracoRacer.SetView(20);
oDracoRacer.Animate(0, 5, eRepeat, eNoBlock, eForwards);
oDracoRacer.Move(200, 312, 5, eNoBlock, eAnywhere);
oDracoRacer.Move(100, 312, 4, eNoBlock, eAnywhere);
Wait(200);
oDracoRacer.Move(700, 312, 5, eNoBlock, eAnywhere);
}

There are a few problems I'm encountering. If I set the move commands to eBlock then they stop the background from scrolling, but if I set them to eNoBlock then they muddle together instead of being three separate movements. Also, the wait command stops the background from scrolling as well. Finally when oDracoRacer's x coordinate exceeds 350, the finish line does not move onto the screen.

TLDR: Is there any way I can have the RepExec script running, while stopping the RoomLoad one?

Also, how do you guys post your code in those neat little white boxes? I'd like to start doing that, just for everyone's sake XD
#122
Works like a charm! Thanks for the fix!
#123
Gah, sorry to post again, but there's been a slight snafu. Whenever I put numbers higher than five in for the speed, the second part of the code doesn't work. Is there some specific parameter I'm missing (like the number has to go into 320 evenly) or is there something else I'm missing?

And thanks guys, It's good to know that there are helpful people who're willing to help newcomers like myself.
#124
Ok, I see. I'm still picking up the shorthand for these things. Thanks for all the help guys, the scrolling works great!
#125
Thanks for the help, I just had a few questions concerning the code, to make sure I understand it properly (and thus actually learn something instead of just copypasting and calling it a day).

// in room_RepExec

  Object*o = oScrollingBackground;
  if (o.Visible) {
    o.X -= 1;    // speed
    if (o.X == -320) o.X = 0;
  }

How is this actually moving the background? Is there a command that is moving it? Also, why is there a - before the speed? Thanks again for the code though.
#126
What is the best way to go about creating a constantly scrolling background?

In this case, there are two Characters racing, and I need the background to scroll past them to give the illusion of movement.

Should I just create an incredibly long background, set it as an object in the room and have it scripted to move across the screen until the finish line appears? Or is there a much less convoluted way to do this?

Thanks in advance
#127
Hey everyone,

Since I wanted to run my game at a higher res than the default, I'm designing my GUIs from scratch and I'm having trouble setting up my inventory GUI. I can get inventory items to appear in the inventory window just fine, but whenever I click on an item within the inventory window, nothing happens, even if my pointer is in "interact" mode. Is there a command that allows you to use the items in your inventory? Or am I missing something else entirely? Thanks in advance.
SMF spam blocked by CleanTalk