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

#141
But then again, if you're using these non blocking functions, you will need a few "Wait()" to synchronize things. This will result in blocking code.

So basically, it will only work if you just need to play a music for example...
#142
I suppose basic cutscene could be achieved with player.saybackground(), player.walk(noblock), aMusic.play(), and then stopped without a problem since it's non-blocking code, yes.

As I said in the first post, (I'm sorry for my English), it really depends on what kind of code is executed but you're totally right about that Joe.

Edit: Also Happy Birthday Monkey!
#143
This is where I think repeatedly_execute_always may be used to check for keypress while other (blocking) code is still executing, but it would be ugly.

Edit: Deleted the code, it's useless until we see MMMorshew answer with some more details.
#144
Sorry if I wasn't clear, what I mean is for example you call a function within on_key_press, the function code is executed, but can't be stopped with another trigger of the key, because the function is already executing.

Yes you can use "return" anytime within the function but can you make it return from outside? You'd probably need to add a bunch of "if(is_cancelled) return;".

One common way to work arround this problem is to launch the function in a separate thread, which isn't possible in AGS I think, or I missed the new feature.

Also, it would really be useful if you could post the code you want to be executed on keypress, or an explaination.
#145
Hello,

It really depends on what kind of code is executed when the key is pressed, you cant really stop a function once it is launched unless you have Thread/Fork support in the scripting language, or if the triggered code consists of a while loop.

You may use the repeatedly_execute_always, since it is actually threaded, if I remember well.

#146
He looks kinda "generic", I mean like random people you find in cities etc. Maybe adding some detail that would make him unique could help, like a headband, a sign in his back, a scar on his face or a weapon?

For example we can tell who your avatar is at first glance just by the color.
#147
yeah I ve seen that blank in the shadow but couldn't launch the hotspot event, I'm gonna try again!

Edit: Alrighty, the exit was really smal indeed, Thanks!

Also, I wasnt at home and wanted to play without the game sound/music, so I select "disable music", "no sound" in gamesetup, and it gives an error on room load, GlobalScript L63 Null Pointer referenced, not really important but may be worth mentionning.

Good job with the game, really enjoyable so far!
#148
He probably just wants to have a font that has some "math specific" characters to display... (my guess) in that case you'd need to import a font or draw the symbols yourself either as a sprite or as a custom font.

Edit *Iceboty beats me ;)
#149
I just started "The day that nothing hapened" and it looks really cool, had me chuckle a few times, but I wanted to say I'm stuck:

Spoiler

I entered YahtzeeBrand and cannot find a way to go out of the store, missing exit or am I blind?
[close]

Regards
#150
Yeah sorry if that was useless but I may have misunderstood, read too fast ;)

Quote
So I'm making my own 9-verb gui from scratch
...
if you click to use something it would say 'Use Vending Machine' or 'Use Flashlight with Vending Machine'

I just wanted to show the events layout as an example, the rest of the code is random of course. Again if you're using basic cursors and actions then there's no such thing as "from scratch"  :P

Quote
I don't get why people don't post their friggin code when they want it to be expanded by others.
+1 !
#151
Quote
The CurrentVerb == 1 is 1 the number of the cursor?

The code means : If the selected verb is verb No 1 then change the label text to "verb1".
#152
CurrentVerb represents the verb you are using at the moment, and will change whenever you change cursor.
You want to set the Label Text to the currently used verb? This should do :

Code: ags

if(CurrentVerb == 1)
 LabelName.Text = "Verb1";


Or replace lblAction.Text by your label name in Khris' example.
Is there something not clear about the code?
#153
Hello,

Here is a very basic example of custom interface:

-Create a Global Int called "CurrentVerb" from the right panel, default value "0".
-Add this code to the GlobalScript, the line: function on_mouse_click should already be here.
Code: ags


function on_mouse_click(MouseButton button) 
{
  // called when a mouse button is clicked. button is either LEFT or RIGHT

  Hotspot *h1;
  if (button == eMouseLeft)
  {

    if(GetLocationType(mouse.x, mouse.y) == eLocationHotspot)
    {
      h1 = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
      if(CurrentVerb == 0)  //Use
      { 
        player.Walk(mouse.x, mouse.y, eBlock, eWalkableAreas); 
        player.Say(h1.Name);
        //other actions...
      }
      else if(CurrentVerb == 1)  //Talk
      { 
        player.Walk(mouse.x, mouse.y, eBlock, eWalkableAreas); 
        //Dialog
        //other actions...
      }
      else if(CurrentVerb == 2)  //Look
      { 
        player.Say(h1.Name);
        //other actions...
      }
    }

  }
  else if(button == eMouseRight)
  {

    if(CurrentVerb < 2)
     CurrentVerb++;
    else
     CurrentVerb = 0;

    if(CurrentVerb == 0) //use
    {
      //change cursor graphic to verb 0
     //play a sound
    }
    else if(CurrentVerb == 1) //talk
    {
      //change cursor graphic to verb 1
     //play a sound
    }
    else if(CurrentVerb == 2) //look
    {
      //change cursor graphic to verb 2
     //play a sound
    }
    
  }

}


This is just the concept, left click uses the currently selected verb on target hotspot, right click switches to next verb. This could be a good start.
#154
Completed Game Announcements / Re: I Forgot...
Fri 01/04/2011 05:03:33
I would rather commit seppuku than criticize Mods  :-* but!

I just wanted to say the soundtrack in the second building has a real "Epic" potential, and I would love to see it developped a bit more! Just my two cents...

I didn't say it but thanks and Congratulations for your release!
#155
Completed Game Announcements / Re: I Forgot...
Fri 01/04/2011 02:18:29
I really liked the atmosphere in some of the game's backgrounds, I immediatly compared it to silent hill for some reason, hehe. I also liked the way you introduced the "think" verb, intresting way to immerse the player.

Maybe a bug:

Spoiler

When you look at the melted tin crayons in the inventory, it displays the Lighter's description, just thought I'd mention it.
[close]

Btw are you the one who composed the soundtrack?
#156
Glad I could help, I like this kind of gameplay more than point & click, so I wish you luck with it, anyway you can post more code if you want us to have a look at it.
#157
If it's about the engine limits then I can only suggest that cheap trick, sorry :p
#158
I think it may come from the running variable, it will only be reset to 0 when you release all the keys, so unless you do that, the if (running != 0) will prevent you from executing the player.animate code.

Maybe you don't even need to check if(running!=0)

-if he's running then continue running  in new direction
-if he's not running then start running in new direction

Both options should lead to player animating in new direction right?

#159
An alternative would be to use only one NPChar[50]; and assign the values to it within your loop, but inside each 'room load', I dunno if it fits your game requirements tho.
#160
Hello,

If you created a sctruct called NPChar, declared a table of struct like you did, I don't see why you'd need 500 npc in the game, if you really need that much and AGS is limiting the number then you could still split the table in two or more :

Code: ags


NPChar NPC1[100];
NPChar NPC2[100];
NPChar NPC3[100];
NPChar NPC4[100];
NPChar NPC5[100];



I don't know the max number of item for a table of struct , or maybe it is the maximum size of a single table. I used 100 but you get the idea, then use 5 loops to fill them ...

The way you coded that suggests that you'll have 500 different NPCs with distinct stats (templates). Because if not you could use only a few NPC items and recycle (re-assign) them on the fly when you need it.
SMF spam blocked by CleanTalk