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

#481
I am sorry to review this *old post again.
But I think I had found another small issue.
I can actually keep walking in any direction in diagonal as well.
But when we are running, we can't actually move to the DOWN-RIGHT side (roll)
Can you confirm this kind of issue in your free time ?

Thank you in advance 

[EDITED]
My mistake only, it's everything work perfectly.
#482
Hello

1)
I am not sure why you are getting the error when the player try to change the room..
But if you can show your code this could be helpful somehow..


2)
For a testing purpose you could try to set in the room editor pane the (WalkToX, WalkToY) to a specific Hotspot and see if that work
Code: ags

// Example: 
player.Walk(hTable.WalkToX, hTable.WalkToY, eBlock, eWalkableAreas);
// will move the character to hotspot hTable's walk-to point

I am not that kind sure if that could help about the issue but you can have a try


3)
I don't know at all how the 'LW_BASS_V2.0' Template work at all, but I would do something like this
a) Create a Gui and a Label
b) Rename the script name of the Gui in gHotspotname
c) Rename the script name of the label in lblHotspotname
d) Rename the text of the label in @OVERHOTSPOT@
e) In the room editor pane, for a specific Hotspot, rename the (name/description) with some text 
Code: ags

// eg from a great master 
// set every game cycle the position of the Gui just next the mouse

function room_RepExec()
{
  int x = mouse.x, y;
  int width = GetTextWidth(lblHotspotname.Text, lblHotspotname.Font);
  if (mouse.x - (width / 2) < 0) x = 0;
  else if (mouse.x + (width / 2) >= System.ViewportWidth) x = System.ViewportWidth - width;
  mouse.y + (Game.SpriteHeight[mouse.GetModeGraphic(mouse.Mode)] / 2) + 2;
  if (y > System.ViewportHeight) y = mouse.y - GetTextHeight(lblHotspotname.Text, lblHotspotname.Font, width) -
  (Game.SpriteHeight[mouse.GetModeGraphic(mouse.Mode)] / 2) - 2;
  gHotspotname.SetPosition(x, y);
} 



I hope it's been helpful.
But there will probably someone more experienced who can help you further
#483
Or if you just miss this part from the manual..

Operator  Description              Example


  !    NOT                        if (!a)
  *    Multiply                   a = b * c;
  /    Divide                     a = b / c;
  %    Remainder                  a = b % c;
  +    Add                        a = b + c;
  -    Subtract                   a = b - c;
  <<   Bitwise Left Shift         a = b << c;
       (advanced users only)
  >>   Bitwise Right Shift        a = b >> c;
       (advanced users only)
  &    Bitwise AND                a = b & c;
       (advanced users only)
  |    Bitwise OR                 a = b | c;
       (advanced users only)
  ^    Bitwise XOR                a = b ^ c;
       (advanced users only)
  ==   Is equal to                if (a == b)
  !=   Is not equal to            if (a != b)
  >    Is greater than            if (a > b)
  <    Is less than               if (a < b)
  >=   Is greater than or equal   if (a >= b)
  <=   Is less than or equal      if (a <= b)
  &&   Logical AND                if (a && b)
  ||   Logical OR                 if (a || b)

You can find it by pressing F1 inside AGS and type in on the search bar 'Operators'

I thought this was useful to recall
Quote from: alphadalekben on Sat 30/05/2015 16:39:52
Oh right, I never knew about the "==" and "=" thing.

Then, I'm not sure but..
Code: ags

function room_RepExec()
{
  if (IsKeyPressed(eKeyM))
  {
    SetBackgroundFrame(1); // <--------
  }
}
//mirror
  if (BgMirrored == 1 && SetBackgroundFrame == 0) // GetBackgroundFrame() == 0
  {
    SetBackgroundFrame == 2; // <----------
  }
#484
Dumb answer that solves a quarter of your message ;


- struct
Declares a custom struct type in your script.
Structs allow you to group together related variables in order to make your script more structured and readable. For example, suppose that wanted to store some information on weapons that the player could carry.
Code: ags

struct Weapon {
  int damage;
  int price;
  String name;
}; 


Now, you can declare a struct in one go, like so:
Code: ags

Weapon sword;
sword.damage = 10;
sword.price = 50;
sword.name = "Fine sword";

Much neater and better organised. You can also combine structs with arrays




- Arrays
Arrays allow you to easily create several variables of the same type.
Code: ags

int health[50]; 


This example declares 50 int variables, all called health.
You access each seperate variable via its index (the number in the brackets). Indexes start from 0, so in this case the health array can be accessed by indexes 0 to 49. If you attempt to access an invalid index, your game will exit with an error.

Here's an example of using the array:

Code: ags

health[3] = 50;
health[4] = 100;
health[player.ID] = 10; 


this sets Health 3 to 50, Health 4 to 100, and the Health index that corresponds to the player character's ID number to 10.




// ============================================================================ //

Hopefully this will help you
#485
this, have no sense.

Code: ags

function hSlot2_Look()
{
function hSlot2_Look()
{
Display("Code cards go in here to access the EVA suit storage.");
}
}
#486
Quote from: AprilSkies on Sat 21/02/2015 10:39:54
Holy F**k!!!
<3

Holy S**t !!! <3
This is very nice Arj0n 8-) Bravo
#487
You can try with the Tween Module that probably will work..

Code: ags

player.TweenTransparency(2. , 0, eEaseInTween, eNoBlockTween); // example
#488
Quote from: AnasAbdin on Sat 14/02/2015 17:33:52
This game is so good we are dying to play it and determined to finish it 8-)

Damn yeah, I want to get both of the thropies now! :-D
#489
I thank thee RetroJay <3
This is for people like me : Easy Mode. (Checkpoints on every door that you paint.) (laugh)
Amazing!


Thank you very much RetroJay again, and for your patience too :)
#490
Quote from: HAL on Sat 14/02/2015 12:11:33
That worked!
So I just need to make sure to add a decimal .0 after assigning float values.

floating-point numbers

The idea is to compose a number of two main parts:

a) A significand that contains the number's digits. Negative significands represent negative numbers.

b) An exponent that says where the decimal (or binary) point is placed relative to the beginning of the significand.
Negative exponents represent numbers that are very small (i.e. close to zero).

Such a format satisfies all the requirements:

° It can represent numbers at wildly different magnitudes (limited by the length of the exponent)
° It provides the same relative accuracy at all magnitudes (limited by the length of the significand)
° It allows calculations across magnitudes: multiplying a very large and a very small number preserves the accuracy of both in the result.

Decimal floating-point numbers usually take the form of scientific notation with an explicit point always between the 1st and 2nd digits.

#491
Well Cassiebsg has already answered to your questions as well.
If you have to somehow move inventory items to another character you could do something like this

Code: ags

//                    in GlobalScript.ash                   //

import void GiveAllInventory(this Character*, Character *other); 



Code: ags

//                    in GlobalScript.asc                  //

void GiveAllInventory(this Character*, Character *other) 
{
  int a = 1;
  while (a <= Game.InventoryItemCount) 
  {
    other.InventoryQuantity[a] += this.InventoryQuantity[a];
    this.InventoryQuantity[a] = 0;
    a ++;
  }
   UpdateInventory();
 }
} 


You can use it in this way then
player.GiveAllInventory(cDummy); Or cDummy.GiveAllInventory(player);


Regarding the cloths ability I suggest you to enumerate them all first..
After that need to create a structure and assign it to an array for example.

Code: ags

struct cloths 
{
  String name;
  int ability, defense, level;
  // etc etc
}; 

cloths type[4];
export type; 



Then you can assign the necessary values to them
Code: ags

function game_start() 
{
  type[1].name = "Jacket";
  type[1].ability = 5;
  type[1].defense = 5;
  type[1].level = 1;

  type[2].name = "Armor Shield";
  // etc etc
} 


#492
Ciao Mandle, thanks for answering.

Quote from: Mandle on Fri 13/02/2015 12:16:30
I would just turn off debugging mode before releasing the game

Oh.. I didn't thought that the debugging mode generate the textual warnings...
This is cute to know (still learning)

Before reading your message I tried to solve this error again..
And, I got it work by doing this.. (in debug mode)
Code: ags

function btnQuitGame_Click(GUIControl *control, MouseButton button) 
{
  int i = 0;
  while (i < 3)
  {
    if (MyDynamicSprite != null) MyDynamicSprite.Delete();
    i ++;
  }
  QuitGame(0);
}


But I got it work without message error then.. :-\
It's okay now, (i think)
#493
Hello guys,

I don't know where to write this thought so I will write down here below...
I think some of you will feel bored reading this and I'm feel sorry already.

When we generate a DynamicSprite by
1° - DynamicSprite.CreateFromFile(string filename)
2° - DynamicSprite.CreateFromScreenShot(optional int width, optional int height)
3° - Etc etc

This command loads an extra sprite into memory which is not controlled by the normal AGS sprite cache and will not be automatically disposed of. Therefore, when you are finished with the image you MUST call Delete on it to free its memory

DynamicSprite.Delete();
You do not normally need to delete sprites, since the AGS Sprite Cache manages loading and deleting sprites automatically.
However, when an extra sprite has been loaded into the game then AGS does not delete it automatically, and you must call this command instead.


So I generate a DynamicSprite inside a room and I have also a button that quit the game.
(Yes, I think some of you have already figured out what I'm about to say)
But when i quit the game,
Ags create for me a textual warning by saying that the DynamicSprite has never deleted.
I have something like this (and actually doesn't solve the problem)
Code: ags

function btnQuitGame_Click(GUIControl *control, MouseButton button) 
{
  if (MyDynamicSprite != null) 
  {
    MyDynamicSprite.Delete();
    // MyDynamicSprite = null (?)
   }
  QuitGame(0);
}



How do you guys generally solve this kind of error ?
Any help is appreciated..

Ps: I don't have any module imported inside
(I'm running with 3.2.1)

However..
This is what I have
Code: ags

// MyDynamicSprite (Global variables)

function repeatedly_execute_always()
{

  ViewFrame *v = Game.GetViewFrame(player.View, player.Loop, player.Frame);
  int s = v.Graphic;

  MyDynamicSprite = DynamicSprite.CreateFromExistingSprite(s);
  oObject.Graphic = MyDynamicSprite.Graphic;

}



Ciao grazie :~(
#494
Ehy RetroJay,

I'll be honest here but I keep dying all the time again :-D

I wish I could have some kind of cheats...
...but jokes aside, I still have to finish it (?!!) (roll) eheh

I'll definitively put this game on my folder of (Only great games build in Ags are allowed here !) :-D
#495
Ciao RetroJay,

I really got fun playing this game :-D
It made me remind Dangerous Dave in the Haunted Mansion, do you know this ?
Only good thoughts for me anyway, congratulations again :)
#496
Ciao RetroJay,

The graphics looks beautifully very cute 8-)
Congratulations.

I definitely want to play this right now :-D
Downloading -
#497
As slasher said before, you can make it easily by your own.
You should check this sections on the manual if you want to use the default one by AGS

game.score
The player's score. To modify the score, use the GiveScore script function.

game.score_sound
Sound effect to play when the player gets points, originally set in the editor.

game.total_score
Maximum possible score, initially set in the editor. 

GiveScore
Adds SCORE to the player's score. This is preferable to directly modifying the variable since it will play the score sound,
update any status lines and call the GOT_SCORE on_event function.


function on_event (EventType event, int data)

      eEventGotScore 
      called whenever the player's score changes
      DATA = number of points they got



String formatting
You will find many times in your game when you need to create a string based on the values of variables,
and functions like Display and String.Format allow you to do so.

#498
Thank you very much AprilSkies :)
I was willing to open a topic in the beginner section in the forum but I could not cause of this error :~(

I look forward, thank you again :)
#500
I can remember one time it happened something like this to me too.
but still not sure if it is the same case.
I solved by changing number of that specific sprite.
I still don't know why at all... but to me it worked that way...
Can you try this ?


:NOTE:
Changing the sprite slot number is a specialized operation, for advanced user only.
Only re-number the sprite if you are ABSOLUTELY SURE it is not used AT ALL in your game.
Any parts of your game that do use this sprite will cause the editor and engine to crash if you go ahead.
SMF spam blocked by CleanTalk