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

#12901
The Rumpus Room / Re: Riddle me this
Sun 19/08/2012 15:10:33
Quote from: 2ma2 on Sun 19/08/2012 14:36:52

  • 2 + x = 2x
  • x = 2

I'd say it is more mathematically correct to write 2 + x/2 = x, since it is total weight of brick we are looking for, not half of weight.
#12902
happens...
what about the utility classes  :-X
#12903
Since you are using Lua plugin, I guess you may ask Denzil Quixode to add another function callable from either AGS script or lua script, that wraps IAGSEngine::IsRunningUnderDebugger()?
#12904
Quote from: Khris on Fri 17/08/2012 20:37:42
Could this work maybe?

Code: ags
bool debugger;

// in game_start
#ifdef DEBUG
  debugger = true;
#endif


Alas, this tests if Game's Debug mode is on, it doesn't test if the game is run under debugger (from AGS Editor).
#12905
I am curious why do you need this.

If you think that may come handy in certain situations we may plan a script function for checking this?
On other hand, there's already RickJ's request to allow getting command line arguments from script, and engine connects to debugger when it receives --enabledebugger parameter in cmdline.
#12906
Site & Forum Reports / Re: Broken Game links
Fri 17/08/2012 19:42:26
I just realized that my DL is not the compiled game but rather a source project! :/
Peder's DL is on contrary the game itself.
Now, I forgot where and how I got this before. Was there a second link at the game page back then?
What would be better option here?
#12907
It is possible for plugin to do this by calling IAGSEngine::IsRunningUnderDebugger() method.

I do not see any way to know this from game script.
#12908
Site & Forum Reports / Broken Game links
Fri 17/08/2012 08:22:08
I thought there's one topic about reporting these in older days of the forums? Should there be one? Sorry if I missed it.

Actually I want to point out the OpenQuest game:
http://www.adventuregamestudio.co.uk/Games.aspx/Detail/945

The link there was broken and I am holding the alternate download for couple of years already. Not sure if I am the only one, but people occasionally download the game from my storage.
Is there a better place the game could be moved to? Like AGS archives or something.

My DL link:
https://www.box.com/shared/o6l46lnho1
#12909
Quote from: AGA on Fri 17/08/2012 07:43:37
Isn't that mouse.x and mouse.y?  Although it's been a long time since I used AGS regularly...
That's position of mouse cursor on screen, what Snarky means is hotspot point on mouse sprite, that is - coordinates of cursor's active point related to sprite's 0,0.
#12910
Also check "AudioChannel" and "AudioClip functions and properties" topics in the manual (in the "Scripting" category).
"Upgrading to AGS 3.2" topic (in the manual contents root) might be helpful as well.
#12911
Quote from: SSH on Thu 16/08/2012 17:14:10
Sorry if this has already been covered, but I wondered if someone should write an artificial "game" that tries to exercise as much of the engine as possible which could then be used as some kind of automated regression test for the refactoring?
You are reading my thoughts. I hoped someone suggests to do this, otherwise I'd had to post in the "Recruitment" section :).
I don't have enough time for this, and I will very much appreciate if someone makes such game.
#12912
General Discussion / Re: Sally Ride 1951-2012
Thu 16/08/2012 12:09:10
Quote from: Calin Leafshade on Thu 16/08/2012 08:38:34
Also the first lesbian (or at least bisexual woman) in space too. So go lesbos!
Should we take this as a hidden intent to send all homosexuals to space?  :P
#12913
Quote from: tzachs on Thu 16/08/2012 10:11:17
I think "baby steps" is the answer here. You should perform the minimal amount of steps that will get your code to work as the current engine works,
You mean "minimal amount of steps" or "steps of minimal length"? :)



//----------------------
MUCH LATER EDIT:
Reading that pdf you linked actually made me wonder if what I did for last month was actually good thing ;)
Now I have a feeling that probably I should return back in time to where I left "refactory" branch and continue working with it instead of rush-making totally new classes. I won't delete my work of course, and will be able to use it as a reference later.

Perhaps I should write the immediate goals somewhere too.
#12914
Ah, pardon me, I made a mistake by focusing on "get all matching things" and forgot about "get things ordered so that a formula could be used".
I think I am also having "universalization" issue and that makes me go too far sometimes.
Currently I am trying to find out what would be better way to solve this problem so that it's both easy to use if you need to do some simple things and if you need something complex.

The problem with game items is that their organization in project tree either hides their order (e.g. audio clips) and/or makes it impossible to change that order (practically anything else).
You mentioned how sprites are being ordered by assigning numeric ids to them. If other game items could have same changeable numeric ID that would indeed make the situation easier.

//------------
EDITED.
Here was some lengthy suggestion, but later I decided to remove it, because I started to feel I went into wrong direction again. Probably I need to think more on this.
#12915
None that I knew about, but you can definitely ask tzachs about adding this feature. He's working on improve the Editor lately.
You may put your request in this thread:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=45623.0
Or in the issue tracker:
http://www.adventuregamestudio.co.uk/forums/index.php?project=5;area=issues
#12916
Quote from: Iceboty V7000a on Wed 15/08/2012 14:50:07
Quote from: Crimson Wizard on Wed 15/08/2012 14:38:06
Code: ags

   randomclips[0] = aSound1;
   randomclips[1] = aSound2;
   ...

IMO this is retarded. If one can manage it tidily, using numbers is much more elegant than referring everything via an object. It is fine to give people a choice to make their codes more descriptive(and more bloated) but giving up a good feature just to please the OO people is not a good move and more stupidly, the engine is already referencing the sound clips by numbers internally, just not directly accessible.

First of all, this is bloated because you have to do this in script "by hand". To think of this, every array in the game (characters, etc) is being constructed like that on startup, only internally. Here in this example I constructed my own "alternate" array of game items. Is there so much difference between getting a random item by number from "original" or "custom" array?
What if you won't have to write this in script, but manage items in project folders having editor/engine do the rest?

Then, addressing items by their array index may cause troubles because their positions may change in the future. You'll have to keep an eye on that every time you add/remove/change anything.
I totally agree that in current AGS it might be easier to do address things by using indexes in their main arrays (I myself did that many times), but IMO that's only because AGS script does not provide alternate appropriate ways to do this.

Also, I don't think this has anything to do with OOP... it is rather a question of Key type which is used to iterate/access data.

//---------------------------------------------------------------------------------------------------------------
EDIT:
I am sorry for not saying this first time I edited this post, but I think I should elaborate further.

You called using indexes ("numbers") an "elegant" solution. I have to disagree. That may be (or may seem) simple and fast to use, but I do not find it elegant.
Let's examine two options when you need to get some items from project data array.

Option 1 is when you need some certain item. Whether you access it by script name (cEgo) or by index (0) - it does not make much difference. In any case you must know its name (or "name" - an index).
Option 2 is when you need to get a group of items. It is here where method actually makes difference.

When you are getting a subset from a master set you are using certain rule of comparison. There's a reason why you are selecting these items and not the others. In you example you select them because they are appropriate candidates for a random sound.
Now, when you use numbers, you actually check the comparison rule by yourself. It is you and only you who knows which items should be used. In other words you do the extra work that could be done by the engine - if only you told it how to choose, which criteria to use. Not only this is an unsafe and error prone way, it is also a non-ultimate way, because, as I've already mentioned, you may change the number/indexes of your items later and also because you won't be able to reuse such code as-is.

What I want to say, there is always a criteria when certain items are being chosen from the set (aka collection). If AGS have means of defining these and getting items using these - that would be better solution.
What criterias might that be?
* All items from custom group.
* All items with custom property having certain value.
* All characters in the room.
* All room objects in the rectangle.
* ...

In your case that could be "all sound clips marked as 'use for random sound'" (or similar).
#12917
I am usually against using numbers when accessing items, since, in my opinion, game logic should not rely on how items are stored.
Only case I knew it could be useful is iterating through all array, but that could be replaced by the use some sort of enumerator/iterator object.
Here you gave another interesting example:
Quote from: Iceboty V7000a on Wed 15/08/2012 07:01:07
Code: AGS
sound[20+Random(39)].Play(); //plays a random clip from #20 to #59


May I suggest feeding a separate array with clips you want to use at random? Like this:
Code: ags

AudioClip *randomclips[40];

function game_start()
{
   randomclips[0] = aSound1;
   randomclips[1] = aSound2;
   ...
}

function play_random_clip()
{
   randomclips[Random(39)].Play();
}


As for further development, a possible approach could be to define Item Groups concept, and allow to play randomly selected item from the group, like
Code: ags
MyAudioGroup1.GetRandom().Play()

Or something like that.
#12918
I really need some advice. For last several weeks I tried to figure out how to work further on the engine, but I did that mostly by inertia. I think I have my usual problem - either I am thinking too hard or too much ahead.
I have a question that needs to be answered and I don't feel like doing that alone, since after all what I do is supposed to be useful to many other people here.

Question is about the aim. What the immediate development should aim for? No, I don't mean implementing cool stuff, I mean the direction of core improvements. Here I have the code I was cleaning-up myself month ago. What next? I myself was going to make a class system, but how it should be done, and what should be the purpose? Should it simply enhance the existing code, mimic it in OOP way? Or should it be brand-new class system written from scratch which aims similar functionality? Or something intermediate? Or else?
The main problem is that I have literally no idea what of things I do will be used (and when). Therefore does gradual re-writing have any sense? If no one is going to use the new code for a long time it might be better to just jump over to the "advanced" stage. Then again, if people want new functionality really badly, maybe it would be better to just stick to cleaned code we have already and implement new things there? On other hand that will require re-implementing more on a later stage.
Maybe I am just not a "planning" person. :-\
#12919
You are missing "else" before second "if".

Code: ags

if (player.ActiveInventory == iHANDSAW) {
      player.Say("You'd have to use your stonger hand.");
}
/* HERE!!---> */ else if (player.ActiveInventory == iHANDSAWRAG) {
      player.Say("Well, alright.");
      player.Walk(123,  108, eBlock);
      object[0].Visible=false;
      player.AddInventory(iBRANCH);
    }
else {
  player.Say("I can't cut it with this.");
}


Basically you structure should be:
Code: ags

if ()
else if()
else if()
.....
else
#12920
I don't see any other reason except for it will be a bit more difficult to script this.

Or, simply, - no, there's no reason why you can't do that.
SMF spam blocked by CleanTalk