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 - The Man

Pages: [1] 2 3 ... 5
1
Technical forum / Re: New scene ?
« on: January 21, 2015, 03:15:45 PM »
Look, if you open up Wintermute and click on the "help" button you'll find a useful tutorial that will help you a lot. Just click on Help, then search for the "inside a game" section and you will find a "scene creation step by step".
That's how I started. It will explain you the basis of a project.

2
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!

3
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!

4
Technical forum / Re: Dialogue Box problem
« on: October 14, 2014, 10:10:00 AM »
No idea? I tried using a fixed-width font, counting how many characters are there in a single line, but it won't work. I'd solve it in a while if there was a Subtitles.Height attribute, but I don't think it exists!

5
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?

6
Technical forum / Re: Scale the response window
« on: March 31, 2014, 06:31:53 PM »
It doesn't seem to work! I know I'm doing something wrong, but I can't understand what! Here's my code:

Code: [Select]
function FabbroDialogue1()
{

var Responses;
var Selected;
var Loop = true;

  while(Loop)
  {
   
    Responses[41] = "Sa dirmi quanto dovrebbero durare questi lavori?";
    Responses[26] = "Ho bisogno della sua incredibile abilità col saldatore.";
Responses[28] = "Eppure io non le vedo.";
Responses[30] = "Diamine, il tricheco aveva ragione.";
Responses[1] = "La lascio al suo lavoro, mentre io andrò a godermi questa splendida giornata soleggiata. Forse andrò persino al mare.";

 
    Game.AddResponseOnceGame(41, Responses[41]);

if (devosaldare==true)
{
    Game.AddResponseOnceGame(26, Responses[26]);
}

if (provocazione2==true)
{
    Game.AddResponseOnceGame(28, Responses[28]);
}

if (provocazione4==true)
{
    Game.AddResponseOnceGame(30, Responses[30]);
}

    Game.AddResponse(1, Responses[1]);

var num = Game.GetNumResponses();
var resp= Game.GetResponsesWindow();

var height = num*20;
resp.Height = height ;
   
Selected = Game.GetResponse();
actor.Talk(Responses[Selected]);

[...]


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

8
Technical forum / Re: SetCursor on MouseEntry/MouseLeave
« on: December 13, 2013, 04:56:43 PM »
If you click at your region in the SceneEdit, you will see on the left side a properties panel (Name, Caption, Sprite, Cursor, Font, Item).

Changing SPRITE will (I believe) do what you want. :)

I'm sorry, I understood what I was doing wrong. I was creating a Region and not a Region Entity! That is why I could not see those options!

Thank you very much, you're always a big help!

9
Technical forum / Re: SetCursor on MouseEntry/MouseLeave
« on: December 13, 2013, 02:47:14 PM »
Forgive me, but I don't see the option for changing the cursor image in a region!
What I wanted to do was the cursor to assume a certain image when inside a region without having to set the sprite for every node that's inside that region! Anyway, thank you!

10
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?!

11
Technical forum / Re: MusicChannel can't synchronize?
« on: May 21, 2013, 12:49:03 PM »
Allright... I just wanted to be sure I wasn't doing something wrong!
Thanks to both of you for the answers!

12
Technical forum / Re: MusicChannel can't synchronize?
« on: May 21, 2013, 12:28:28 PM »
The idea is that every scene should ADD SOMETHING to the music. When you enter to a scene there's a street guitarist who's playing a song which should play ONLY in that scene, for example. The problem is that if the guitarist music is not synchronized it will sound bad.

13
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?

14
Technical forum / Re: Actor back to default animation
« on: April 11, 2013, 02:14:38 PM »
I knew it had to be THAt easy.
Thank you very much and I apology for opening such a simple thread!

15
Technical forum / Re: Actor back to default animation
« on: April 11, 2013, 01:11:47 PM »
But if I use again SetSprite the problem persist because the actor will use THAT sprite("other") for every standing animation...

Pages: [1] 2 3 ... 5

Page created in 0.024 seconds with 23 queries.