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

#12841
While I admire both artists' skills, I must be frank in telling that I vote for Daniel Thomas's background at every position. It has original concept (not of Valhalla on its own, but rather on how the entrance looks like), varied landscape and lots of eye-catchy details.
#12842
Quote from: wolverine79936 on Wed 19/09/2012 19:24:36
ACK! I just got done filling in all of the walkable areas in my room and now my crocodiles are swimming all over the screen. One even swam off the screen never to return. (ROTFL!) How can I confine them to one specific walkable area?
That is something I would certainly like to see in the next versions of AGS. Unfortunately I never heard about the general solution for current version :/

You may try making sure there's always some space between two walkable areas.
#12843
Quote from: icey games on Wed 19/09/2012 00:50:25
So is thus still open like for people to join, I thought about entering earlier but I got sidetracked
MAGS are open to join anytime until the deadline. That means you may actually try to make a game one day before competition is closed :).
#12844
Quote from: wolverine79936 on Wed 19/09/2012 12:40:20
I was just wondering, I have a room in my game with a lot of stuff going on. Yet, there is a 50/50 chance that when I quit/close/alt-f4 my game, that it will freeze and tell me that AGS has stopped responding.

Can a blocking function or action cause this reaction if it is not properly unblocked or whatever the proper term is?
First of all, blocking action does not *really* block program execution, it blocks the game process with exception to what the action does. So blocking actions (like blocking character movements) should never prevent game from normally close on alt+x, alt+F4 etc.
I am not sure about endless loops in scripts (don't remember details right now) but I strongly doubt that they may cause application to freeze completely. Actually they do. :(
Does the game freezes even if you quit by choosing an option from game menu? If yes, then it has nothing to do with blocking actions.
Does this happen in any room, or only in certain rooms?


EDIT: Hmm, actually I was wrong. Endless loop in script WILL hang the app! :)
#12845
Quote from: deadmonkey_05_06 on Wed 19/09/2012 09:10:37
Either that or they all just stop talking when I log in...

This :P.
#12846
Editor Development / Re: Transition to .net 4?
Wed 19/09/2012 12:35:33
Quote from: JJS on Wed 19/09/2012 12:04:35
To produce a standalone title for iOS you obviously need the iOS SDK which is only available for OSX. So if you want any kind of integration of the SDK into the AGS Editor you need a Mono port of the editor.
Awww, right, I got so used to run games as a separate dat file, so I am starting to forget how they are normally built. :)
#12847
Editor Development / Re: Transition to .net 4?
Wed 19/09/2012 11:08:22
Quote from: tzachs on Wed 19/09/2012 10:14:41
Afaik, mono is the best option we have in order to be able to compile games for iOS directly from the editor
Perhaps I missed something, why cannot games be compiled for iOS from Windows?
Or you mean allowing people to generally work with Editor under iOS?
#12848
Well... there's definitely numerous options for that.
Yeah, right few days ago I was playing KQ1, so I know what you are up to :).
Crododile could be done either by character, or by object (in which case different function is used, not Walk, but Move). Although I think that character is better because it is easier to do swimming animation. Also you may use same character in any number of rooms, wile object is staying in one room all the time.
Regarding moat geometry - you may split moat into rectangular parts and first randomly choose one of them, secondly choose coordinates inside choosen rect.
#12849
Quote from: wolverine79936 on Tue 18/09/2012 20:47:28
AddWayPoint appears clumsy for what I am trying to do. Simply have the crocodile swim aimlessly around a rectangular moat. I would think there would be a way to just tell AGS to aim him randomly and keep him within the moat.
Yes there's.
Since moat is defined as rectangle, most basic way to do this would be this algorythm:
- each game tick check if croc is moving now;
- if he does, don't do anything yet;
- if he doesn't, then choose a random point in the given rectangle and send him there in non-blocking fashion.
- repeat.
Algorythms like that are usually implemented inside "repeatedly_execute" functions. Since the crocodile appears in certain room only, it should be "Repeatedly execute" event handler function for that room.
In the following example I put crocodile code in a separate function that is being called from rep_exec in sake of code readability.
Code: ags

function UpdateCrododile()
{
   if (cCrocodile.Moving)
      return;
   int x = MOAT_RECT_X1 + Random(MOAT_RECT_X2 - MOAT_RECT_X1);
   int y = MOAT_RECT_Y1 + Random(MOAT_RECT_Y2 - MOAT_RECT_Y1);
   cCrocodile.Walk(x, y, eNoBlock, eWalkableAreas); // don't block, stay and moat's walkable area (I assume there's one prepared for him)
}

// Then in room's rep_exec
function room_RepExec()
{
    // call croco update
    UpdateCrododile();
}


Sort of that...
#12851
Site & Forum Reports / Re: Server migration
Tue 18/09/2012 18:35:45
I am not in US, but I it is a bit slow for me...

EDIT: Erm.. well, it's varied, but sometimes quite slow.
#12852
Editor Development / Re: Transition to .net 4?
Tue 18/09/2012 18:35:15
Does this mean one have to have Visual Studio 2010 to build Editor?
Does VS2010 Express edition allows to build mixed-code projects? I may be mistaken but I have vague memories someone told me it can't; do not know if that's true.
Question is, will there be any problems building AGS.Native library?
#12853
You cannot cast integer value (System.Volume) to string (lblVolume.Text) like that.
Printing numbers into string is done by the use of Format function.
You should definitely check manual for that, but here's quick example:

Code: ags

lblVolume.Text = String.Format("%d", System.Volume);


EDIT:
With "off":
Code: ags

if (System.Volume > 0)
{
   lblVolume.Text = String.Format("%d", System.Volume);
}
else
{
   lblVolume.Text = "OFF";
}
#12854
Depends on AGS version.
In AGS 3.2 it is System.Volume for master setting and AudioChannel.Volume for each of existing audio channels.
#12855
Uuuhhhh....
I made a long post here couple of days ago, but it seems that recent server failure erased it :/

Actually, just like KodiakBehr, I was wondering what exactly is the problem. Also - how do you like that rolling dice look like: should it simply change sides, or move around the screen, etc?
Considering the topic title is "Don't know how to script" I wanted to mention an example of how the dice could be animated to show random sides for a period of time.
Assume that we have a room object called oDice, and we have imported six sprites - each with corresponding number on it. We are also assuming that those sprites are imported having sequential ids.
Following function simulates dice roll by changing object graphic over time, and finally setting "real" number on top.
Code: ags

function AnimateRollingDice(int real_number) // we expect numbers 1 - 6
{
   int number_one_sprite_id = < PUT ACTUAL SPRITE ID HERE >;
   int turn = 0;
   while (turn < 20) // increase or decrease 20 if wanted
   {
      oDice.Graphic = number_one_sprite_id + Random(5); // set random dice graphic between 1st and 6th sprite
      Wait(2); // make little delay; this might need testing to find appropriate time period between two changes
      turn++; // next change
   }

   // finally set actual number
   oDice.Graphic = number_one_sprite + real_number - 1;
}

Put this function to room script.

Now when we have this function we may call it at the moment when player have thrown dice and got new number, like this:
Code: ags

int new_dice_number = Random(5) + 1; // random returns 0 to X, so this expression means (random from 0 to 5) + 1, which means (random from 1 to 6)
AnimateRollingDice(new_dice_number); // simulate dice roll
// now we may use new_dice_number further
#12856
Quote from: slasher on Fri 14/09/2012 21:54:56
whilst i am digesting what you have written i would like to add that the listbox is separate from the inv gui which is included in the game. The listbox is more an instant visual thing. I could of course just have inv in view all the time but i don't. The listbox was something i thought would make a nice touch.

I was going to use a label and append it. unfortunately i don't know if you can take text away from that.. sort of opposite of append. Anyhow...
Do you mean that the ListBox is simply an extra visual representation of Inventory contents? Well, I can't say that's a bad decision. Probably you may try both ListBox and Label options and find what suits you better.
Regarding working with text in Label. If I understood correctly, you have problem removing parts of text from existing string. Actually there's no other way than to reconstruct the string all over again each time the item is removed. That's not difficult if you use generic algorythm for both adding and removing items, based on loop (similar to what I showed above).
For example, assuming your label is called gInventoryLabel:
Code: ags

function MakeInventoryLabel()
{
   gInventoryLabel.Text = ""; // make string empty first
   int i = 0;
   while (i < Game.InventoryItemCount) // check every possible inventory item in the game
   {
      if (player.InventoryQuantity[i] > 0) // if player has such inventory item
      {
         gInventoryLabel.Text = gInventoryLabel.Text.Append(inventory[i].Name); // append inventory item name to the string
         gInventoryLabel.Text = gInventoryLabel.Text.AppendChar('['); // append special 'linebreak' character to the string
      }
      i++; // next item...
   }
}

Then, you just run this function every time an item is added or removed. This will update label's text. The text is constructed all over again every time, but that's fast operation and won't slow down the game.
There may be a serious problem, however, that the number of items will be too large and won't fit into label. In this case you'll have to somehow limit the number of lines displayed and script scrolling... so it's more work actually.
#12857
Quote from: slasher on Fri 14/09/2012 20:16:30
But what if you do not know what the player picks up first?
That's very good question. In fact, if you want to make a good script, you should assume exactly that - that you don't know the order of those items in the list.
Unfortunately AGS script does not provide direct means to get a listbox item by name. However, you may use following solution.
You may get item's text by the use of ListBox.Items array. For example:
ListBox1.Items[0] - returns first item's text;
ListBox1.Items[ListBox1.SelectedIndex] - returns selected item's text;
If you know what exactly inventory item are you using, you can find a list item that has same name.

Code: ags

int i = 0;
while (i < ListBox1.ItemCount) // search from first to last item
{
   if (ListBox1.Items[i] == "Fly")
   {
      // found it!
      ListBox1.RemoveItem(i); // remove this item
      i = ListBox1.ItemCount; // a trick to end the loop right away
   }
   i++; // next item...
}


Now, how to use this in your game - that depends on how using of inventory items is scripted in there. You gave no details about that, but let's assume that at certain point (when item is being used) you have the item's script name (such as iFly, for example).
We make a separate function that take the used item as parameter and removes it from the list:
Code: ags

function RemoveItem(InventoryItem *used_item)
{
   int i = 0;
   while (i < ListBox1.ItemCount) // search from first to last item
   {
      if (ListBox1.Items[i] == used_item.Name)
      {
         // found it!
         ListBox1.RemoveItem(i); // remove this item
         i = ListBox1.ItemCount; // a trick to end the loop right away
      }
      i++; // next item...
   }
}


Then you call that function, like:
Code: ags

RemoveItem(iFly);


This code is just an example, and may be optimized or used differently depending on how you write your game's script.

EDIT: fixed one mistake in my code.

One more thing though, may I ask why do you use ListBox, and not InventoryWindow GUI? Just want to be sure you are aware of it. InventoryWindow solves all those problems automatically.

#12858
The items in ListBox are zero-based, that means that first is 0, second is 1, and so forth.
Or, generally, the Xth item has index of (X-1).

Quote from: slasher on Fri 14/09/2012 19:51:20
Is this the correct way of removing an item: if 3rd in list remove(2), if 6th item in the list remove(7) ?
I don't know how you got this idea (3rd = 2, 6th = 7). Anyway, it should be:
3rd: 3 - 1 = remove(2);
6th: 6 - 1 = remove(5);

Also, take into consideration that after you remove one item, all the following are being moved up once. So if you want to remove several items in sequence you'll have to recalculate their position after each is removed.
For example, you want to remove 3rd, 6th and 10th items one by one.
Remove(2) - removes 3rd; but the following items are now moved up and the 6th item is now 5th, 10th item is now 9th.
Remove(4) - remove 4th (former 5th); the 9th item (former 10th) is now 8th.
Remove(7) - remove 8th item (that was 10th at the very beginning).

Hopefully my explanation is not very confusing.
#12859
I wish I could build 64-bit windows version, but AFAIK allegro does not support compiling in 64-bit mode under Win (well, that's MSVS problem, not allegro's; probably there's way around this like using different compiler, but I haven't looked much into that yet).
And I am not an experienced Linux user, unfortunately.
I think I may check those games with engine built as 32-bit to see if this is a general fault or only specific to 64-bit engine version.

If I won't have any result, it's JJS's or BigMC's turn then.

EDIT: Nah, KQ1 seem to work fine with win32 build (main branch).
#12860
Quote from: scottchiefbaker on Fri 14/09/2012 17:01:35
Should I try a different branch?
No, no, I was asking, just in case. Refactory is still pretty unstable on 64-bit platforms. It's just that the bug sounds familiar.

Quote from: scottchiefbaker on Fri 14/09/2012 17:01:35I think the problem lies in the engine.
Well, that's definitely in the engine, that's what I meant ;).
SMF spam blocked by CleanTalk