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

#41
Advanced Technical Forum / Re: Screenshot bug?
Tue 29/09/2009 20:45:52
Yes, exactly! Ive tried at various sizes, and its quite noticeable at larger resolutions.

Ok, so then if it scales it down to 160 x 100, then with the template it resizes it back up to whatever values #define SL_WIDTH  and  #define SL_HEIGHT are set to.

So now I understand why the save screenshot preview looks "ok" but in the load preview its pixelated!

Ok, so in game start I will set game.screenshot_width and game.screenshot_height to the values of #define SL_WIDTH  and  #define SL_HEIGHT  aswell.

Ill let you now whats up with that.

For the 2nd problem, I didnt change ANYTHING at all...I copied everything in my game folder and just pasted it into the 2nd computer...on one the screenshots work, on the other, the screenshot "eats thru" the GUI...without changing a single thing (script, art, modules, you name it).

I can provide someone with a test game if they want...and send it to them by email if they would liek to see whats up.

Im not sure what more information I should provide though! :(

**EDIT**

Ok, I imported my whole game  folder into a 3rd computer (a friend's,,,windows vista)...and the save screenshots work OK too...so I have 1 cpu (windows xp 32) that the screenshots dont work ok...instead of seeing a screenshot loaded on the button, its like the whole button becomes invisible and pokes a button-size hole into the GUI so we see the background behind it....weird!

So 2 computers it works ok, 1 computer it doesnt.

What could conflict with AGS`s screenshot function in this computer so it doesnt work? Codecs...software conflict, logged on as admin, etc...

?
#42
Advanced Technical Forum / Screenshot bug?
Tue 29/09/2009 17:36:23
Hi GUYS...and uh, gals....

Ive run into a possible snag-a-roonie (in 2 parts) with the screenshot feature and Im not sure if its a bug though. Here is the prob:

Part 1
Ive been using the template A.S.S.
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=38928.0

for saving with screenshots. Ive got it to work ok. When I save, I see a nice screenshot (good graphics), but when I load, the screenshot seems "scaled down" in quality...like more pixelated...is this a bug? I contacted the author and did everything OK (kept the aspect ratio to 4:3 for the button that shows the screenshot)...etc

Part 2
This is even weirder! So I got the screenshots to work...but when I export the whole game folder + savegame folder to abother computer...that works (I can load the screenshots ok) BUT...when I try to save a new savegame + screenshot, it seems it loads a transparent image that cuts through my GUI...Why does it work on one computer, and not the other one?

The cpu it works on is windows vista 64 bits...the one it doesnt is XP 32 bits.

Im dumbfounded!

And dumb.
#43
Hi DUDES...

I wont even pretend I know where to start on this one...so Ill just say what I want to get done, somehow...I figure it has to do with the length property though:

Code: ags

Length property
(Formerly known as global function StrLen, which is now obsolete)

readonly int String.Length;

Returns the length of the string, in characters.
Example: 

String text = "This is my string.";
Display("Length: %d", text.Length);



What Im trying to do is limit the player's save game names to a certain length, like I dont want people to be able to save titles longer than say...10 characters (for example).

How would I go about making this a reality?

PS: I pee in the shower
#44
Hi KhrisMUC,

Nice. This is elegant! I had to remove the && player.WalkSpeedX == 20) part for the mm == eModeWalkto to get it to work. Why is that? (Just want to understand whats going on under the hood, so to speak).

Code: ags

  else if (button == eMouseLeft) 
  {
    int mm = mouse.Mode;
    if (mm == eModeWalkto) 
    {
      // switch to walk speed
      player.StopMoving();
      player.ChangeView(7);
      player.SetWalkSpeed(4, 4);
    }
    else if (mm == eModeRun) 
    {
      mm = eModeWalkto;
      if (player.WalkSpeedX == 4) 
      {
        // switch to run speed
        player.StopMoving();
        player.ChangeView(23);
        player.SetWalkSpeed(20, 20);
      }
    }
    ProcessClick(mouse.x, mouse.y, mm);


Ps: If you dont mind me saying...you guys are good. Real good. 
:D

So it works!
#45
Hi guys,

I placed this here (look at end of the script):

Code: ags

function on_mouse_click(MouseButton button) 
{

  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) 
  {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }
  else if (button == eMouseLeft) 
  {
    ProcessClick(mouse.x, mouse.y, mouse.Mode );
  }
  else if (button == eMouseRight || button == eMouseWheelSouth)
  {
    // right-click our mouse-wheel down, so cycle cursor
    mouse.SelectNextMode();
  }
  else if (button == eMouseMiddle) 
  { 
    // Middle-button-click, default make character walk to clicked area (a little shortcut)
    // Could have been just "player.Walk(mouse.x,mouse.y)", but it's best to
    // leave our options open - what if you have a special script triggered
    // on "walking" mode?
    ProcessClick(mouse.x, mouse.y, eModeWalkto); 
  }
  else if (button == eMouseWheelNorth) 
  { 
    // Mouse-wheel up, cycle cursors 
    // If mode isn't WALK, set the previous mode (notice usage of numbers instead
    // of eNums, when it suits us)...
    if (mouse.Mode>0) mouse.Mode=mouse.Mode-1; 
    else 
    { 
      // ...but if it is WALK mode...
      if (player.ActiveInventory!=null) 
      {
        //...and the player has a selected inventory item, set mouse mode to UseInv. 
        mouse.Mode=eModeUseinv; 
      }
      else 
      {
        // If they don't, however, just set it to mode TALK (change this line if you add more cursor modes)
        mouse.Mode=eModeQuestion; 
      }
    }
  }
  if ((mouse.Mode==eModeRun)&& (mouse.IsButtonDown(eMouseLeft)))
  {
    cEgo.MovementLinkedToAnimation = false;
    cEgo.StopMoving();
    cEgo.SetWalkSpeed(20, 20);
    cEgo.ChangeView(23);
    cEgo.Walk(mouse.x,  mouse.y, eNoBlock);
    cEgo.MovementLinkedToAnimation = true;
  }
}



Everything works fine...but I tried the "bool" thing, couldnt get it to work. Once I use the run mode, my character runs successfully to the spot I clicked...but when I try to use the normal walk mode, it uses the same view + speed I set for the run.

How do tell AGS to revert back to the proper view + speed for the walkto mode  once I no longer use the run mode?


---EDIT---

Ok well in the function on_mouse_click I added this at the end after my run mode:

Code: ags

  if ((mouse.Mode==eModeWalkto)&& (mouse.IsButtonDown(eMouseLeft)))
  {
    cEgo.MovementLinkedToAnimation = true;
    cEgo.StopMoving();
    cEgo.SetWalkSpeed(4, 4);
    cEgo.ChangeView(7);
    cEgo.Walk(mouse.x,  mouse.y, eNoBlock);
  }


It works, as in...when I run, he runs to the spot with proper view + proper speed...and when I click on walk afterwards...it gives me the #7 view at a 4,4 speed...

However, I think this might be an unattractive/too complicated way of achieving what I want. Im sure there is a "better way"...

Plus, lets assume thats an "ok" way to do it, instead of plugging values like (4,4) or (7)...how can I query those values that are set in the properties windows directly? Somthin' like (getdefaultspeed.x, getdefaultspeed.y), know what I mean?
#46
Hi Amigos,

Ive got a new one for you all...let me explain what Im trying to accomplish, and what i tried to do...and how I failed miserably and deserve a brutal beating (preferably with a wet cod).

Ok, what I want to do is have another mouse mode which is Run. Ive got the mouse cursor mode set at ID13. It is set to "standard mode". ScriptID is eModeRun. I thought that to get this, all I have to do is in my rep_exec, check if my mode is set to the Run mode, get the left-click position of my mouse...change the animation speed + view...and then go to that x,y position.

Now, here is what I tried (without success):

In my rep_exec:

Code: ags

  if (mouse.Mode==eModeRun)
  {
    cEgo.StopMoving();
    cEgo.SetWalkSpeed(4, 4);
    cEgo.ChangeView(7); 
    cEgo.Walk(mouse.x, mouse.y);

//    ProcessClick(mouse.x, mouse.y,eModeWalkto); 
//    player.Walk(mouse.x, mouse.y, eBlock);
  }


I commented out the final two lines cause Im not sure which to use, and how. I know I have to "process" the x + y coordinates of my mouse, and save it somewhere...and then tell AGS to make my character "run" to that spot, but Im not entirely sure how to do this.

Right now, with what I have, the character moves to where my mouse is, not where I click...so when I move the mouse, it follows the mouse cursor (doesnt process the click!)...oh, also, if I choose "eblock", while the character moves I get my wait cursor (which I understand why), but I dont want this...so when I click "noblock", then the character doesnt even move at all!

I looked for "run cursor", "running mode", "cursor running mode", etc...in the threads without luck...although Im sure someone will say "dude, this has been answered a gazillion times over!"

:P


----EDIT---

Hey, I tried this, it works...but is it a "good way" of doing what I want to achieve?
The only thing is now my view mode stays at 23...how would I make it go back to my normal walk view when Im no longer in run mode?

Code: ags
  if ((mouse.Mode==eModeRun)&& (mouse.IsButtonDown(eMouseLeft)))
  {
    cEgo.MovementLinkedToAnimation = false;
    cEgo.StopMoving();
    cEgo.SetWalkSpeed(20, 20);
    cEgo.ChangeView(23);
    cEgo.Walk(mouse.x,  mouse.y, eNoBlock);
    cEgo.MovementLinkedToAnimation = true;
  }


Also though, with this code I get bugs when I use the cursor with gui's, etc...so Im not sure if I should place it in the rep_exec?
#47
Hey Monkey,

Sorry if I wasnt very clear...Ive been watching too many movies of turtles lately and it tends to mess me up quite a bit (see the link) LOL!!

Thanks for you help though, I *think* I understand what you mean with never calling the code.

#48
Hey!
I used your suggestions...

This is what I did:

Put this in my GlobalScript.ash:
Code: ags

import function ResetTextGUI();


Placed this sucker in my GlobalScript.asc:

Code: ags

function ResetTextGUI() 
{
   SetTextWindowGUI (7);
   Game.SpeechFont = eFontNormal;
}


so...after every dialog I just call that to set the text back to default.

Thanks everyone!

:)
#49
Hey Khris!

Code: ags
function SayCustomFont(this Character*, String message) 
{
 if (this == cEgo) 
 {
   SetTextWindowGUI (19); 
   Game.SpeechFont = eFontEgoSpeech;
 }
 else if (this == cRoger) 
 {
   SetTextWindowGUI (16);
   Game.SpeechFont = eFontRogerSpeech;
 }  
 else
 {
   SetTextWindowGUI (7);
   Game.SpeechFont = eFontDefaultSpeech;   
 }


I think the main problem is where I have "else"....I know I need some sort of :

else if (this=not a character speaking but just a normal text display")
{
   SetTextWindowGUI (7);
   Game.SpeechFont = eFontDefaultSpeech;
}

its the "not a character speaking" script I cant seem to get.
#50
Ok, sorry for re-opening this but I hit this one little snag-a-roonie:

As you know, everything is ay-oh-kay, however, when normal text has to be displayed (like displayAt or something), it will use the last used "SetTextWindowGUI" color...how would one go about making it so that if no character is speaking and the "normal text" to be displayed is always the same SetTextWindowGUI"...

I tried this but it doesnt work:

Code: ags
 else
 {
   SetTextWindowGUI (7);
   Game.SpeechFont = eFontDefaultSpeech;   
 }


Im thinking that "else" will cover everything, as in, if no one is speaking, but its normal text, the SetTextWindowGUI will always be #7.

#51
Ok, well I got exactly what I wanted! Thanks for this link...and thanks to  Edmundo Ruiz (edmundito, netmonkey) for this module!

Here is what I did for those who might want a step by step:

Put this in your GlobalScript.asc:

Code: ags

bool useFancyIconbar = false;
bool iconbarVisible = false;

function ShowIconbar()
{
  gIconbar.SetPosition(0, -gIconbar.Height);
  gIconbar.Transparency = 100;
  iconbarVisible = true;
  
  gIconbar.StopAllTweens();
  gIconbar.TweenPosition(0.2, 0, 20, eEaseInEaseOutTween);
  gIconbar.TweenTransparency(0.2, 0, eEaseInEaseOutTween);
}

function HideIconbar()
{	
	iconbarVisible = false;
	gIconbar.StopAllTweens();
  gIconbar.TweenPosition(0.2, 0, -gIconbar.Height, eEaseOutTween);
	gIconbar.TweenTransparency(0.2, 100, eEaseOutTween);
}

function repeatedly_execute() {
  
  // put anything you want to happen every game cycle, even when
  // the game is paused, here
  
  if (mouse.y > gIconbar.Height && iconbarVisible)
  {
    HideIconbar();
  }
    
  if (mouse.y <= 102 && !gIconbar.Visible && !IsGamePaused())
  {	
    ShowIconbar();
  }  
  
  if (IsGamePaused() == 1) return;
  

  // put anything you want to happen every game cycle, but not
  // when the game is paused, here
}


Notes:

1) "  gIconbar.TweenPosition(0.2, 0, 20, eEaseInEaseOutTween);"
I set the 3rd value to 20 because my statusline is 20 pixels high...and I wanted my iconbar to slide from beneath the statusline.

2) "  if (mouse.y <= 102 && !gIconbar.Visible && !IsGamePaused())"
I set the value to 102 because that is the height of my iconbar.

3) If you want your iconbar to slide from under the statusline, just make sure in properties that your status line has its zorder set above your iconbar.

4) Make sure you set your gIconbar's visibility to "Pause game when shown" in its Appearance/Properties.

Thats it! Now you have your iconbar sliding SMOOTH AS ICE* from under your statusline when your mouse is at the top of the screen.



*(I get a shudder of shame whenever I say stuff like that, but its fun)
#52
Ok that could be promising. Thanks for the link, Ill see what I can do with it.
#53
Hi fellow turtle-lovers,

Ive been searching like a madman for help on sliding the iconbar down smoothly when your mouse goes to the top of the screen. I could only find this one, and another one too but the poster's link is broken (he answered with a link that now I cant access).

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=21153.0

I will continue searching, however if someone directly knows where a thread treating this subject would be...well just fork it over babay!!

If not, well...any help on this would be f#@%in' great.
#54
Well everything works great.

I decided to put everything as a mini tutorial so if ever people use the search function they come across this thread, it will be nice and clear!

To have your own fonts + colors per character, do this:

Step 1
Add this to your GlobalScript.asc:

function SayCustomFont(this Character*, String message)
{
if (this == cEgo)
{
  SetTextWindowGUI (19);
  Game.SpeechFont = eFontEgoSpeech;
}
else if (this == cRoger)
{
  SetTextWindowGUI (16);
  Game.SpeechFont = eFontRogerSpeech;
}  
else
{
  SetTextWindowGUI (7);
  Game.SpeechFont = eFontDefaultSpeech;  
}

The number next to GUI in parathensises is the number of the textGUI you want displayed for that character...when you change its text color in its properties, that changes the color of your character's font. The "eFont_yourfont" part...well, just place  the font's script name you have designated for that particular character's speech font...and voila!

Step2

Place this in your GlobalScript.ash:

import function SayCustomFont(this Character*, String message);

Step3

When you type in dialog text, use this syntax instead of the traditional way (example):

 cEgo.SayCustomFont("Hi, I'm using a custom font.");
 cRoger.SayCustomFont("So am I! My font is different to yours!");

If you want to display your dialog options, use this syntax:

player.SayCustomFont(dDialogname.GetOptionText(1));

...where "player" can be replaced with "cEgo", and the number is the number of the dialog option question...cDialogname is the name of your current dialog.

Now you have it all setup so that each character will have their own color + font (and text border too)!!

Thanks to everyone who contributed...Im sure this will be added in a new version of AGS though...but atleast we gots this now, temporarily :)
#55
Quote from: KhrisMUC on Fri 28/08/2009 05:57:16
Uncheck Say and copy the option text to the dialog script.

Hi Khris,

You know, I actually thought of doing that...I guess I was thinking "nah, Im sure theres a way to do it within the custom script"...bah, I guess sometimes we just dont have to make things complicated for ourselves!

Aight...Im doin' it that way, save myself some trouble :)
#56
Quote from: KhrisMUC on Thu 27/08/2009 15:36:50
Use Radiant's FontEdit to repaint a not needed character ( e.g. / ) into the TM.
In the (dialog) script, write "RTFM/" and in-game, the / is replaced with TM.

Me tinks ya fergut two put a variable in your script thar.
#57
Oh, and I love turtles.

OKTHANKSBYE
#58
Gilbet V7000a....holy. (insert expletive here)!!

Wowza...its works now...man, thanks to you all...

EDIT: Ive got one little prob though since the last time I posted (doin' tests and whatnot)...check this image out---->




If I have the option "say" at the dialog options,  when the main character says the question, the SayCustomFont function doesnt know whos speaking, so it just uses the last font that was previously displayed...

How could I work around this? What function does AGS use to display the question you wrote in the options? (if it was character.say, wouldnt the SayCustomFont function pick it up?)


#59
Arrr!! Skuttleman mee boy!

Ok, did that, one step closer :)

Now me gets this little DoOzee:

Dialog 0(5): Error (line 5): Type mismatch: cannot convert 'const string' to 'string'

I'll continue scratching me head on this one...

PS: Whats a "const string"...construct string? Ill look it up to see if I can find out what this is.
#60
Hi AdamM,

I put this in GlobalScript.asc:

function SayCustomFont(this Character*, string message)
{
if (this == cEgo)
{
   Game.SpeechFont = eFontEgoSpeech;
}
else if (this == cRoger)
{
   Game.SpeechFont = eFontRogerSpeech;
}
// else ...

//etc. for every character in the game that you want to use a custom font

this.Say(message);
}

And this in my dialog:

// Dialog script file
@S  // Dialog startup entry point
//EGO: "Excuse me...!"
//ROGER: "Hey, whats up!"
  cEgo.SayCustomFont("Hi, I'm using a custom font.");
  cRoger.SayCustomFont("So am I! My font is different to yours!");
return

However, I get this error:

Dialog 0(5): Error (line 5): '.SayCustomFont' is not a public member of 'Character'. Are you sure you spelt it correctly (remember, capital letters are important)?

What did I do wrong?

I feel we're gettin' close though!
SMF spam blocked by CleanTalk