I don't know much about it, but prefixing variables only with '_' isn't all that safe, as it's for reserved identifiers, same goes for '__' (double underscores).
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
bool _invertedWalk; // Is the movement inverted
bool _onFarHill; // Are we on the far away hill
bool _walkbehindOn // Keep track if the walkable area is active
// PLACE THIS INSIDE THE ROOM SCRIPT
function on_mouse_click(MouseButton button)
{
// Rooms can have their own on_mouse_click function too
if (_invertedWalk && mouse.Mode == eModeWalkTo)
{
int invertY = ROOM_HEIGHT - mouse.y;
ProcessClick(mouse.x, invertY, eModeWalkTo);
ClaimEvent(); // Prevent global on_mouse_click to get run.
}
}
WalkOntoHillTop // Should be the "walks onto" function for the region that is the hill top
{
// If the player is on the far away hill, this region does nothing
if (_onFarHill)
return;
// We are on the fist hill, figure out if we're walking to the back or front of it.
if (!_walkbehindOn)
{
// Walk to the back of the fist hill
SetWalkBehindBase(THE_ID_OF_THE_WALKBEHIND_YOU_USE, HEIGHT_OF_YOUR_ROOM);
_walkbehindOn = true;
// Whe sould invert the walk. So if we click at the bottom of the front hill, the character will walk upp the back
// then down the front.
// If we click the backgroun hill, the player should walk down the first hill, then up the second.
_invertedWalk = true;
}
else
{
// Walk to the front of the fist hill
SetWalkBehindBase(THE_ID_OF_THE_WALKBEHIND_YOU_USE, 0);
_walkbehindOn = false;
// Reset movement to normal
_invertedWalk = false;
}
// Since the player is at the top of the hill, he should start walking down.
// So get the distance that he have left to walk.
int dist = player.y - mouse.y;
// Have the player walk down that last bit
ProcessClick(mouse.x, player.y + dist, eModeWalkTo);
}
ProcessClick(320 - mouse.x, 200 - mouse.y, eModeWalktTo);
EffectsSpriteCombined = DynamicSprite.Create(640, 480, true);
Quote
This will load all your sprites which have been assigned to views into memory (well only the first 3000 of them - this is an arbitrary number and if you have more it will probably crash).
However these are loaded into a dynamic sprites so I dont think it will actually affect other instances. Try it anyway
QuoteThis code doesn't work with default "dialog branches" system
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.093 seconds with 13 queries.