Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

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.

Topics - TondaS

Pages: [1]
1
Technické fórum / Hover kurzor
« on: July 06, 2006, 02:56:55 PM »
Čau lidi  :),

mám takovej dotaz - jak by se dalo elegantně vyřešit, aby se při najetí např. na východ z lokace změnil kurzor ?
Lámal jsem si s tim hlavu docela dlouho a přišel jsem na řešení, který má ale jednu vadu - při najetí na entity (rgn) se mi u kurzoru už nezobrazí jeho Caption.

Script vypadá zhruba následovně

(game_daemon.script)
Code: [Select]
while(true)
{
  // zjistime, v jakem regionu se nachazi mys
  var regionNaMysi = Scene.GetRegionAt(Scene.MouseX, Scene.MouseY, true);

  // jmeno regionu
  var regionNaMysiString = new String(regionNaMysi.Name);

  // vyskytuje se ve jmenu regionu slovo "exit" ?
  if (regionNaMysiString.IndexOf("exit") != -1)
    {
      // vezmeme z tohoto regionu jeho hodnotu atributu smer
      var smer = regionNaMysi.smer;

      // podle smeru urcime, jaky kurzor bude
      var which_cursor = "data\sprites\kurzory\exit_sipka_"+smer+".sprite";

     // nastavime kurzory - jak normalni, tak aktivni kurzor
     Game.SetCursor(which_cursor);
     Game.SetActiveCursor(which_cursor);
   }
   else
     {
       // nastavime puvodni kurzory
       Game.SetCursor("data\sprites\system\cur_arrow.sprite");
       Game.SetActiveCursor("data\sprites\system\cur_arrow_h.sprite");
    }

  Sleep(75);
}

Jinak někde na scéně je region, kterej se jmenuje třeba "exit_koupelna", v jeho custom properties mám smer = vpravo (nebo vlevo, nahoru apod.)

Víte někdo, jak tenhle problém vyřešit ??? Díky moc


2
Technical forum / Divisiony by zero problem
« on: May 02, 2006, 10:49:02 AM »
Hello everybody  :),

I've got problem - I can't divide by numbers (0.1, 0.25, 0.333, 0.5, 0.789789 etc),

Code: [Select]
var a  = 20;
var b = 0.5;
var result = a/b;

Game.Msg(result);

WME log gives me

22:03: Runtime error. Script 'scenes\test_scene\scr\scene_init.script', line 10
22:03: Division by zero.

So my question is - can WME divide by this numbers or I must do some "tricks" like this (or I'm just dumb  :( :) )

Code: [Select]
var a  = 20;
var b = 0.5;

var x = 10;

a = a*x;
b = b*x;

var result = (a/b)/x;

Game.Msg(result);

Thanks for answers.

3
Technical forum / Width, height and rotate question
« on: December 29, 2005, 10:42:36 PM »
Hello everybody  :),
(I'm making a script for minigame)
I have image of cardboard box - and I need to rotate that image, also I need to know cardboard box image's width and height. That's the problem.

1) My cardboard box is entity (.entity file, sprite or free - actually, I don't know any differences between those two), I can rotate with it, but I can't get it's Width (i need it for some counting in script). I noticed that entity object doesn't have any Width attribute, just Height, which also didn't work as I expect - wme always gives 0 as a value of entity Height. So, I can't get entity's Width, neither Height.

- Is this normal ? Or I miss something ?

Of course I can insert width and height of cardboard box image manually to script... but it's pointless if there exists easier and more effective way

2) I can't rotate buttons (static objects etc.) - and I don't know why. I tried to write ROTATABLE=TRUE to button definiton, but that just gives me syntax error, I tried set .Rotatable to true also from script, but without success.

- Is this normal ? Or I miss something ?


Thanks for any anwsers.  ???

P.S.
i tried to search forum, i tried to "experiment" for a few hours... btw game runs in accelerated mode, so rotation should work.


4
Technical forum / WME supports only single dimensional arrays ?
« on: August 27, 2005, 10:08:22 PM »
I tried to make 2 dimensional array. It seems that it's impossible. Author of this (http://forum.dead-code.org/index.php?topic=723.msg5510#msg5510) topic said "On the other hand I managed to hack Dijkstra's algorithm (breadth-first search) to work with wintermute and its single dimensional arrays", but topic is quite old and new versions of WME were released since his post. So can you please tell me if there's any way to make a 2 or more dimensional arrays in WME ? Thanks

Pages: [1]

Page created in 0.037 seconds with 22 queries.