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

Topics - Ultra Magnus

#1
Hi.
I have a password input text box and would like it to replace all the characters as typed with asterisks.
My question is: how does AGS process key presses, how can I stop it, and how can I simulate it?
i.e. How do I make it ignore a key that has been pressed, and register a different key that hasn't?

I have tried doing a straight swap with
Code: ags
if (keycode>='A' && keycode<='Z') keycode=42;

but the text box just displays what was typed.

I also tried maybe swapping the chars after the fact with
Code: ags
tempstring.AppendChar(42); txtPassword.Text=tempstring;

but that does absolutely nothing. The text still displays as normal.

I have no idea what else I can try. Any ideas?
Thanks in advance.
#2
Hey people.
I'm having trouble with clicking on some hotspots. Here's the code I'm using...

Code: ags

function on_mouse_click(MouseButton button)
{
  if (IsGamePaused()==1) { }
  else if (gInventory.Visible==true && GUI.GetAtScreenXY(mouse.x, mouse.y)==null) {gInventory.Visible=false;}
  else if (button==eMouseLeft) {
    if (cCharacter.Room==cEgo.Room && GUIControl.GetAtScreenXY(mouse.x, mouse.y)==null) {
      cCharacter.Walk(mouse.x, mouse.y, eBlock, eWalkableAreas);
      cCharacter.FaceLocation(mouse.x, cCharacter.y, eNoBlock);
    }
    ProcessClick(mouse.x, mouse.y, eModeInteract);
  }
<snipped>
}


Now, the problem is on the screens where cCharacter is in the same room as cEgo.
Most of the time it works as it should, but sometimes the character just walks over to the hotspot and it doesn't process the click afterwards. I've also got rep_exec telling the cursor to change its graphic when over a hotspot, so I know the game knows there's a hotspot there, it just sometimes chooses to ignore it. Furthermore, from what I can tell, the closer the mouse is to the centre of the hotspot, the more likely it is to not register.

Any ideas on why this is happening and maybe how to stop it?
Thanks in advance.
#3
Hello people. I come to you with an aesthetic problem.
And that problem is that DynamicSprite.CreateFromSaveGame looks terrible after resizing.

On the left here, we have CreateFromScreenShot, on the right, CreateFromSaveGame.


Is there a way to make CreateFromSaveGame look better?
Alternatively, is there maybe a way to make a dynamic sprite less dynamic, so I could use CreateFromScreenShot and it will still be there after closing and re-opening the game (other than saving it to a separate file)?

3.1.2 SP1, by the way.

Thanks in advance.
#4
I'm having trouble with text showing up and acting accordingly when I use gui.Y and/or gui.Transparency.
Here's what I've tried so far...


Idea #1)
I started with a little text box (gFrame) sitting below the screen with a label (lblSubtitle) saying "Day One", and this code...
Code: ags

function room_AfterFadeIn()
{
 while (gFrame.Y>=356) 
 {
  gFrame.Y-=5;
  Wait(1); 
 }
}

gFrame moved up from below the screen as it should, but the text didn't appear until after it had stopped.
I figured this was because the engine doesn't want to waste resources by writing text while it's off-screen, so...


Idea #2)
Move lblSubtitle to a different gui (gFrameover) and have it fade in and out over gFrame after it's stopped moving.
Code: ags

 while (gFrame.Y>=356) 
 {
  gFrame.Y-=5;
  Wait(1); 
 }
 int trans=gFrameover.Transparency;
 while (trans>0)
 {
  trans--;
  gFrameover.Transparency=trans;
  Wait(1);
 }
 Wait(200);
 while (trans<100)
 {
  trans++;
  gFrameover.Transparency=trans;
  Wait(1);
 }

gFrame moved as it should, and then nothing. No text, and the game hung as if I had called Wait(∞).


Idea #3)
The gFrame.Y code seemed to work well enough, so I tried adjusting the gFrameover.Transparency code to be more like it.
Code: ags

 while (gFrameover.Transparency>=1)
 {
  gFrameover.Transparency-=1;
  Wait(1);
 }
 Wait(200);
 while (gFrameover.Transparency<=99)
 {
  gFrameover.Transparency+=1;
  Wait(1);
 }

Still nothing. Same result as #2. However, when I change it to...
Code: ags

 while (gFrameover.Transparency>=5)
 {
  gFrameover.Transparency-=5;
  Wait(1);
 }
 Wait(200);
 while (gFrameover.Transparency<=95)
 {
  gFrameover.Transparency+=5;
  Wait(1);
 }

...the text finally shows up, but it instantly flashes on and off instead of fading. I tried changing the instances of Wait(1) to a higher number (in case it was working, but just going too fast), but that only makes it take a bit longer before the text still flashes on and off.


Also, I found an old thread where people said that it might have been the Wait(200) in the middle screwing it up, so I tried all of the above codes using SetTimer(20, 200) instead (with the latter part of the code in rep_exec under an if (IsTimerExpired(20)) clause), but that gave the same results for each of them.


Any ideas how I can fix this?

Thanks in advance for any help.
#5
Can anyone tell me...

1) Can the volume of a video be controlled from within the engine? How? Is it just by the master volume, or does (could) it have its own channel control like music and sound effects?

2) How is this affected in 3.2, where (from what I understand, not having used it yet) you have to choose a channel to play a sound file and then call back to that specific channel to adjust its volume? What channel would a video's audio be in?

3) Has anyone made a game using ogg video yet? By which, I mean has it been tested on a distribution-size scale? Are there any issues such as the old "some avi vids might not play if you have ffdshow installed" one?

4) I'm currently using Scotch's Theora plugin for the most part, which allows me to play videos and keep the game's gui overlaid (but not clickable, by my choice) onto them at the bottom of the screen. This means I need to include the vids in my compiled folder, whereas the manual says that if I used PlayVideo() instead they would be absorbed into the exe, which I kinda dig.
My question is: is there a way to either use PlayVideo() and keep my gui (and possibly soft subtitles) visible over the bottom of the clip, or keep using the plugin but not need to make the clips available outside of the game?

Thanks in advance for any help.
#6
Greetings.

I have a name input box that capitalises the first letter, and it goes a little something like this...
Code: ags

function myNamePlayer()
{
 namestring=txtNameinput.Text;

 if (namestring=="") {
   SetTextWindowGUI (5);
   DisplayAtY(402, "Please enter a name before proceeding.");
   SetTextWindowGUI (16);
 }

 else {
   String namestringtemp=namestring.UpperCase();
   char initial=namestringtemp.Chars[0];
   namestringtemp=namestring.LowerCase();
   namestring=namestringtemp.ReplaceCharAt(0, initial);

   cStephanie.Say("It's nice to meet you, %s.", namestring);
 }
}


I'm looking for a way to also auto-detect if said string contains a space and/or hyphen, then capitalise the following letter(s).
Also, to see if the last character is some kind of punctuation (and/or maybe number), and delete it if so.

For example, if the player types their name as "joey jo-jo jr!!1!", I'd like the game to auto-parse that as "Joey Jo-Jo Jr".

I thank you in advance for any help.
#7
My inventory has stopped responding, and I don't know what I did to it.
The cancel button works, so it's not that it's not clickable, but the actual inv items do nothing.

Also, I had it so that clicking off of the window would close it, but that's stopped working, too.

Code: ags

function on_mouse_click(MouseButton button) {
  if (IsGamePaused() == 1) {
  // Doing nothing
  }

  else if (mouse.Mode!=eModePointer && isguiopen==true && GUIControl.GetAtScreenXY(mouse.x, mouse.y)==null) {
    if (button==eMouseLeft) {
      gInventory.Visible=false;
      lblInventoryStatus.Text=" ";
      isguiopen=false;
      if (mouse.Mode == eModeInteract) {
        mouse.Mode=eModeLookat;
      }
    }
  }

  else if (button==eMouseLeftInv) {
    if (InventoryItem.GetAtScreenXY(mouse.x, mouse.y)==iMap) {
      gMap.Visible=true;
      gInventory.Visible=false;
      mouse.Mode=eModePointer;
      lblInventoryStatus.Text=" ";
    }

    else if (player.ActiveInventory!=null) {
      inventory[game.inv_activated].RunInteraction(eModeUseinv);
    }

    else {
      player.ActiveInventory=InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
      mouse.Mode=eModeUseinv;
    }
  }

  else if (button==eMouseLeft) {
    ProcessClick(mouse.x, mouse.y, mouse.Mode );
  }
}


Help.

Disregard.
#8
Hello people.
I couldn't find the answer to this anywhere, so...

How can I get the game to read and store the user-set volume levels for music and sound?
Here's what I've got now...

After tooling around with the sliders, the player clicks either btnResume to save their changes and resume playing, or btnNoChange to discard the changes they made and go back to the last saved set of values.

Code: ags
function btnResume_OnClick(GUIControl *control, MouseButton button)
{
  lastMsldval=sldMusic.Value;
  lastMlevel=
  lastSsldval=sldSound.Value;
  lastSlevel=
  lastGsldval=sldGamma.Value;
  lastGlevel=System.Gamma;
}

function btnNoChange_OnClick(GUIControl *control, MouseButton button)
{
  sldMusic.Value=lastMsldval;
  SetMusicMasterVolume(lastMlevel);
  sldSound.Value=lastSsldval;
  SetSoundVolume(lastSlevel);
  sldGamma.Value=lastGsldval;
  System.Gamma=lastGlevel;
}


What can I fill btnResume's gaps with?

Thanks in advance.
J.
#9
Hello people.

I'm finding it tough to come up with ideas for my game's settings panel.
Here's what it's like so far...



The icons were liberated from a free clipart site.
I don't pretend to be anything of an artist. 8)


Aaaanyway...
The sliders are self explanatory, but here's a run-down of the left side, top left -> bottom right...

Toggle music on/off, toggle arrows* on/off, restore default settings
Save game, load game, reset/restart game
Exit game, continue playing

(There's also a red circle that goes over the music icon, just like the one that's over the arrow.)


So, what do you guys think?

I can't think of anything that could visually represent "continue", and I'm not particularly happy with the "default" or "reset" icons either.
There is a separate status-line that tells you what each of the buttons do as you hover the mouse over them, but I'd really like for that to be used only as a backup; i.e. for the icons to be readable on their own.

Does anyone have any ideas that could make it more... good?
Also, how about the layout? Do you think the buttons' positions are alright, or should I shuffle them around a bit?


Thanks in advance for any input.
J.


* The game has optional arrows that can be overlaid onto the room screens to help show where the exits are, in case you were wondering.
#10
Recently I've been getting this error report.
It happens whenever I have the sprites section open at the same time as anything else.

Every time I click the sprites tab, this shows up...
QuoteError: Object reference not set to an instance of an object.
Version: AGS 3.1.2.79

System.NullReferenceException: Object reference not set to an instance of an object.
   at AGS.Editor.frmMain.FindPropertyGridItemForType(String fullTypeName)
   at AGS.Editor.frmMain.tabbedDocumentContainer1_ActiveDocumentChanged(ContentDocument newActiveDocument)
   at AGS.Editor.TabbedDocumentContainer.SetActiveDocument(ContentDocument pane, Boolean updatePaneOrder)
   at AGS.Editor.TabbedDocumentContainer.tabsPanel_MouseUp(Object sender, MouseEventArgs e)
   at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Followed by...


I've tried closing and re-launching AGS, but it still happens every time I shift focus to the sprites section from anywhere else in the editor (though not the other way around).

Any ideas?
#11
Howdy.

I'm looking to somewhat customise the Sierra layout in version 3.1.1.
I've searched around here, and on the wiki, and found nothing helpful.

First, some screens...
 

Is there a way to specify a portrait's vertical position? I found the code to move it horizontally but couldn't find anything for the y axis.
As you can see, I managed to get the character where I want her by just adding a bit of empty space to the top of her sprite (through trial and error), but this still leaves the text at the top of the screen.
Is there any way I can move the text down so it's next to her?

Also, if using a text window, is there a way I can change the text colour within it?
I found out how to change the outline, but can't find anything about the core font.
(I know I chose the wrong colour pink for the text window, but that's an easy fix.)

Also also, you can see in the above screens that the character's sprite has a terrible jagged edge in Sierra mode that's properly anti-aliased in LucasArts mode on the exact same picture.
Is this par for the course? Is there any way to fix it?

So, in summary, I'd like to have the text where the mailbox is, pink on black, preferably in a text window, and ideally together with the LucasArts-style quality picture.
Is there any way to do all/any of this?

Final question: Is there a way for the program to tell if someone's talking or not?
I want to have different coloured text/GUIs for each character (plus a default for the narrator), so can I maybe put something like...
Code: ags

if (charactertalking=cStephanie) {
  SetGameOption (OPT_PORTRAITPOSITION, 0);
  SetTextWindowGUI (5);
  game.text_colour=13;
}

...in global for each character instead of having to change them each time someone talks (and then back again when they finish)?

Thanks in advance.
J.
#12
What is a Photoshop Phuesday?

Photoshopping isn't drawing a completely new image -- It's editing images to create a new image, such as editing one image or combining several images. The contest usually lasts for a fortnight. Also, you don't have to specifically use Photoshop -- Paint Shop Pro, MSPaint, or any other programs can be used. Please make sure your image doesn't exceed the width of the screen.

--------------------------
--------------------------

Let's go with a classic this week, shall we?

Pop culture in art
If a famous artist were to be arting his art in the present day and age, what kind of pop culture references might turn up?

Here's one I made earlier...


Now have at you!
#13
Hey.
I'm sure this is going to end up being blindingly obvious, but I'm stuck.

In global I have a LucasartsStatus function, including...
Code: ags

if (mouse.Mode==eModeWalkto) {
  buf = String.Format("Walk to %s", name);
}


In multiple rooms I have something along the lines of...
Code: ags

function hZiggyshouse_MouseMove()
{
 mouse.SaveCursorUntilItLeaves();
 mouse.Mode = eModeWalkto;
 mouse.ChangeModeGraphic(eModeWalkto, 1);
}


This results in the cursor changing and the status line reading Walk to Ziggy's house.

In another room I have...
Code: ags

function hTownhall_MouseMove()
{
 mouse.SaveCursorUntilItLeaves();
 mouse.Mode = eModeWalkto;
 mouse.ChangeModeGraphic(eModeWalkto, 1);
}


With this one, the cursor doesn't change and the status line just reads the town hall (name of the hotspot) without prefacing it with anything.

I've double and triple checked, and I didn't forget to declare the MouseMove function in the event menu thing.

That is the exact same code, isn't it?
So why would it work in all rooms with all hotspots except this particular one?

Thanks in advance for any help.

(version 3.0)
#14
Firstly, I apologise immensely for having to ask this, because I know it's been asked several times before, but I've been searching through and reading all the old threads and stuff ain't working.

Based mostly upon this old thread, I have made a new GUI (gActiveInv) with a button (btnActiveInv) set to PopupModal with a z order of 2, where the normal UI it will be overlaid onto has a z order of 1.

I want it to show up when an inventory item is selected (obviously), so...

Global Script:
Quote

function btnInvSelect_OnClick(GUIControl *control, MouseButton button)
{
  mouse.Mode = eModeUseinv;
  mouse.UseModeGraphic(eModeUseinv);
  btnActiveInv.NormalGraphic=player.ActiveInventory.Graphic;
  gActiveInv.Visible=true;
}


The selected inventory item becomes active, the cursor changes, but gActiveInv doesn't appear.
I've tried using (INV) as well, but nothing doing.

Help?

Thanks.

Version 3.0, by the way.
#15
The LazyTown game will be released in an episodic format! Yay!
This is because...
a) my plans for the game were getting so vast, and my procrastinating abilities so strong, that I probably would never have started working on the game again, let alone finished it.
b) I figured that, since half of my audience are going to be kids, a full game might have been a bit much for them in one big bite. Maybe I'm underestimating them, but whatever.
c) I'm lazy. Ironic, huh?

Plot
It's your first day in this strange new place called LazyTown.
You'll meet some of the residents, and soon find out that something is amiss...
Dun! Dun! DUNNNN!!!!

Screenie goodness


Old screens...


Progress diary
2008:-
* Feb. 28th(ish) - Downloaded AGS, started work on the game.
* Mar. 3rd - Released first version of the game's demo. Carried on working on it.
* Mar. 8th - Released second version of the demo. Carried on working on it for a few days.
* Mar. 12th(ish) - Decided to stop production until I'd fully planned the whole plot, puzzles, etc.
* Mar. 13th(ish) to Aug. 12th - Procrastinated a lot.
* Aug. 12th - Decided upon the new format, and started working on the game again! Yay!
* Aug. 29th - Scrapped the whole code and started again. Boo!
2009:-
* Jan. 17th - Started again again. Weh!
* Feb. 22nd - Completed basic "foundation" scripting.
* Aug. 3rd - Admitted defeat and asked for help with the dialogue.
* Sep. 9th - Received offer of help from smartgenes.
* Sep. 15th(ish) - Changed the main gui for the 17th time, with all the re-scripting that entails.
2010:-
COMPUTER DIED! :'(

But we'll be back.

Links
The demo's page on the database.
The demo's thread in the Completed Games section.
#16
I'm seeing things again.
I seem to keep finding this random shape everywhere I look.



Please, help me figure out what it is I'm seeing.
This means something... This is important...

Rules:
The only stipulation is that it should be obvious where the shape is within your finished image, and that it should... attract attention towards itself. Stand out, like.
Other than that, feel free to rotate and resize, and draw within and without the lines.
No colour or size limits.

The competition ends two weeks froooommmmm... right now! Go!

Have fun playing with the crayons, kids, and trophies will soonly be... trophised. 8)
#17
Hints & Tips / Dread McFarlane 2
Tue 01/07/2008 08:54:28
I'm pretty sure I've figured out what I need to do, but that broken shelf is in the way.
I think I've tried doing everything to everything with everything, but no luck.

Little help?

Thanks.
#18
Just found out about this, thought some of you might be interested.
If not, you should be.

http://stopvirgin.movielol.org

QuoteThe new CEO of Virgin Media, Neil Berkett, has openly stated in an interview that they think net neutrality is “a load of bollocks” and claimed they're already doing deals to deliver some people's content faster than others. They would then put websites and services that don't pay Virgin in the "slow lane", meaning those sites would load slowly and cause most users to give up using them, feeling forced to use whatever Virgin wants to push through their network.

This is not the first time an internet provider infringes upon net neutrality, but it is the first time that an ISP so brutally states that they simply plan to limit internet access to a television-like system in which the access provider completely regulates the content you have access to.

Virgin Media has over 3.5 million customers in the UK and the real danger is that when they start applying this system to their network, all major internet providers around the globe will soon follow the trend. Because this is exactly what major ISP's have been wanting to do for years.

It's in Revelations, people!
#19
Hello.
After a bit of searching, I figured this issue was advanced enough to be here.
So, two questions regarding text input.

1) Is it possible to make the parser ignore everything except a few key words (placed in any order), short of adding the entire language to the ignore list?
I tried a few different things, but it usually ended up just ignoring everything and treating the text as valid regardless of whether a key word was present or not.

2) Is it possible to log input text and refer back to it later?
For example, if you ask the player to type in their name, could you then have a character refer to them by that name in dialogue later?

Thanks.
J.
#20
Sorry if these are particularly simple questions, but I'm a bit stuck.
Any and all help would be greatly appreciated.

Okay, here goes...

1) When using a custom status text function in a room script, it only flashes on for a second before reverting to the global default. Is there a way I can override the "repeatedly executed" global code and make the room-specific code stick for as long as the mouse is over the hotspot?
Here's what I'm using at the moment (room script)...
Code: ags
function hRightedge_MouseMove()
{
 gIconBarStatus.Text=String.Format("Go back");
}


2) How do I get the status bar to recognise the GUI buttons? At the moment, they're not being picked up at all.
Here's what isn't working (Global)...
Code: ags
function btnIconInv_MouseMove() {
  gIconBarStatus.Text=String.Format("Look in your inventory");
}


Thanks in advance, and sorry again if I'm just being thick.
Let me know if you need me to post any more code.

Thanks again.
J.

(I forgot to mention that I'm using AGS 3.0)
SMF spam blocked by CleanTalk