Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Messages - Crimson Wizard

Pages: [1] 2 3 ... 387
Okay I see now, this is what Jack thought and posted in his reply above.

Top of global
Code: Adventure Game Studio
  1. int lbs = Weight_Ozs / 16; // how many full lbs are there
  2. int osz = Weight_Ozs % 16; // how many osz remaining

This is wrong, and not what I meant. I did not suggest to add these as global variables.
You cannot use math expression when setting global variables value anyway; and that does not make sense too, because variables won't have their values automatically updated when Weight_Ozs changes.

So, this is not about math anymore, now it is only about scripting.

First, start with the connection between different values.
These are two functions that return LBS and OSZ remainer from Weight_Ozs:
Code: Adventure Game Studio
  1. // Returns full LBS from the Weight_Ozs
  2. int GetWeightLBS()
  3. {
  4.     return Weight_Ozs / 16;
  5. }
  6. // Returns number of OSZ remaining after subtracting full LBS from the Weight_Ozs
  7. int GetWeightOSZ()
  8. {
  9.     return Weight_Ozs % 16;
  10. }

Now you can use these functions like:
Code: Adventure Game Studio
  1.   LWeight.Text = String.Format("%d", GetWeightLBS());
  2.   LWeightOZ.Text = String.Format("%d", GetRemainingOSZ());

What you have to do after, is remove Weight variable, that stores full LBS, and keep the weight only in Weight_OSZ. That is, for example, when you increase by 1 osz you do "Weight_OSZ += 1", and when you increase by 1 lbs you do "Weight_OSZ += 16". (I hope I got it right, because I do not know osz/lbs system well)

Code: Adventure Game Studio
  1. function Button6_OnClick(GUIControl *control, MouseButton button)
  2. {
  3. if(Button6.NormalGraphic==7){
  4.   Button6.NormalGraphic=8;  
  5.   Weight_Ozs += 3 * 16 + 2; // 3 lbs and 2 osz
  6.   Axe=true;
  7.   }
  8.   else if(Button6.NormalGraphic==8){
  9.   Button6.NormalGraphic=7;  
  10.   Weight_Ozs -= 3 * 16 + 2;
  11.   Axe=false;
  12.  }
  13. }

Which could be simplified even further to make weight values easier to read and fix, for example:
Code: Adventure Game Studio
  1. #define WEIGHT_OF_AXE (3 * 16 + 2)
  3. function Button6_OnClick(GUIControl *control, MouseButton button)
  4. {
  5.    if ...
  6.       Weight_Ozs += WEIGHT_OF_AXE;
  7.    else if ...
  8.       Weight_Ozs -= WEIGHT_OF_AXE;
  9. }

But where did you put the code that I suggested? Where is it in the script?

global pane
in all the button that add subtract ozs..:(

I am sorry, but I do not understand what you are saying.
Could you show an example of actual script that uses these calculations?


Code: Adventure Game Studio
  1. int lbs = Weight_Ozs / 16; // how many full lbs are there
  2. int osz = Weight_Ozs % 16; // how many osz remaining

GlobalScript.asc(7): Error (line 7): Expected integer value after '='

Do you have variables with same names used already anywhere? Is Weight_Ozs defined before this code?

E: Where did you put this code anyway?
Don't say you just put it in the beginning of GlobalScript, outside of all functions... :(

My advice - keep everything in the "lowest" units (ozs ?) only, - Weight_Ozs.

There is a very useful math operation, called "remainder of division", in AGS it's done using "%" operator. E.g. 20 % 16 = 4.
Also, what is very useful, when you divide integer numbers, any fractions are discarded. E.g. with integers 20 / 16 = 1.

Use these two "features". When you need to show weight components on screen, or use them in some other calculations, do this:

int lbs = Weight_Ozs / 16; // how many full lbs are there
int osz = Weight_Ozs % 16; // how many osz remaining

LWeight.Text = String.Format("%d", lbs);
LWeightOZ.Text = String.Format("%d", osz);


There is a NON-DOCUMENTED exception to PlaceOnWalkableArea, which I found only by reading the engine code. Character will not be moved, if walkable area is beyond the room Edges.

Yours main walkable area in that room is exactly below the "bottom edge".

Solution: adjust the room's edges.

(E: On further thinking, that kind of makes sense, since edges usually define exit zones. There's still an issue however, that PlaceOnWalkableArea is secretly used in some engine functions related to walking/moving character, which may cause trouble. Perhaps adding special mode to "ignore edges" may be a good idea)

E2: Another possible reason why PlaceOnWalkableArea may not work: it does not check every pixel of the walkable area mask, but makes checks with 5 pixel interval. Which means that if your walkable area is 1 to 4 pixels thick there is a chance it will be missed.

Egmundo Huevoz, there is a topic with same name just 2 topics below and made 2 days ago!

Please, do forum search before posting a scripting question.

Use any hosting service, Dropbox, Mediafire, google drive, etc, etc.

Could you upload your room, or at least walkable area mask image?

I wanted to start prototyping something (something simple, for now, as suggested), and considering what framework/engine to use. First I thought about Unity, but that may be an overkill.
Javascript may be a good choice since it does not require much to install (browser). Does anyone know a good Javascript framework that can just display 2D art on screen, maybe with simple GUI support? I am familiar only Babylon.JS, but it is a 3D engine, which may be too much.

IDk if related, but I made a bug ticket about this a while ago, but did not do any research since this was never reported by actual game developer.

Sorry, I spent about an hour composing an answer to Le Woltaire, and editing this post, but then decided to completely abandon it. I do not really see how all that is relevant to the topic author's question.
I have nothing else to submit here at the moment.

- I proposed the support of vector based file formats. (2D at least)
- I proposed a deep understanding of 3d max and maja files and characters with animation support.
- I proposed subpixel rendering for scaled sprite movements.

None of these important steps has been realized in the past 10 years...
That's not a real developement after all...
There is no progression.

No wonder there was no progression. Everyone was proposing, but who was to do all the actual work???!!!

Beginners' Technical Questions / Re: Object.Name is blank
« on: 15 Jan 2018, 01:10 »
Object.Name is not the script name, it is the property called "Description" the the Editor, which is rather used as hotspot's description for player.

Use Room Object, and set its transparency to non zero.

My conclusion is that the problem is not the adventure game genre.
It is the mouse and input device driven game play and the morphology that does not allow
the full perception of the games possiblilities.

The real future of adventure gaming can be found in the holodeck.
As soon as a holodeck is possible where people can life their adventure truly,
any computer based game will not make sense anymore.

Okay, but simply having a device won't automatically make games interesting. Someone still needs to program it, therefore same game design issues will be met.

BTW, I do not know if other countries have this, in Russia a new entertainment industry appeared in last several years, which gives you a "real life" adventure in a limited enviroment, with something similar to "escape the room" tasks.
EDIT: Probably like this:

Bit hacky but it works. Still curious why it happened in the first place, though!

Did you try changing character locations, like spreading them out?

I had a suspicion that in "Sierra" mode Say command has a stricter limit to how close to the screen border the text can be.

@Snarky: I do use a custom say function, but all it does is check for emotional states so I can change the talking portrait. The aliens don't even USE talking portraits.

So, you are using Sierra-style speech. Do they have a dummy speech views assigned or none at all?
Also, will it change anything if you move these characters to different locations?

Beginners' Technical Questions / Re: Screen Resize
« on: 14 Jan 2018, 11:04 »
If you are using AGS 3.4.1, then you may also set default game scaling on the Default Setup page in the editor.

Pages: [1] 2 3 ... 387