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

#12961
Beginners' Technical Questions / Re: If else
Wed 01/08/2012 21:47:36
Quote from: dbuske on Wed 01/08/2012 21:21:35
Nano is the main character. So, I should put Nano's giving the inv item with the if else in the global script?  The giving the item is scripted as an event in the room script.
I think you are missing the point a little. The question is not about Nano, but about the one to WHOM it gives an item.
To put it simply: it depends on what object does player interact with.

When player interacts with Characters (for example: gives inventory) and Inventory Items (for example: looks at them), the event should be scripted in the GlobalScript.
When player interacts with room Objects and Hotspots, the event should be scripted in the Room script.

So, yes, you should put the event with giving an item to the GlobalScript.

Also - that's very important! - do not forget to actually bind your function with event. Simply naming it with "Useinv" won't work.
You should set the name of your function for "Use inventory on character" event in character properties. Not player character (Nano), but NPC character (Marvin).
#12962
Beginners' Technical Questions / Re: If else
Wed 01/08/2012 19:41:51
Quote from: dbuske on Wed 01/08/2012 18:49:50
The code for Nano giving the inv item is in the room script.
Do you mean you just wrote a function with "Useinv" postfix without actually binding it to event? That's not correct then.
Also, it really depends on what actually Marvin is. If it is a room object or hotspot, then event function should stay in the room. If it is a character, it must be put into GlobalScript.
#12963
Quote from: Dsmccurdy92 on Wed 01/08/2012 19:07:34
As a matter of fact I read the *Do not read before posting* thread and it said nothing about where I could find the beginners FAQ and from what I seen it didn't say where I could find resources either.
Sorry if this info was misleading, but I thought links to AGS tutorials, Wiki and some resources could be useful.

BTW: http://www.adventuregamestudio.co.uk/wiki/?title=Category:AGS_Beginners%27_FAQ
Were you searching for that or for something else?
#12964
Quote from: Dsmccurdy92 on Wed 01/08/2012 17:37:49
I am kinda new to this and I couldn't find the beginners FAQ.
No way! Did you notice "READ FIRST *BEFORE* POSTING!!" topic? :)
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=14373.0

Also, if you are making the very first game, there's nothing bad in drawing your own graphics regardless of how bad they may seem. That's fun!
#12965
This should probably go to Adventure Talk & Chat?

Anyway, never heard of any text parser AGS games except for Trilby Notes. That's a shame.
Before playing that one I was afraid it will be difficult for me, but in fact most commands were found in a pretty intuitive way.

To answer the question in topic title, "Why doesn't anyone use the text parser?", I think that:
1) it requires alot of work to make a good dictionary and put it into use;
2) it requires good knowledge of language and some effort to play (at least some effort to make yourself try :)).
#12966
Although this is up to Alan to make this decision in the end, I assume all good stuff will be eventually merged into main development branch.

BTW, Alan already copied some of his code to github, forking from my refactored branch.
#12967
The Rumpus Room / Re: *Guess the Movie Title*
Wed 01/08/2012 11:08:43
Use golf club to put a ball into deaf girl's food and bring her attention.
#12968
This may be not easy to tell, since there are many things going on in the engine, but my blame goes for this condition:
Code: cpp

// count idle time
    else if ((loopcounter%40==0) || (chex->process_idle_this_time == 1)) {
      idleleft--;
      if (idleleft == -1) {

Doesn't that mean that idle timer only decremented once per second, meaning that if character stopped at 0.001 of a new second it will still wait for the rest 0.999 milliseconds?

EDIT: Probably explained incorrectly. The problem is not that it checks for idle time once per second, but that it makes one extra check if wait time is 0 (it needs it to become -1).

Anyway I don't see how knowing this may help. I guess the animation should be done some other way. What about force-playing animation depending on whether character is moving or not?

PS. We should probably still fix this in future versions of AGS.
EDIT2: opened an issue for later reference: http://www.adventuregamestudio.co.uk/yabb/index.php?issue=341.0
#12969
You should not do anything like that:
Code: ags

ProcessClick(mouse.x,mouse.y, eModeInteract);
ProcessClick(mouse.x,mouse.y, eModeWalkto);
ProcessClick(mouse.x,mouse.y, eModeUseinv);


Instead make a check, find what lies under the mouse and process appropriate command.
For example:
Code: ags

// 1. Find any usable object under the cursor:
Hotspot *h = Hotspot.GetAtScreenXY(mouse.x,mouse.y);
Object *o = Object.GetAtScreenXY(mouse.x,mouse.y);
Character *c = Character.GetAtScreenXY(mouse.x,mouse.y);
// 2. If there's an object, then...
if (h != null || o != null || c != null)
{
  // 2.1. If player is holding an inventory item, then use it on object
  if (player.ActiveInventory != null)
  {
     ProcessClick(mouse.x,mouse.y, eModeUseinv);
  }
  // 2.2 else interact with object
  else
  {
     ProcessClick(mouse.x,mouse.y, eModeInteract);
  }
}
// 3. If no object found, then simply walk
else
{
  ProcessClick(mouse.x,mouse.y, eModeWalk);
}
#12970
Beginners' Technical Questions / Re: If else
Tue 31/07/2012 13:51:19
Well, it is all clear now.
Look at your code. What do you do?
1. Set Marvin's active inventory to iBook.
2. Check if Marvin's active inventory is iBook.
Ofcourse it will always be iBook, and it will always display the text under "if", and never under "else".

Try this instead:
Code: ags

function cMarvin_UseInv()
{
  if(cNano.ActiveInventory==iBook)
  {
    Display("Finally, someone who appreciates how truly awful life really is.  I think I'll shut myself down now, or stick my head in a bucket of water for a while.");
    cMarvin.AddInventory(iBook);
    cNano.LoseInventory(iBook); 
  }
  else 
  {  
    Display("That's even more depressing.");
  }
}


Quote from: dbuske
Good point about the Use inventory on character function.  I will check that out. I just used Useinv.
Well, that seems to be exactly the same.
#12971
Beginners' Technical Questions / Re: If else
Tue 31/07/2012 13:32:19
I do not see how this can work wrong from the code you posted.

Maybe you can show all the code from this function? By the way, what function is this - "use inventory on character" event handler?

EDIT: Also, is cMarvin a player character?
#12972
Beginners' Technical Questions / Re: If else
Tue 31/07/2012 13:19:58
Here's the code you posted:
Code: ags

if(cMarvin.ActiveInventory==iBook) {
    Display(".");
}
    else {
        Display(".");
    }

This means:
IF Marvin's active inventory is Book, then Display(".");
ELSE Display(".");

It will do Display(".") always.
Is this really what you have in your code, or you just removed the actual text?
#12973
Beginners' Technical Questions / Re: If else
Tue 31/07/2012 13:11:32
But you have SAME command both under "if" and under "else"...
#12974
The Rumpus Room / Re: *Guess the Movie Title*
Mon 30/07/2012 21:02:39
Quote from: Ponch on Mon 30/07/2012 19:31:17
Joe versus the giant boxer standing right outside his window?
(laugh)

Bruce Lee? Well, one of his movies. Dunno which one. But haircut looks familiar :)
Alright, let's guess.
Way of the Dragon.
#12976
Quote from: RickJ on Sun 29/07/2012 20:52:16
From what I think I understand of your proposal, you would give users the ability to organize their projects in an arbitrary structure of their own devise.  Presumably, people would eventually settle on some sort of hierarchical structure resembling an OO paradigm. Inevitably features suggested by such organizations will be requested.  Implementation of such features can be easy or difficult depending on how the underlying data structures are defined.
Erm, what? No :).
I proposed simply one thing: instead of having item types as root nodes in the TreeView control, have them as buttons on the panel. Hence faster search through project, since you don't have to, for example, scroll to collapse the parent node, you may just click button and change to different item type.
#12977
I just checked the engine code. It looks like that the loop counter is reset only when the next main game loop iteration is run.
That means exactly that you must pass execution to the engine once in a while either by returning from event handler (not just your function), or by calling Wait.

One may say consecutive loops are counted as one. Something not elaborated in the manual well enough.
#12978
Quote from: RickJ on Sun 29/07/2012 04:18:04
Quote... What I suggested here is just a change in how Editor Gui represent current project structure.
The PDF also shows an alternative project structure but but it also implies a somewhat different project structure from the current one.   So my point is that if we are going to go through all the trouble we may as well think it through and try to eliminate a few problems along the way.   The PDF outlines a different, more object oriented, structure than the current one and would no doubt take a tremendous amount of work. However there may be some good ideas that are worth pursuing and are more easily implemented.  I thought it was enough related to what you are thinking about the project explorer that you would be interested in seeing it.
Yes, sorry, I was wrong, perhaps confused by the topic you gave a link to. Now when I read pdf I see what you mean. And it is true that my hypothetical GUI will not fit your project structure similarly as it does fit current one.
#12979
Quote from: RickJ on Sun 29/07/2012 01:17:58
There was a nice discussion about similar things in this thread awhile back ...
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=45165.40
That's very interesting (really!)and I am certainly going to study your pdf, but I do not see how it's related. What I suggested here is just a change in how Editor Gui represent current project structure.
#12980
I don't have much argument against text except for maybe that text takes more space.
If I remember correctly C# allows to change the style of button from text to bitmap during runtime? I thought it may be possible to add an option and let the user decide what is displayed on tool buttons?

Quote from: tzachs on Sat 28/07/2012 23:45:11
5. I'm on the fence regarding the room contents pane. On the one hand, it would be useful and cool to be able to organize your objects and hotspots etc in folders. On the other hand it is an additional window which would overcrowd the already crowded layout, making it less friendly.
I just thought of an alternative solution: What about integrating the room contents tree with the main tree
(make each room to be expandable and have the room contents tree as a sub-tree)?
That's an interesting question and I can't say I have the answer at this moment.
I suggested Room Contents pane rather because it is sometimes tiresome to select objects/areas from combo-box for editing.
I understand your considerations on overcrowding. But I guess it is possible to find a place for botth explorers with the use of docking panels similar to how different explorers can be arranged in Visual Studio (Solution, Resources etc). This is still a question though would it be easy for newbies to navigate through them.
What bothers me is that I don't think that adding room contents to the main tree will lessen overcrowding; I am afraid it will make the project tree look more cumbersome.
SMF spam blocked by CleanTalk