Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

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 - theflash

Pages: 1 [2] 3
16
Technical forum / Re: Button Captions not on top
« on: March 23, 2010, 10:16:17 AM »
It is loaded multiple times, but it is also unloaded properly each time.

I have now found out, that it starts way earlier though.

When I fire up the game, menu.scene is loaded and with it the window (window A) that provides the options (i.e. the buttons with the captions). When I click the exit button, another window (window B) is loaded to confirm the selection. Once window B is loaded, the caption of window A is pushed beneath the window. It doesn't matter, if window B is systemexclusive or not. Although, on a perculiar sidenote, when window B is not systemexclusive, it doesn't show up at all. The caption effect is still present though.

17
Technical forum / Button Captions not on top
« on: March 22, 2010, 05:29:20 PM »
I have a scene, that acts as my Main Menu. In this scene I have a window with buttons, these buttons have Mouse Over Captions. Works like a charm.

But only, if I enter that scene first. If I change to that scene from another scene (i.e. "Back to Main Menu"), the Captions for the buttons are UNDER the buttons and thus are mostly occluded by the buttons.

Is there any reason why button captions could be in a lower layer than the buttons themselves?

18
Technical forum / Re: Cannot get the File Object to work
« on: March 05, 2010, 03:16:59 PM »
Okay, it was the thing with the "\saves\profiles.txt".

What got me was that Game.FileExists("\saves\profiles.txt") returned true. But it seems, that Game.FileExists will pretty much always return true  :o

19
Technical forum / Cannot get the File Object to work
« on: March 05, 2010, 02:00:49 PM »
I'm having some difficulties with this.

Code: [Select]
var proFile = new File("\saves\profiles.txt");
proFile.OpenAsText(1)

Whether "saves\profiles.txt" exists or not, the OpenAsText(1) returns false.

Hope someone can help me.

20
Technical forum / Re: Problems with / and \
« on: February 05, 2010, 12:02:40 PM »
I can now definitely confirm it.

The method used was not GetSprite(), but GetCursor(). It returns a value like "sprites/system/greencursor.sprite". Used in a switch, a possible call is then f.SetSprite("scenes/Room/FDNY/F_red.png") and it works - in WME.

21
Technical forum / Re: Problems with / and \
« on: February 04, 2010, 10:24:00 PM »
Well, in WME it does work with the forward slashes! Tomorrow, when I get back to work, I'm gonna check what the Sprite value in the above code snippet looks like.

22
Bug reports / Re: Scrolling and dynamically adjusting Scene.Width
« on: February 04, 2010, 05:14:52 PM »
Okay, I mailed you a demo project.

23
Bug reports / Re: Scrolling and dynamically adjusting Scene.Width
« on: February 04, 2010, 04:20:27 PM »
OK, I might've found another scrolling-related bug.

To circumvent the above found one, I just made all scenes 2048 wide to begin with, to account for the possibility of sliding in (scrolling) the menu. And that worked.

Now I needed to pause the game, while I was in the menu, otherwise you'd be sliding out the game to one side and it would continue to run.

The only way I've found to pause the game is with the GoSystemExclusive() applied to a window. Once a window is system exclusive, it's the only thing clickable, so the sliding menu had to be the window. Windows themselves don't scroll, so I have my "Menu Dummy" (simple entity with pic) slide in, afterwards overlay it with the "Menu Window" (that looks indentical) and make this Menu Window system exclusive. When the menu should go away, I Delete the Menu Window and then slide out the Menu Dummy. This is when WME crashes. Always.

To reiterate:

- Main Layer is 2048.
- Scene background is 1024

on "Escape":
- "Menu Dummy" Entity is created and given an image
- Menu Dummy is placed at X = 1024
- Scene.ScrollTo(1536, 0) -> Slides out Scene background, slides in Menu Dummy
- Menu Window is loaded -> X = 0, Y = 0, Width = 1024, Height = 768 ... overlays the Menu Dummy
- Menu Window GoSystemExclusive();

on "Resume":
- Menu Window is killed
- Scene.ScrollTo(0, 0) -> Slides out Menu Dummy, slides in Scene background

After SCROLLING is FINISHED the GAME CRASHES.

Here is the code:

slider.script is called from game.script at the press of "Escape":

Code: [Select]
#include "scripts\base.inc"
#include "scripts\keys.inc"

global inMenu = true; // to prevent calling the Menu if it is already loaded

// Menu Dummy
var menu = Scene.CreateEntity("Menu_1");
menu.SetSprite("scenes\Menu\menue_bg.png");
menu.X = 1024;

// Scroll Scene
Game.MainObject = null;
Scene.ScrollPixelsX = 30;
Scene.ScrollPixelsY = 30;
Scene.AutoScroll = true;
Scene.ScrollTo(1536, 0);

// Overlay Menu Dummy with the actual Menu Window
global Win = Game.LoadWindow("windows\menu.window");
Win.X = 0;
Win.Y = 0;
Win.GoSystemExclusive();    

// kill the Menu Window and slide out Menu Dummy
// gets called from the other script
on "QuitMenu"
{
inMenu = false;
Game.DeleteWindow(Win);
Scene.ScrollTo(0, 0);
Scene.DetachScript("scripts\menu.script");
}

menu.script is attached to menu.window
Code: [Select]
#include "scripts\base.inc"
#include "scripts\keys.inc"

// if the "Resume"-button is clicked, QuitMenu is called (that works)
on "Resume"
{
Scene.ApplyEvent("QuitMenu");
}

24
Bug reports / Re: Scrolling and dynamically adjusting Scene.Width
« on: February 04, 2010, 01:51:45 PM »
Ok. Thanks.

At least this time it wasn't me.

25
Bug reports / Scrolling and dynamically adjusting Scene.Width
« on: February 04, 2010, 12:11:37 PM »
Hello again,

for once I hope to post something that doesn't either solve itself or is so banal that I have to smack myself for stupidity.

I want to implement a Menu-Screen in my project that "slides" in and out, thus using Scene.ScrollTo . Now I know how to make Scenes scroll. But all the Scenes in my project have a mainlayer width of 1024, same as the game and thus non-scrolling. So I want to adjust the mainlayer width by script and make the scenes scrollable dynamically.

To accomplish that, I attach a menu.script at the press of the Escapekey, that does the following:
Code: [Select]
var MainL = Scene.MainLayer;
MainL.Width = 2048;

Scene.ScrollPixelsX = 30;
Scene.ScrollPixelsY = 30;
Game.MainObject = null;
Scene.AutoScroll = true;

Scene.ScrollTo(1536, 0);
}

If I set the MainLayer width MANUALLY in the Scene Editor to 2048, it works.

But if I set the Width in the script as above, it doesn't. The width is correctly identified by the game as 2048, yet it won't scroll.

Any ideas?

26
Technical forum / Re: Problems with / and \
« on: February 04, 2010, 11:59:33 AM »
Hi, sorry for the delayed response, the code line in the original post is actually real code.

Code: [Select]
var Sprite = Ent.GetSprite();
switch (Sprite)
{
   case "sprites/system/test.sprite": f_lilac.SetSprite("scenes/Room/grafiken/testg.png"); break;
   ...
}

That was basically what was in the code. (Not anymore, had to rewrite the whole thing for inadequacy anyway.)

I never used regular slashes in paths before, so when the compiled .EXE didn't work and I took a look at the script, I was quite sure, that this was the culprit. I was very surprised then to find, that within WME it did work.

27
Technical forum / Re: Problems with / and \
« on: February 01, 2010, 04:25:41 PM »
Okay, now, for reasons unclear, "\" work in both WME and the compiled package, while "/" still works only in WME and not the package. Fine by me. :) It wasn't me who used "/" in the first place. Damn those henchmen!!!

28
Technical forum / Re: Problems with / and \
« on: February 01, 2010, 03:57:54 PM »
Nope. I don't get an invalid.bmp.

The situation is: I have a colored cursor and click on a letter that will then be colored according to the color of the cursor. For that, the color of the cursor is queried by way of the sprite name. It's a switch. One case: "sprites/system/test.sprite", if that happens, the letter's sprite gets switched: f_lilac.SetSprite("scenes/Room/grafiken/testg.png");


This works flawlessly within WME. But once I compiled it, it didn't work. So I changed all the "/" to "\", e.g.
Code: [Select]
case: "sprites\system\test.sprite", if that happens, the letter's sprite gets switched: f_lilac.SetSprite("scenes\Room\grafiken\testg.png");
Now it works when I compile it (game.exe), but no longer within WME.

29
Technical forum / Problems with / and \
« on: February 01, 2010, 03:19:11 PM »
Hi,

I have the following problem:

Code: [Select]
case "sprites/system/test.sprite": f_lilac.SetSprite("scenes/Room/grafiken/testg.png");
This is the line of code. It queries the sprite of the cursor and sets another sprite accordingly. Works like a charm. Within WME. If I compile the package, it stops working. If I replace the slashes with backslashes, it works in the compiled package, but no longer in Wintermute. So it's either good in WME but bad in the EXE, or it's good in the EXE and bad in WME. What's happening?

30
Technical forum / Re: Call to undefined method
« on: December 04, 2009, 03:49:55 PM »
Okay, no idea why, but I've just created a new script file and it works now. Don't know where the difference is/was, but I'm happy for now.

Pages: 1 [2] 3

Page created in 0.085 seconds with 23 queries.