Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

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

Pages: [1]
1
Technical forum / Re: 2 actors in a scene
« on: November 16, 2004, 06:54:22 PM »
The runtime error is right, this method only works for entities, simply because they are static so it's easy to set a target point for them. Actors move so even of you'd set the point relative to actor's current position, that point could be easily invalidated when e.g. the actor is stading beside a blocked region. In other words, if you want one actor to walk to another actor you'll have to script that explicitly.

Yeah, that makes sense.  Hm-hm... I can see a bunch of problems coming my way now. Oh, well...  ::)

I tried that and it seems to work ok for me. If the walking part fails, perhaps the actor is unable to walk to that point for some reason? (missing waypoints etc.).

You are right, I messed it up. It works now...
Thank you again!

2
Technical forum / 2 actors in a scene
« on: November 16, 2004, 07:27:15 AM »
Hey, beautiful people!

OK, I ran into a problem again. Maybe it was the late hour of the nite, or my stupidity, but nevertheless here it is:
On a scene I've set two actors. One of them is my regular, player controlled actor, the other one is Molly - the woman from the demo. :)
Anywayz, I took things for granted and didn't really do anything with her until know, when I wanted to test interactivity between my two actors.
On scene_init I load her (Molly) up, I make her interactive, movable, visible and I attach a script to her (a customized scene_object WME template). Also, on some random event I want to make her walk to a certain entity. Now these are my problems:

- When I try to walk to her, talk to her, take her or look at her, everything in the attached script works except the walking part. It gives me runtime error. In the script I have the default actor.GoToObject(this), but the log says that method needs an entity parameter. How do I reference Molly in this case? I thought "this" works for everything.

- When I try to make HER walk to the entity - she doesn't. I use the typical Zenska.GoToObject(Scene.GetNode("sign")); <- where Zenska is a global variable defined in base.inc with Molly loaded in. Now, she does do the WalkToDirection part (she turns in the place where she is), but she doesn't do the WalkToX and WalkToY part of the GoToObject instruction. The "sign", of course, has all that WalkTo properties set.

That's it, now you... ;)

3
Technical forum / Re: People talking in their own fonts...
« on: November 09, 2004, 07:18:30 AM »

To have the different races and people in a game speak in different fonts... like elfish and alienese...

Excerpt from WME help:

Code: [Select]
ACTOR
{
  NAME = "MyActor"
  CAPTION="My brand new actor"
  X = 100
  Y = 100
  SCALABLE = TRUE
  INTERACTIVE = FALSE
  COLORABLE=TRUE
  ROTATABLE = FALSE
  SOUND_PANNING=TRUE
  SCRIPT="actors\MyActor\MyActor.script"
  FONT = "fonts\outline_red.font"

Description:
NAME - the internal name of the actor
CAPTION - actor's caption
X, Y - the initial position
SCALABLE - whether the actor is affected by the scene scaling
INTERACTIVE - whether the actor appears to be interactive (it reacts to mouse events)
COLORABLE - whether the actor is affected by the scene coloring
ROTATABLE - whether the actor is affected by the scene rotation definition
SOUND_PANNING - specifies whether all the sounds generated by this actor are automatically panned depending on his position on screen
SCRIPT - the script assigned to this actor (there can be multiple SCRIPT lines)
FONT - the font to be used for actor's speech subtitles


As you can see, you've got the font property that you define for an actor. I guess the same goes for entities. Actually, I am not too excited about this. I was hoping that I could have one speech font for all the actors and entities, and just change the color, but this way I will have alot of font files with manually colored fonts... :( Well, what can one do.

4
Technical forum / Re: Project Joe GUI
« on: November 04, 2004, 10:39:43 PM »
A-hem... :)

Okey, I started with something similar but then I found much simpler way to do it, but I still have one problem which, as I can say just by looking at it, would remain if I used your code.

In game.script I define a variable DePressed which has the same function as yours ClickStarted, and then on LeftClick:

Code: [Select]
on "LeftClick"
{
  DePressed = true;
  // what did we click?
  var ActObj = Game.ActiveObject;
  if(ActObj!=null)
  {
    // clicking an inventory item
    if(ActObj.Type=="item" && Game.SelectedItem==null)
    {
      Game.SelectedItem = ActObj;
    }
    // using an inventory item on another object
    else if(Game.SelectedItem != null && Game.SelectedItem!=ActObj)
    {
      var Item = Game.SelectedItem;
      if(ActObj.CanHandleEvent(Item.Name)) ActObj.ApplyEvent(Item.Name);
      else if(Item.CanHandleEvent("default-use")) Item.ApplyEvent("default-use");
      else if(ActObj.CanHandleEvent("default-use")) ActObj.ApplyEvent("default-use");
      else actor.Talk("Ne mogu to uciniti!");
    }
 

   else if(ActObj.CanHandleEvent("Take") || ActObj.CanHandleEvent("Talk") || ActObj.CanHandleEvent("LookAt"))


    {
      // THIS   IS   THE    IMPORTANT STUFF!

      MenuObject = Game.ActiveObject;
      var Caption = WinMenu.GetWidget("caption");
      Caption.Text = MenuObject.Caption;

      Sleep(300);

      if (DePressed == true)
        {

        // adjust menu's position
        WinMenu.X = Game.MouseX - WinMenu.Width / 2;
        if(WinMenu.X < 0) WinMenu.X = 0;
        if(WinMenu.X+WinMenu.Width>Game.ScreenWidth) WinMenu.X = Game.ScreenWidth-WinMenu.Width;

        WinMenu.Y = Game.MouseY - WinMenu.Height / 2;
        if(WinMenu.Y<0) WinMenu.Y = 0;
        if(WinMenu.Y+WinMenu.Height>Game.ScreenHeight) WinMenu.Y = Game.ScreenHeight-WinMenu.Height;

        WinMenu.Visible = true;
 
        actor.Reset();
        }
      else
        {
        actor.GoToObject(ActObj);
        }
    }


    // just a simple click
    else ActObj.ApplyEvent("LeftClick");
  }
  // else propagate the LeftClick event to a scene
  else
  {
    Scene.ApplyEvent("LeftClick");
  }
  if(Game.InventoryVisible == true) Game.InventoryVisible = false;

}

As you can see, everything is practicaly template stuff, except that if I see that the active object can handle verbs, I do a Sleep, and then check if DePressed is still true. If it is I show the verb bar. Now, I am wondering if that is safe to do. The test project I am working on is very simple so I don't want for this to back fire on me in more complicated scenes. I am afraid that doing a Sleep in such a shortlived event such as LeftClick could screw something up with rest of the stuff going on at the same time.

Here is the LeftRelease:

Code: [Select]
on "LeftRelease"
{
  DePressed = false;

}

Now, with this I managed to get the verb bar to show. However, the player still needs to actualy CLICK on the verb. In Project Joe, however, one has to RELEASE the button over the verb and then stuff happens. I tried to do this...

Code: [Select]
  DePressed = false;
  if (WinMenu.Visible==true)
  {
       WinMenu.ApplyEvent("LeftClick");
       WinMenu.Visible=false;
  }

If WinMenu is visible, I tried to simulate the LeftClick on what ever verb has the focus, but this doesn't work.

Now, if I am way off track tell me, but if not, I think this is a very simple way to do this kind of thing, if I could just wrap it up with correct Release handling. :)

What I am looking for, I guess, is a way to reference a focused button on a Window and then ApplyEvent it on a active object...


5
Technical forum / Project Joe GUI
« on: November 04, 2004, 08:57:51 PM »
OK, I guess everybody tried Project Joe. My artist insists that we should use the same principle for displaying the verb bar and inventory (hold left-click = verb bar, right-click = inv). Now, I don't really like it, but whatever. How can I do the verb bar part? I guess I still don't have a grasp on how those game.script and game_deamon.script work and interact together, and where should I start with this, but I think that solving this would really help me. I know I should do something with the timer, but where and how, beats the hell out of me... :(

6
Technical forum / Re: BUG with ToInt?
« on: November 04, 2004, 08:50:29 PM »
I have this in scene_init.script

global PuzzleArray = new Array(64);

Can I reference this from another scripts?


Yeah, I started working in WME recently and that puzzled me, too.
You gotta define that variable as global again in any other script you wanna use it in, and instead of getting an error or wiping it's data - you will be able to reference it.  ???
I find that a bit weird. :)


7
But generally speaking, IMHO it's best not to let the player to walk freely at the staircase, but better override the up/down walking simply by using custom animations, i.e. the actor walks to the stairs, the game switches to non-interactive mode, aimation is played where the actor walks up/down the stairs, then the game becomes interactive again and the actor continues walking.

Yeah, I came to that conclusion too. I guess there really is no need for actor to roam around the stairs since there is nothing for him to do except go up or down...

Anywayz, thank you very much for your quick support, this is like having a WME tutor of my own :)
Here's to you,  ::beer ,  and I'm back to work.

Vatre

8
Thank you for such a quick response, Mnemonic!

Anyway, let's get to the real deal...

In one of the scenes, I've got stairs running down into the floor, like to a basement. I've got problems getting my actor to follow the steps. Staircase is laid out left-to-right, and in front of it is an entity that masks the actor when it comes on the stairs-region that is behind that entity. However, that stairs-region, of course, must follow the steps, and therefore, on a scene it actually goes diagonally, up-left to down-right. Now, I managed to keep the scale of the actor constant using the scale property of the stairs-region, but actor still uses a "dr" sprite when walking down the stairs, and "ul" sprite when coming back up, and that looks wierd. Is there any way to force a "rr" and "ll" sprites to when walking on that region?
Also, to get the actor to find his way down the steps, I had to remove the floor region from the part of the floor in front of the stairs-hole. There is now the masking entity and stairs-region I mentioned. However, it looks silly that you can't go to that part of the floor.

So what am I really talking about is having two (or more?) overlapping regions, but forcing an actor to use different paths (and animations), depending on where he came to the area with overlaping regions from. In my case, I would like to walk all over the floor in front of the stairs-hole, but when (and only then)  I click an entity that makes him go to the staircase, he should use another path, walking on the stairs-region, behind the masking entity, using a different set of sprites...

Pfff... I hope this make sence. :D

9
Hey, everybody!

I am new here (not new to scripting and/or programming), just started playing with WME a few days ago. I am testing it to see if it fits our needs, and I gotta say - I like what I see...  ::rock
Me and my friend (The Artist Not Really Known At All)  grabbed a few discarded sprites and backgrounds and I went to work to make a simple two-scened "game" just to see what one can do in WME.

However, documentation seems rather confusing and not really updated. That is why I am posting here, and I guess you will hear more from me...

First thigs first - options/features like close up layers and rotation levels (both found in Scene editor) are not mentioned anywhere in the docs. Now, I am already using CloseUp layer for "zooming-in" certain parts of the scene (for example, when one opens a cabinet drawer I could activate Close Up layer with drawer contents drawn nicley). As I understand, it is exclusive and can hold interactive entities/items so I suppose it's purpose is to do exactly what I did. Am I right? Rotation levels, however, left me puzzled. I saw no effect on the actor nor other entites, so I would really like if someone could explain just what they do.

What really scares me is the fact that, while searching this forum, I found a lot of code samples using methods/attributes of objects I never saw in the docs. How much of the funcionality is kept undercover like this?!  :o I could spend days solving a problem while I could use an undocumented function... I don't like the sound of that...  ???

Now, this is it for now, gotta go back to my real job  >:D but I'll be back soon with interesting problems including staircases that go into floors and various similar mindbending stuff... ;)

Vatre

Pages: [1]

Page created in 0.031 seconds with 24 queries.