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.

Topics - The Man

Pages: [1] 2
1
Technical forum / Skip Entity.PlayTheora
« on: November 11, 2014, 01:50:13 PM »
Sorry if this has been asked before, but I couldn't find anything about it in the forum!
I'm using entities to play my videos because when I use Game.PlayTheora the quality of the video seems to decrease a lot (I really don't understand why!)

My question is: is there a way to skip videos that are played through an entity? I generally use a code similar to this:

Code: [Select]
var video = Scene.GetNode("video");
video.PlayTheora("name_of_the_video.ogv");
while (video.IsTheoraPlaying())
{
Sleep();
}

I'd be really grateful if someone could help me, because I'd hate to have to choose between having bad quality videos or unskippable videos!

2
Scripts, plugins, utilities, goodies / Custom hotspots system
« on: October 15, 2014, 03:08:41 PM »
For once I feel like I could contribute somehow to this great community we all belong to.
These past days I tried to implement the hotspot system which is available here as a free resource:

http://res.dead-code.org/doku.php/resource:displaying_hint_icons_over_active_hotspots

Although this system works very well it wasn't exactly what I was trying to achieve for two reasons:
1- The hint icons are positioned according to the X and Y attributes of the nodes of the scene.
2- The code automatically set an icon for EVERY node of the scene. What if I want the icons to appear only on the most important nodes?

IMPORTANT: probably there are thousand of ways to solve these issues, but I managed to do it my way, which isn't certainly the best one. The following guide is for those who really don't know what to do and can't find anybody who help them. I also have to point out that with this system you will have to program every hint icon individually. Here's the step-by-step guide:

1- Insert this line into base.inc:
Code: [Select]
global hotspot;
2- Insert this piece of code inside game.script:
Code: [Select]
function mostrahotspots()
{

 
    // make sure we're only displaying the icons once
    if(!hotspot)
    {

hotspot = true;

Sleep(200);

hotspot = false;
 
    }
}

3- Open up a scene with Scene-editor and create a new layer called "hotspots". DON'T make it a close-up layer, otherwise it will stop the game while it is active;

4- Inside this new layer create every hint icon you want to show in the scene. Give them names you will easily remember. (F.E. if you have a node in your scene that is called "table", just name its corresponding hint icon "tablehotspot";

5- Once you have all the icons you need, disable this layer so that the player will not see it.

6- Open up the Scene-init script and insert this piece of code AFTER the stuff which initializes the scene:

Code: [Select]
var hotspots=Scene.GetLayer("hotspots");
while(true)
{
  if(hotspot==true)
  {
    hotspots.Active=true;
Sleep(2000);
hotspots.Active=false;
  }
  else
  {
   hotspots.Active=false;
  }
Sleep(200);
}

7- Open again game.script and add this piece of code inside your "on Keypress":

Code: [Select]
if(Keyboard.KeyCode==VK_SPACE) mostrahotspots();
8- And the trick is done. Now when you press the spacebar (inside a scene you have set up) the layer "hotspots" will be shown with all the icons it contains.

ADVANTAGES
- You can control the exact position of your hint icons;
- You can decide which node will have a hint icon (avoiding every object on the scene to have one).

DISADVANTAGES
- It is not fully automated. You have to set up every scene and every hint icon;
- When you deactivate a node, you will also have to remember to deactivate its corresponding hint icon. Otherwise the icon will be shown even if the node is no more active.

I tested the code on various scenes and it looks like it works as it should! I hope this can be useful for somebody!

3
Technical forum / Dialogue Box problem
« on: October 13, 2014, 10:23:19 AM »
Hi Everybody! I'm trying to show a window behind the texts when my actors or entities talk! Reading various topics on the forum I succedeed in showing the window as I wanted to, but I'm having a problem with the Height of the window. In fact I don't know how to resize the Height attribute according to the dimension of the text. This is my code, which is placed into an entity script:

Code: [Select]
method Talk(srcString,srcActor,xPosition)
{
 
var twin;
if (srcActor == null) twin = "normal"; // basic window with ghost
else
twin = srcActor; // NPC window
       
var tmpState = Game.Interactive;
Game.Interactive = false;  // we save the interactivity state for later and turn it off
 
var dlgWin = Game.LoadWindow("riquadri\speechbubble.window"); // load the dialogue window
var tString = Game.ExpandString(srcString);  // prepare the localized string to handle formatting
var tLength = tString.Length;
var lines = ToInt(tLength / 320) + 1; // find out how many lines will we need


    if (xPosition != null) this.SubtitlesPosX = xPosition;


    this.SubtitlesPosRelative = true;
xPosition = this.SubtitlesPosRelative;
this.SubtitlesWidth = 320;
dlgWin.X= 464;
dlgWin.Width=330;



this.SoundPanning = false;  // make the sound centered
this.Talk(srcString, null, "", "", 0);  // say the line


Game.UnloadObject(dlgWin);  // dispose of the window


Game.Interactive = tmpState;   
 
}

I was thinking I can simply solve this by changing dlgWin.Height according to how many times the text start a new line, but is there a way to count the number of lines?
I'll try and explain better... let's assume the text which is currently shown just occupies one line. I'll simply set the dlgWin.Height attribute to 20 px. If the text occupies two lines I'll set the attribute to 40 px and so on. It looks to me like it could work, but I'm not quite sure about the sintax...
If this can't be done, what can I do to obtain the same result?

4
Technical forum / Scale the response window
« on: March 31, 2014, 06:09:50 PM »
Hello, everybody! I'll get straight to the point.
I wanted to scale my Response window according to the number of choices the players has got. Searching around the forum I have found this piece of code posted by Mnemonic:


Code: [Select]
var num = Game.GetNumResponses();
var resp= Game.GetResponsesWindow();

var height = num*20; // height of each line
resp.Height = height ;

Now, forgive me for my ignorance but where should I exactly put this code? In the window definition script? If so, where exactly?

5
Technical forum / SetCursor on MouseEntry/MouseLeave
« on: December 13, 2013, 12:49:14 PM »
Hi everybody! I tried to search something specific about what I'm trying to do, but couldn't find it!
Simply, when the cursor enters a region of the scene it should change into another cursor. Then when the cursor exit the region it has to turn back to its original shape. I tried this code and I thought it would work:

Code: [Select]
on "MouseEntry"
{
Game.SetCursor("sprites\system\mouse.sprite");
}

on "MouseLeave"
{
Game.SetCursor("sprites\system\Cursore.sprite");
}

...but obviously, it does not work. So what am I doing wrong? Can anyone help me?!

6
Technical forum / MusicChannel can't synchronize?
« on: May 21, 2013, 11:49:02 AM »
I'll explain my problem briefly. I have 3 musics for the first scenes of my game. These 3 musics are supposed to play simultaneously in the following way:
1- GDTheme: this is the main theme, with its volume always set to 100;
2- oldpiano: when entering a certain scene, I set this music's volume to 100. When leaving from the scene, I set it to 0;
3- Guitar: when entering a certain scene, I set this music's volume to 100. When leaving from the scene, I set it to 0;

In order to do this, the tracks must be completely synchronized, but I noticed they aren't... while if I test them on other programs, they do. In the first scene I have this code which starts all the tracks:

Code: [Select]
  Game.PlayMusicChannel(2, "audio\GDguitar.ogg", true);
  Game.PlayMusicChannel(3, "audio\oldpiano.ogg", true);
  Game.PlayMusicChannel(4, "audio\GreendartTheme.ogg", true);
  Game.SetMusicChannelVolume(2, 0);
  Game.SetMusicChannelVolume(3, 0);
  Game.SetMusicChannelVolume(4, 95);

Is there something I'm doing wrong, or is it a bug?

7
Technical forum / Actor back to default animation
« on: April 11, 2013, 12:13:56 PM »
I know it will sound stupid to most of you, but I've got this problem...

I need my actor to change his idle animation after a certain action and to obtain this I used the code:

Code: [Select]
actor.SetSprite("actors/Lars/ul/defaultposter.sprite");

The problem is I don't know how to go back to normality! If I use this code the actor will ALWAYS use "defaultposter.sprite".
Probably there must be a simple function to obtain what I need, but I can't find it!
Can somebody give me a help?

8
Game announcements / To Bury The Truth (A Lazarus Bundy's Adventure)
« on: July 26, 2012, 07:02:56 PM »
Hi to everyone! Since I'm using WME to create my latest project, I wanted to introduce it to the community of our favourite engine!
The game will be titled "To Bury The Truth (A Lazarus Bundy's Adventure)", as the subject of the conversation suggested, and it will be an old style 2D point&click adventure!
I won't give details about the plot yet, so just enjoy these first images and tell me what do you think about it!

OFFICE OUTSIDE
http://img560.imageshack.us/img560/1360/screen01sd.png

BUILDING SITE
http://img843.imageshack.us/img843/399/screen02p.png

A CLOSER LOOK TO LARS
http://img708.imageshack.us/img708/4136/screen04t.png

GARDEN
http://img580.imageshack.us/img580/4074/screen03e.png

THE CHALLENGE
http://img163.imageshack.us/img163/8996/screen05z.png

9
Technical forum / Horizontal Scrolling
« on: July 26, 2012, 06:35:42 PM »
Hi, everybody! I've been experiencing a problem with my last scene. I'll explain briefly!
The scene is a 1000x800 scene. What I wanted to achieve was a scene in which the screen would only scroll horizontally. I created then a 800x600 new scene and changed the scene's dimensions to 1000x600(In the "main" field), thinking this would do the trick.
It didn't.

Now, I don't understand where's the mistake! I followed the WME documentation and the procedure looks right... there must be some detail I misunderstood in the process! Can somebody help me figure it out?

10
Technical forum / Window Position over the actor's head
« on: March 18, 2012, 07:42:44 PM »
Sorry for the long title, I thought it would be more specific this way!
I'm using an Icon Based dialogue in my game, and I managed to do that using the guides I found here on the forum. The Window is correctly shown and I have the control over it, but there's something missing for which I could use some help:

The guide I used is great, but it sets the position for my dialogue window(with X and Y coordinates). What I want is the window to be positioned just over the head of my main character.
I searched the forum but couldn't find anything really specific for this question.

I hope somebody can help me! (But generally there's always somebody helpful around here!)

11
Technical forum / RightClick Inventory
« on: March 10, 2012, 02:01:40 PM »
Hello everybody!
I was trying to create an inventory that appears when you rightclick on the screen. I've been able to do that using this simple piece of code on Game.script:

Code: [Select]
on "RightClick"
{
 
  if (Game.SelectedItem != null){
    Game.SelectedItem = null;
    return;
  }
 
   Game.InventoryVisible=true;
 }

The inventory is closed when you move the mouse outside of it:

Code: [Select]
if(Game.MouseY > 487 || Game.MouseY <120 || Game.MouseX > 635 || Game.MouseX <160 || Game.ResponsesVisible || !Game.Interactive) Game.InventoryVisible = false;
The problem is this: the code works, but the game won't read the RightClick command anywhere else in the game... for example, if I put a RightClick event on an object's script:

Code: [Select]
on "RightClick"
{
  Game.Interactive=false;
  actor.Talk("A voler essere onesti ho un paio di monete di ottone e basta.");
  Game.Interactive=true;
}

The program doesn't do a thing. What I want to achieve is to have the Righclick as default command to examine, but when I rightclick on a point in the screen where there's nothing active, as objects or entities, the inventory is automatically loaded.
How the code should look like?

12
Technical forum / Screen Scroll Problem
« on: August 01, 2008, 11:01:16 AM »
Hi,everybody.I'm working on two different projects  with Wintermute.In the first project I've got no problems at all(at least,for now),since everything seems to work.In the second project I've just encountered a strange problem.I'll try to explain it.I've got this 1000x500 background that I want to use.When I use a background like this in the first project,setting the main dimension of the scene as 1000x600,the scene runs exactly how I want to.If you move from left to right,the scene simply scrolls following the main character.I dont' know if that's clear...the problem with the second project,is that the camera doesn't follow the actor...I use the same procedure,but the camera seems to be frozen,and when you move to the right of the scene nothing happens.The screen doesn't scroll at all...Is this a bug or do I have to set something different?

13
Technical forum / The right sequence will open the door...
« on: April 26, 2008, 04:58:54 PM »
I'll try to explain myself the best I can...
I have this first person scene in which you can see a bookcase.In this bookcase there are four interactive books,that must be pressed in a certain sequence in order to open a door.If a book is pressed,it plays an animation.After You pressed all four books,the program should check if they have been pressed in the right sequence,and if not,the player must be able to start again from the beginning.
What's the best way to do this?I think I have to use arrays in some way,but I dont' know exactly how to...

14
Technical forum / Icon dialogues
« on: April 15, 2008, 07:35:55 PM »
I've found the article on Wiki "Icon based dialogues"
I tried to use it,but it doesn't work.The problem is that I dont' know what I'm doing at all...
Firsi,it gives me a lot of errors:

20:09: CUIWindow::LoadFile failed for file 'windows\dialogueWindow.window'
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 21
20:09:   Call to undefined method 'AttachScript'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 42
20:09:   Call to undefined method 'CreateButton'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 46
20:09:   Call to undefined method 'SetImage'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 47
20:09:   Call to undefined method 'SetHoverImage'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 42
20:09:   Call to undefined method 'CreateButton'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 46
20:09:   Call to undefined method 'SetImage'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 47
20:09:   Call to undefined method 'SetHoverImage'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 42
20:09:   Call to undefined method 'CreateButton'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 46
20:09:   Call to undefined method 'SetImage'. Ignored.
20:09: Runtime error. Script 'scripts\dialogueObject.script', line 47
20:09:   Call to undefined method 'SetHoverImage'. Ignored.

And then...how my entity script should look like?
I know,I could use the standard dialogue method...but I want Icons!I need them!
Help me out....

15
Game announcements / An Alchemist Tale
« on: February 20, 2008, 08:59:19 PM »
Hello,everybody! I've almost finished the first chapter of my first game,called "An Alchemist Tale" and I wanted to post some image in this forum,since I'm using Wintermute.
Tell me what do you think about them!

http://img256.imageshack.us/my.php?image=04jx1.png
http://img256.imageshack.us/img256/8998/05bc0.png
http://img146.imageshack.us/img146/1372/06ta9.png
http://img175.imageshack.us/img175/4307/07fh0.png
http://img171.imageshack.us/img171/1995/01vb7.png

Pages: [1] 2

Page created in 0.021 seconds with 18 queries.