Menu

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.

Show posts Menu

Messages - Crimson Wizard

#11661
Ouch! One more mistake. You should enumerate them from 1, not from 0, because "0" means no music. If you make aMusic0, it will automatically play at room start (looks like a little bug to me).
I will test my own code now, 'cause I finally got some time.
#11662
MrNashington, I must apologize, I was mistaken about how to use old style audio system in the new AGS.

Previously I told you should put music in folder, but new AGS does not need that.
Instead, import your music in the "Audio/Music" node in your project tree, as you usually do, and make sure its ScriptName is "aMusicX" where X is number (aMusic0, aMusic1, aMusic2 etc).
#11663
Quote from: paolo on Fri 28/06/2013 07:52:19
And a secondary question (which maybe belongs in a separate post) - I also have AGS v3.0 installed. I know there is a lot to gain in using 3.0, but what are the risks in updating my game from 2.72 to 3.0? Is anything likely to break?
There's a whole section of manual dedicated to upgrading from 2.7 to 3.+:
http://www.adventuregamestudio.co.uk/wiki/Upgrading_to_AGS_3.0
http://www.adventuregamestudio.co.uk/wiki/Upgrading_to_AGS_3.1
also one about upgrading to 3.2 (but it is not present in website wiki, so check the manual that comes with AGS 3.2)
However, there are project settings that enable backwards compatible mode (related to script mainly) and make things easier. You probably won't have to change much.
#11664
Quote from: Ryan Timothy on Fri 28/06/2013 00:44:26The setup file needs to be reorganized really. It looks pretty clunky. Perhaps I'll look at making a Photoshop rework. Does the setup file easily allow for all form controls and such?
Winsetup is integrated in the engine and is written with WinAPI using basic Windows controls.
#11665
Ooops, sorry monkey, I re-read that sentence and I see that I previously read it opposite to what it sais. Sorry, nevermind.
#11666
I must apologize for forgetting to post my second opinion on this; seeing as this suggestion being posted in the project tracker, I think this need more discussion.

Thing is, that AGS allows to replace view frames with dynamic sprites, which could be Tinted, or else modified. This really makes such properties excessive, in my opinion.

The reason why I think so is that the number of possible effects one can apply on a sprite is very large, and if we are going this way we may eventually put hundred of options on a view frame.
#11667
All you have to do is ask couple of simple questions:
Quote from: Crimson Wizard on Wed 26/06/2013 10:54:48
I want to clarify, is the OROW theme-based competition, or one is free to choose the topic/concept?
How will the jury make sure that nothing premade was used?


I now feel like a troll :D.
#11668
Alright. Next problem.
How to make a list of non-repeating tunes?

Code: ags

int OrderList[MAX_TUNES]; // this will keep indexes of tunes in random order
bool TunePicked[MAX_TUNES]; // array which tells if the tune was already put into the random list

function Shuffle()
{
   // First, mark all tunes as unused
   int slot = 0;
   while (slot < MAX_TUNES)
   {
      OrderList[slot] = -1;
      TunePicked[slot] = false;
      slot++;
   }

   // Now fill in the random list
   slot = 0;
   while (slot < MAX_TUNES)
   {
      // get random tune id
      int tune_id = Random(MAX_TUNES - 1);
      // is it already used?
      if (TunePicked[tune_id])
      {
         // then iterate through the list to find nearest available tune, starting with the next index
         int find_tune = tune_id + 1;
         bool is_found = false;
         // seek until we find available tune or returned back to random index we got previously
         // (the latter should not normally happen) 
         while (!is_found && find_tune != tune_id)
         {
            // went over the end of list? get to the beginning
            if (find_tune >= MAX_TUNES)
               find_tune = 0;
            // did we find a free tune?
            if (!TunePicked[find_tune])
               is_found = true;
            else
               find_tune++; // try next
         }
         // remember the free id we found
         tune_id = find_tune;
      }

      // so, now we have a tune id!
      // mark it as used:
      TunePicked[tune_id] = true;
      // keep it in the list
      OrderList[slot] = tune_id;
      // move on!
      slot++;
   }

   // In the end we should have "OrderList" array filled with random tune indexes
}




//------------------------------------

How to use this list of random tune indexes.
Code: ags

int CurrentTune;

//--------------------------
// add this in the end of the previously mentioned "Shuffle" function:
CurrentTune = 0;
//--------------------------

// function that plays next random tune:
function PlayNextTuneFromRandomList()
{
   int tune_index = OrderList[CurrentTune];

   // new audio system:
   AudioClip *tune = RadioTunes[tune_index];
   tune.Play();
   // old audio system:
   PlayMusic(FIRST_TUNE_ID + tune_index);
  
   CurrentTune++; // this will make another tune playing next time
   if (CurrentTune >= MAX_TUNES)
   {
      // oops, tune list is over.
      CurrentTune = 0; // start from the beginning, or....
      Shuffle(); // re-shuffle tunes
      // the choice is yours!
   }
}




Sorry, but all this code is not tested in real game! Feel free to blame me if something goes wrong.

E: I really hope someone will test this and tell if its working. I am almost asleep as typing this.
Also.... I think it is NOT a Beginner's Technical Question, but rather an Advanced one. ;)
#11669
Quote from: Ryan Timothy on Thu 27/06/2013 16:15:38
If possible, we could add a blue question mark like this:   Scaling  [?]
Which will popup a small description if you hover over it.
But there IS a description, right under the option. :-\
#11670
Omg omg omg, Adeel. I am at risk to give "ruthless answer" here. :)
How this will work if there are 100 songs?
Also, repeatedly_execute is been called 40 times per second. Meaning you will restart the music over every 1/40 second.

MrNashington, first thing you should know is that the new Audio system that AGS uses since v. 3.2 is not much compatible with random picking.
I will give two examples, first for new Audio system, second for old one.
To enable old system: go to Global Settings, find "Backwards Compatibility" group and set "Enforce new style audio system" to FALSE.
(You can actually use both systems in this case, which may be beneficial).

The examples I am about to show here play a random music every time (it will likely repeat some of them). I think it is something to start with.

Using new system:
Code: ags

#define MAX_TUNES 10
AudioClip *RadioTunes[MAX_TUNES];

function game_start()
{
   RadioTunes[0] = aTune1;
   RadioTunes[1] = aTune2;
   RadioTunes[2] = aTune3;
   .... etc ....
}

function PlayRadioTuneAtRandom()
{
   AudioClip *tune = RadioTunes[Random(MAX_TUNES - 1]];
   tune.Play();
}


Using old system, import your music in the "Audio/Music" node in your project tree, as you usually do, and make sure their ScriptName is "aMusicX" where X is number, starting from 1 (aMusic1, aMusic2, aMusic2 etc). Make your tunes have sequential numbers. Then, to play a random one of them do simply this:
Code: ags

#define FIRST_TUNE_ID 1  // change to real number (first tune id)
#define MAX_TUNES     10 // change to real number (total number of tunes)

function PlayRadioTuneAtRandom()
{
   PlayMusic(FIRST_TUNE_ID + Random(MAX_TUNES - 1));
}
#11671
Very nice.
Does it allow 256 characters? Alan v.Drake's Draconian Edition supports 256-chars WFN, also he added this support into development branch of AGS.
Will a source code be released? Simply being curious.

I'll be trying it out for certain.

E: It works in the new editor version with floating panels, but obviously not really fit for resizable window. I don't know if it will be easy to add size constraints to a floating panel. Currently font editor looks tad ugly on it.
#11672
Go to Audio -> Types and select (double click) type "Sound". What is the value of "Max Channels" property?
I have a suspicion it may be set to 1. If it is, set it to larger number, or 0 (unlimited).

E: I forgot to ask what type are your aSoundX clips? You need to check corresponding type.
#11673
Quote from: Ali on Thu 27/06/2013 13:54:37
Maybe 'filter' is not particularly helpful either, from a player's perspective.
Scaling mode?
Scaling?
#11674
Quote from: nneader on Thu 27/06/2013 15:55:43
Is there any added benefit/drawback having the gui visibility be false/true rather than having the label visibility be false/true?
If you mean that GUI is fully transparent, then there's no difference at all.

E: Hmm, wait, what about Clickable property? I suddenly realized I don't remember if transparent GUIs still capture mouse clicks.
#11675
Miguel, I think what Khris means is that your choice of agreeing/disagreeing with parts of Bible or Pope's opinion is like extracting parts of the house wall and still assuming roof will not fall down no matter what.

Why do you believe in God? Because you saw him? Or because Bible, or Pope, or Christians (parents, friends) taught you? If it is the latter, meaning you get this belief from the book, how do you decide which parts may be questioned and which not? I think that's most important question here.
#11676
Maybe there's a point in renaming "Graphic filter" to "Scaling filter"?
Generic "Graphic filter" gives thoughts about shaders and screen effects.
#11677
Quote from: monkey_05_06 on Thu 27/06/2013 05:59:34
Expanding on CW's example, if the array does need to be global (e.g., you need to access it from multiple scripts), then you could do that like this:
I am afraid this sentence may cause confusion (actually it did to me). What do you call "global" array? In your example it remains global, just kept in different module.
#11678
There's a typo in "Strenght".
But the game looks really good and stylish!
#11679
Editor Development / Re: Custom Speech Render
Thu 27/06/2013 08:31:59
I just want to add, I said three functions because I was considering an option to run speech in non-blocking (asynchronous) fashion.
Though I don't know yet how to organize this. Maybe blocking speech could run only in speech_begin (with Wait() calls) and then set some "end" flag, while "speech_render" (or "speech_play") could be called in a way like repeatedly_execute once in a tick until speech is over (timed out or skipped).
This would allow any dynamic changes on speech lines (non-blocking way), like dynamically typed letters, floating portraits, other screen effects.


PS. monkey, you may as well put "#1 Crimson Wizard basher" in your text. :)
#11680
The new 3.3.0 has even x8 zoom just in case :).

Also, I should perhaps remind that the new version of the engine can run old games of versions >= 2.50.
More info here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=47966.0 (see "Backward Compatibility" section).
SMF spam blocked by CleanTalk