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

#41
This is my first experiance with dynamic sprites, so I need a little nudge to get me started.

All I want to do is draw an image onto the screen, preferbly in front of everything else on screen. I did a quick search and searched through the manual and just can't understand it.

I tried:

Code: ags

DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
surface.DrawImage(0, 0, 63);
surface.Release();


But then I couldn't delete it or clear it without the game crashing, plus it draws on the background, behind the characters.

Again, all I need it a push into getting started and for how to delete it when finished.

Example: Draw image to screen, wait for 3 seconds, clear sprite from screen and delete it.
#42
Quote from: Wyz on Wed 11/05/2011 14:05:38
This has still been playing in my head, and in fact it's on my todo list. I've got a plugin capable of doing it but it needs more work to make it user friendlier. If people are interested in this kind of functionality please post in this topic, when enough people do I'll start working on it again. :)

Yeah, keep on going. I have an achievement system in my game. This might be useful.
#43
Ah, right. I see.

On your GUI (gGui1), create a button.
Make its name "btnInvInteract".
Now double click the button. It will send you to the global script. You will see

Code: ags

function btnInvInteract_OnClick(GUIControl *control, MouseButton button)
{

}


Make it say:

Code: ags

function btnInvInteract_OnClick(GUIControl *control, MouseButton button)
{
  mouse.mode = eModeInteract;
}


The only thing is, you will need to click this button to change the mode to the interact mode. I can't think of a way to do it automatically. I'm sure Khris or Monkey will probably be able to drop a piece of code in shortly.

As long as you followed my previous post everything should now be fine.
#44
Quote from: MEHRDAD on Sat 07/05/2011 18:36:48
sorry.where do i put     mouse.mode = eModeInteract;   ?

Where ever your code is called for the GUI to open (gGui1.Visible = true;). How does your GUI open? A key press? A button on the screen?
#45
OK. I think I understand now.
Delete the code you have for the mouse and inventory in rep_ex.

Quote from: MEHRDAD on Sat 07/05/2011 17:49:32
I want change mouse on inventory (in gGui1)to interact mode.

When you open the GUI (gGui1.Visible = true;) also add this:
Code: ags

mouse.mode = eModeInteract;


Quote
THEN I want pick up a item .
THEN going to scene and graphic mouse remaind to current item.

When you click an inventory item in eModeInteract, it should automatically change to the inventory item's graphic and the UseInv mouse mode and stay like that when you close gGui1.

Quote
THEN again going to inventory and change mouse automatic to Interact mode for pick up another item.like Beneath a steel sky inventory.

As long as you have to code to change to interact mode whenever you open the GUI, it will always change to interact when you open the GUI.

Quote
In 'Creator' code,after pick up,change mouse automatic to interact mode in scene and i must click right for reach to item.

This is probably because you have your mouse's code in rep_ex.

I hope this solves what you're attempting to do.
#46
Quote from: Khris on Sat 07/05/2011 14:48:21
What is the behavior you want to implement?

I think that he wants  to pick up an item the first time in his inventory then, without changing the cursor (UseInv mode), be able to select a different item from his inventory.
If so, I think it's impossible without changing to interact mode, correct?
#47
Ah, OK. Awesome.
Thanks, Khris.
#48
Try changing

Code: ags
else if((GUI.GetAtScreenXY(mouse.x,mouse.y) == gGui1)&&( player.ActiveInventory != null)){
 
mouse.Mode= eModeUseinv;
mouse.UseModeGraphic(6);//pointer

}


to

Code: ags

else if((GUI.GetAtScreenXY(mouse.x,mouse.y) == gGui1)&&( player.ActiveInventory != null)){
 
mouse.Mode= eModeInteract;
mouse.UseModeGraphic(6);//pointer

}
#49
Probably a bit of a noob question, especially since I've been using AGS and C++ for over 4 years, but can you create arrays accessable from any script in AGS? I can't seem to create one in the Global Variables pane.
#50
To expand a little on what TomatosInTheHead said, you could use a boolean (we'll call it "isDoorOpen").

Code: ags

bool isDoorOpen = false; //our variable (or flag) for checking if the door is open. This has to before the function(s) it's being used in.

function room_Load()
{
  if (isDoorOpen == false)  //check if the door is closed
  {
    RemoveWalkableArea(2);
  }
}

function cVamp_UseInv()
{
  if (player.ActiveInventory == iklaasjaveri) {
    cVamp.Say("Thank you for the blood.");
    cVamp.Say("How can I repay you?");
    player.Say("Let me through the door, maybe?");
    cVamp.Say("Ohh, alright. You deserve it.");
    oDoorOpen.Visible=false;
    oDoorClose.Visible=true;
    player.LoseInventory(iklaasjaveri);
    isDoorOpen = true;//Set the door to "open".
    RestoreWalkableArea(2);
    
  }
}


This will check if the variable "isDoorOpen" is false. If it is, it will remove the walkable area, otherwise it will do nothing (leave the walkable area on).

EDIT - Just noticed that cVamp would be in the GlobalScript. This means you would have to make a global boolean in the Global Variables pane in the editor.
#51
Quote from: barefoot on Fri 18/03/2011 07:34:11just need to get char to face object..

From this sentence, I can't tell if you know how to or not.
Just in case

Code: ags

cwizard.FaceLocation(oObject.X, oObject.Y);
#52
I'm positive that

Code: ags

cwizard.Animate(cwizard.Loop, 14, 0, eBlock);


will do what you're asking.
#53
Quote from: Khris on Tue 28/09/2010 17:13:16
you'll have to change the ItemWidth and ItemHeight setting in your InventoryWindow.
The thing is, if those are way smaller than the sprites you're using, the items should all overlap and be hard to click on

Ha. I always wondered why my inventory items overlapped. Now it's fixed. Thanks Khris.

Quote from: dahui58 on Tue 28/09/2010 17:21:13
I can't find any ItemWidth/Height variables, the size of my inventory item is about 55 wide 40 high

In your inventory GUI, click on the inventory window. Under 'Appearance' (first catagory) you should see ItemHeight and ItemWidth.
#54
Would it be possible to have global arrays accessable from the global variables pane?
#55
How about give the player an inventory item, or give another character an inventory item and checking if they have it?

Code: ags

if (player.HasInventory(iBlank))
{
    DoStuff();
}


To give characters inventory items:

Code: ags

player.AddInventory(iBlank);


Just replace player with another characters script name to use them as a "list".
#56
Thanks Gilbet, that's exactly what I wanted.
#57
Quote from: Domithan on Mon 16/08/2010 12:44:21
However, why not just make one of the guilt values stand for 'not applicable' or something similar?

What do you mean?
#58
Is there a way to make optional variables in custom functions?
E.G.

Code: ags

function KillPeople(String motive, optional bool guilt)
{
    Stuff();
}


However, I know that "optional" in not a keyword.
#59
I partially remember this song from back when I was learning German in primary school, but couldn't find it on Google (.com, .com.au or .de). So, I decided to post it here and see if anyone knows it.

("something" replaces words/syllables I've forgotton)
From what I remember:

(Chorus)
Something something vorwärts vorwärts vorwärts, something something vorwärts, hüpf zurück.

(Verses)
Something something Doktor und der Doktor sagt: Oh weh, mein Kopf tut weh. (Then the class repeats the "oh weh" part).

So, is it a song anybody knows?
(I think spelling's all correct, but I may have some of it wrong)

EDIT - I just remembered that it's sung to the tune of "Here We Go Zudio".
EDIT 2 - Actually, don't worry about it. I just looked up the lyrics to Zudio in English, and I think it's just a translation my teacher may have made up. Sorry.
#60
Quote from: Armageddon on Tue 10/08/2010 07:22:40
Where is the place where I can set his start location, sorry I'm very new and have no idea what I'm doing? :'(

Assuming you're using AGS 3+, go to the characters pane in the menu. Open it and double-click on the player character to open his details. In the window below there will be a whole lot of options. Scroll down/up untill you see "Design". The bottom 3 options (before movement) will be: Starting room, Start X and Start Y.
Starting room is the room number he will start in, x is the  horizontal position across the screen, all the way left being 0, y is the vertical position across the screen, all the way at the top being 0.
SMF spam blocked by CleanTalk