AGS v2.7 Final: Yet Another Edition

Started by Pumaman, Sat 13/11/2004 21:02:00

Previous topic - Next topic

Rui 'Trovatore' Pires

Hmmm, but that one's been there for a loong time now, ain't it? I thought it even had it's own tracker entry.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

RickJ

Idea:  Could the room id numbers be enumerated constants so that you could use either the room name or the room number? 

So instead of this: 
character[EGO].ChangeRoom(0, 100, 50);

You would something like this:     
character[EGO].ChangeRoom(eIntro, 100, 50);

AGS Newbie

I've been experimenting with two of the new features in this beta version - Int to Float and Float to Int. I've been attempting to display a floating number on a GUI label. For example, displaying the number 1.50 or 15.3.

However, when executing the program, the number remains to be displayed as a fixed number, opposed to a floating one. 1.50 is only displayed as 1 and 15.3 is only displayed as 15. How can I properly script these numbers as floats ?

Thanks.

Gilbert

#203
Quote from: Pumaman on Thu 23/12/2004 22:58:26Anyway, beta 8 is now up. This fixes a few things, and adds a float data type. Currently Display() doesn't support floats, so there's no way to display the current value of one other than doing a FloatToInt on it and displaying the rounded value. I'm looking into solutions for this.

So, no, you can't display a floating point number at the moment, they're currently used only for in-game calculations.

BTW CJ: I see that it's just a start, but the current set of floating point functions are obviously not that enough, I think at least arctan/arcsin/arccos and RaisetoPower (float base, float power) can be useful additions (only square root is not really enough).

strazer

#204
You can't create member functions that have the same name as a built-in global function.
Is this something that can be fixed?

Edit:

I get

Quote
Exception 0xC0000005 at EIP=0x005E6AB1, AGSE v2.70.549

if I do this:

Code: ags

// Main header script

#define AGS_MAXREGIONS 16 // including region 0!

struct ccsRegionType {
  short framesounds[128000]; // 3d array: AGS_MAXVIEWS*AGS_MAXLOOPSPERVIEW*AGS_MAXFRAMESPERLOOP
};


Code: ags

// main global script file

ccsRegionType ccsRegion[AGS_MAXREGIONS];



and try to save the game. Can anyone confirm this?

AGS Newbie

Understood, thanks for clearing that up, Gilbot. I'm glad to hear though that float calculations are getting more attention though, as I've been trying to display float numbers in my game for nearly a year now. I thought that perhaps this was the implementation that I was looking for. I considered writing a custom plug-in, but didn't want to limit the portability of games on different platforms. Anyway, thanks again, I'm sure it will be implemented sooner or later.


Gilbert

#206
Actually there're workarounds for displaying decimal numbers.
If you want to display a float variable, say, num with 3 decimal places, you can do something like:

int tempnum=FloatToInt(num * 1000.0, eRoundNearest);
Display("The number is:%d.%03d",tempnum/1000, temp%1000);

EDIT: Fixed it so it actually works.
Reminder: As the engine can't do type conversions internally, you need to use (num*1000.0) instead of (num*1000), else there'll be a typemismatch error (as 1000 is an integer, but 1000.0 is "not" an integer).

strazer


Jet Kobayashi Zala

I've noticed since... I believe Beta 7 that when I start doing a lot of GUI work (making more than one with several objects per GUI), it'll stop allowing me to name the GUI controls, and shortly after that, I get the following crash error:

(Exception 0xC0000005 at EIP=0x00428F52, AGSE v 2.70.549)

On a side note, I'm not sure if this would have happened before B7 since I only recently went GUI-building-crazy and started shortly after Beta 7 came out.

Radiant

Regarding Sierra-style-portraits with character speech...
the character only loops his talking animation for a certain amount of time depending on text length.
However, after this time, he will no longer blink either!

Plus a small feature request: portraits are alternately displayed on the left and right side of the screen... it would be nice if all portraits on the right side were mirrored horizontally.

TerranRich

These additions are scary and confusing, to say the least. I desperately hope that these new object-oriented commands and variables will be explained in the manual, because I don't quite get them as of yet. :P
Status: Trying to come up with some ideas...

Pumaman

QuoteMaybe it's just my Linux chm viewer acting up but could it be that a lot of entries for the new functions don't link to their anchors on the respective pages in the help file?

Can you give an example?

QuoteAlso, I'm in favor of object-ising walkable areas, regions and walkbehinds as well.
As it is now, their functions seem out-of-place compared to the rest of the scripting language.
I vote for at least grouping them via static member functions so you have the advantage of auto-completion.

The reason I haven't done this is that I didn't want to obsolete more functions than necessary, where there wasn't a clear benefit in making the switch.
However, you may be right -- it might be better to get it all over with now and change the lot, rather than coming back in a few months time and deciding to change them after all.

QuoteAnd how about merging PlaySound and PlaySoundEx now that parameters can be optional?
Not specifying a channel would use PlaySound as usual, otherwise it would act like PlaySoundEx.

That would indeed be possible now; I'd have to rename PlaySound in order to do so, however. Perhaps this can wait until and if the global functions like PlaySound get objectised.

QuoteLittle bug: GUIs are displayed under 'display' text, but over 'displayspeech' text.

This is the way things have always worked; it's not necessarily intuitive, but it's just the way AGS works. There is an outstanding request to allow DisplaySpeech to be displayed on top of GUIs.

QuoteIdea:  Could the room id numbers be enumerated constants so that you could use either the room name or the room number? 

Yeah, script names for rooms have been requested before. It's not something I'm aiming to add in 2.7 though.

QuoteBTW CJ: I see that it's just a start, but the current set of floating point functions are obviously not that enough, I think at least arctan/arcsin/arccos and RaisetoPower (float base, float power) can be useful additions (only square root is not really enough).

Well, the ones I added are ones I've noticed people requesting in the past. If atan/asin/acos/power are functions people would find useful, then I can certainly add them. Any others while we're at it?

QuoteYou can't create member functions that have the same name as a built-in global function.
Is this something that can be fixed?

Unfortunately this is non-trivial to fix... this is one reason why it'd be nice to make everything object-based to clear the global namespace, but it's not something I'm too concerned about at the moment.

QuoteI  get
Exception 0xC0000005 at EIP=0x005E6AB1, AGSE v2.70.549
if I do this:

Well spotted -- this happens if a single array is bigger than 32 KB. I'll get it fixed.

QuoteI've noticed since... I believe Beta 7 that when I start doing a lot of GUI work (making more than one with several objects per GUI), it'll stop allowing me to name the GUI controls, and shortly after that, I get the following crash error:

Thanks for the bug report -- I think I've located the problem and will fix it for the next beta.

QuoteRegarding Sierra-style-portraits with character speech...

Ok, can I please request that there are no further feature requests in this thread. There's quite a lot of stuff to deal with in terms of the scripting changes, so can we leave other things aside for now.

QuoteThese additions are scary and confusing, to say the least. I desperately hope that these new object-oriented commands and variables will be explained in the manual, because I don't quite get them as of yet.

I'll write an "upgrading to object-based scripting" guide before 2.7 Final is released.

strazer

Quote from: Pumaman on Sun 02/01/2005 17:44:24Can you give an example?

If I choose "Text Scripting" -> "Character functions and properties" from the contents and click
  SetCharacterProperty
it jumps to its position on the page, but when I click
  View property
for example, it jumps to the top of the page. This happens with a lot of the new entries. As I said, it may be a quirk of the Linux program I'm using.

Quote from: Pumaman on Sun 02/01/2005 17:44:24The reason I haven't done this is that I didn't want to obsolete more functions than necessary, where there wasn't a clear benefit in making the switch.
However, you may be right -- it might be better to get it all over with now and change the lot, rather than coming back in a few months time and deciding to change them after all.

If you intended to change them anyhow, I agree now would be the time to do so.

Quote from: Pumaman on Sun 02/01/2005 17:44:24That would indeed be possible now; I'd have to rename PlaySound in order to do so, however. Perhaps this can wait until and if the global functions like PlaySound get objectised.

Ok, I didn't realize the function would have to be renamed. In that case it can probably wait.

Quote from: Pumaman on Sun 02/01/2005 17:44:24Unfortunately this is non-trivial to fix... this is one reason why it'd be nice to make everything object-based to clear the global namespace, but it's not something I'm too concerned about at the moment.

I see, no problem.

Quote from: Pumaman on Sun 02/01/2005 17:44:24
Well spotted -- this happens if a single array is bigger than 32 KB. I'll get it fixed.

Cool, thanks.

Pumaman

QuoteIf I choose "Text Scripting" -> "Character functions and properties" from the contents and click
  SetCharacterProperty
it jumps to its position on the page, but when I click
  View property
for example, it jumps to the top of the page. This happens with a lot of the new entries. As I said, it may be a quirk of the Linux program I'm using.

I just gave it a quick try and it worked fine -- probably some quirk of your Linux reader, as you say.

QuoteIf you intended to change them anyhow, I agree now would be the time to do so.

Well, I'm still unconvinced of the need. What do other people think; is it worth objectising the hotspot/region/etc functions? (eg.  hotspot[3].Disable  rather than  DisableHotspot(3)  ) or should they just be left alone?

QuoteOk, I didn't realize the function would have to be renamed. In that case it can probably wait.

Yeah, it's backwards compatibility -- if it wasn't renamed, and the engine was used to run an old (2.62) game, it would only push one argument to the function, and mess the stack up.

RickJ

Quote
Well, I'm still unconvinced of the need. What do other people think; is it worth objectising the hotspot/region/etc functions? (eg.  hotspot[3].Disable  rather than  DisableHotspot(3)  ) or should they just be left alone?
I would be for it, especially if we would also be able to use script names/pointers as we are with objects, characters, and GUIs; i.e.  hMySpot.Disable();.  Seems like they should all work the same way. 


Pumaman

Ok, beta 9 is now up. This completes float support by adding support for it to Display (in the form of %f), and adding the ArcCos/sin/tan and RaiseToPower functions.
If there's anything else that anyone is keen to have in terms of float support, now's the time to speak.

Beta 9 should also solve the stability issues that some people have been having with the editor -- two seperate crash bugs have been fixed, so if you get any crashes with beta 9 please let me know.

QuoteI would be for it, especially if we would also be able to use script names/pointers as we are with objects, characters, and GUIs; i.e.  hMySpot.Disable();.  Seems like they should all work the same way. 

Yeah, it would be nice to have them all working like that. I propose to add hotspot and region objectisation for the next beta and then call it a day, again unless anyone has good reasoning to do anything else.

strazer

Quote* Added AGS_MAX_* constants to allow you to check the AGS limits in your script (see Constants section in the manual).

Cool, very helpful!
Won't you be able to use the constants yourself for the internal header? Should save you some work, too, no?

Quote* Fixed compiler crash if a single array or struct was bigger than 32KB.

Whee, my script now works like a charm. Thanks a lot, CJ! :)

AGS Newbie

Wow, the ability to finally display floats ! This was my most wanted feature to be implemented in AGS for a year now. With this, I should be able to properly finish my game. Thanks very much, CJ !

Okay, the only difficulty now though, is properly implementing this new feature. My scripting goal is to:

1) Add the floating numbers 12.50 and 1.10 together into one variable.
2) Use StrCopy to a copy the total float value to a string.
3) Display the floating number as a GUI Label.

However, my attempts at doing this seem to be unsuccessful as far. Would someone mind drawing out some simple code to demonstrate how this is done ? I noticed that the f% command needs to be present, but the proper usage is not yet documented.

An error also occurs when attempting to create a floating integer ? Is there another method to accomplish this ?

The goal though, one method or another, is to add two floats together
and display the total float value on a GUI label.

Any help would be most appreciated.

Thanks.

Pumaman

string buffer;
float first = 12.50;
float second = 1.10;

StrFormat(buffer, "%f", first + second);

lblLabelName.SetText(buffer);


where lblLabelName is the name of the GUI label

If you're having problems, please post the EXACT error message as well as the script code you're trying to use.

jetxl

whine...
s3m still doesn't work. still can't release mie littl' game.

SMF spam blocked by CleanTalk