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

#81
Code: ags
int DC_UP[33];
int DC_DOWN[33];
int DC_LEFT[33];
int DC_RIGHT[33];

DC_UP[0]=0;     <---ERROR
DC_DOWN[0]=1;


error: room41.asc(6): Error (line 6): Parse error: unexpected 'DC_UP'

:/
#82
BTW...
Why do we have to launch the GUI of CMake? I didn't even write in any info on it's main screen; went off and compiled fully without a hitch. :/
#83
I have a multi-purpose object; it has X loops, each one representing an animation of a weapons pick-up.
When the character has 'walked over' this object, it defaults loop=0, the default animation (say an opened crates with nothing in it).
Do I just re-assert a new Loop with SetView()?

Also, can you use an object instead of a character you control? Eg. you hit arrow keys to control it's direction, acceleration etc. but it's still an object.
#84
Character has Loop as non-readonly, and also has FaceDirection(eDirectionXXX) - how do I do this with an Object?
#86
Too late - found it, broke my brain.
It's a doing a simple vector collission line-by-line. Or something.

I found this easier algorithm here (https://www.geeksforgeeks.org/find-two-rectangles-overlap/) which sees if two rectangles are overlapping, and returns true if they are. I converted to this:

Code: ags
function IsOverlappingCO(Character *ch, Object *ob)
{
  int v = ch.View;  
  ViewFrame* frame = Game.GetViewFrame(v, 0, 0);
  int wC = Game.SpriteWidth[frame.Graphic];
  int hC = Game.SpriteHeight[frame.Graphic];
  
  // +---^---+
  // |   |   |
  // |   |   |
  // <---X--->
  //character measures from bottom-centre corner up
  
  //actual coords +/- dimensions  
  int TLCharX = (ch.x - (wC/2));
  int TLCharY = (ch.y - (hC));
  int BRCharX  = TLCharX + wC;
  int BRCharY  = TLCharY + hC;
  
  //==
  
  int wO = Game.SpriteWidth[ob.Graphic];
  int hO = Game.SpriteHeight[ob.Graphic];
  
  // ^-------+
  // |       |
  // |       |
  // X------->
  //object measures from bottom-left corner up
  
  //actual coords +/- dimensions
  int TLObjX = ob.X;
  int TLObjY = ob.Y - hO;
  int BRObjX = ob.X + wO;
  int BRObjY = ob.Y;
  
  //             l2
  //             tlobj
  //             +---------+
  //             | obj     |
  //      l1     |         |
  //      tlchar |         |
  //      +-----------+    |
  //      | char |    |    |
  //      |      |    |    |
  //      |      +----|----+r2
  //      |           |     brobj
  //      +-----------+r1
  //                   brchar
  //
  
  // the line cannot have positive overlap
  if (TLCharX == BRCharX || TLCharY == BRCharY || TLObjX == BRObjX || TLObjY == BRObjY) return false;

  // If one rectangle is on left side of other
  if (TLCharX >= BRObjX || TLObjX >= BRCharX) return false;

  // If one rectangle is above other
  if (TLCharY >= BRObjY || TLObjY >= BRCharY) return false;

  return true; 
}


Pending glaring errors, this means I can compare the whole of a character, to the whole of an object - without worrying about their points of origin or that a character must be 'standing on a object', etc. etc.

Can anyone see anything wrong with it? Calculation's, logic?
1. It figures out width, height of the Character, and then absolute top-left and bottom-right corners of it's sprite in real coords (not just 0+length,0+height, but their position on screen)
2. Same for Object
3. Checks if they are not touching - return false
4. Checks if there are off to eachother's right or left - return false
5. Checks if there are above or below one another - return false
6. Otherwise, they have some part overlapping - return true

??
#87
Do you happen to know the function name/asc file where The Art of Dying has the AABB code? Found the source.
#88
Oh I’ve grabbed art of dying code; now there’s the fun of interpreting it :/  will check for collision code.
Do you see any hope in artificial transplant of aabb code on to character sprites?
(As opposed to objects)
#89
I want to check a collision (or overlap) between my character and the 'borders' of the maze (ie. the walls). I've run out of objects (40 used) so I must use the object that represents the maze 'board' - with transparencies to move through.
How is this possible?
My main character has hardly any transparency around edges, but obviously the maze image has lots through and around it.
Would I better of using and detecting walkable areas drawn where the 'solid' bits of the maze are?
#90
Something tells me this function won't work... but how else do I get the hotspot ID/character ID?
I'm using named Characters (cC1, cC2 etc.) to represent protestors, and hotspots to represent different classes of directions (eg. green squares = hHotspot3 = the 'DownLeft' choices of next direction.

Code: ags
//arguments: takes the character walking over a hotspot 'ch', the hotspot itself 'hs', x/y coords (ie. of tank)
//result: decides which new direction is the shortest line between the ch.x,y and tank x,y, chooses this as new direction
function ChooseDirectionBasedOnDisanceToTank(character ch, hotspot hs, int x, int y)
{
  //down:
  if (hs.ID==3 || hs.ID == 6 hs.ID==7 || hs.ID==11 || hs.ID==14 || hs.ID==15) {    //hotspots that contain down as direction
    //todo: write (ch.x, ch.y+10) coords into decision
  }
  //up
  if (hs.ID==9 || ....
    //todo: write (ch.x, ch.y-10) coords
  }

  //todo: review array, find smallest dx,dy line joining x,y and ch.xy, choose direction
}

//hotspot functions
function hDownLeft_WalkOn()
{
  if (character.ID>=59 && character.ID<=63) {  //one of the 5 'crowds'
    if (hotspot.ID!=character.GetProperty("AG_current_hotspot") && hotspot.ID>0) {
      ChooseDirectionBasedOnDisanceToTank(character.ID, hotspot.ID, x, y);
    }
  }
}


#91
Okay, very informative; but how do I make hotspots interactive with anything? Just characters instead of objects sounds like a good idea..?

The game unfortunately is 1366x768 and not pixeley enough.
#92
I've started a Pacman-like 'minigame' on an 'arcade machine' in whick a Tank (you) - using arrow keys to get around the maze - is following crowds (AI/enemies). Your mission - to crush the protesting crowds before a) the timer runs out and/or b) before they destroy your tank from behind with molatovs.

I've come up with I think a reasonable strategy or programming the crowds where to go; there are 10-15 types of hotspot, each with the directions a crowd can choose to go in (UpLeft, DownRight, UpLeftDown, etc.), pasted over all corners of the maze. They can then go in one of the directions, depending on which way the Tank is, and which direction he's going in (towards=fear, away=attack).

Only problem is:
-I don't know if this is actually a crap strategy
-and I don't know how you get anything but an object interacting with another object. You can get a character 'sandng on' a hotspot, but not an object.

There's a limit of 40 on-screen objects; yet if I put in 'decision cube' sprites with objects to replace the hotspots, there's waaaay more than 40 (about 75?).

Pls halp I don't know wha I'm doing :/
#93
'CI'='Continuous Integration'?
Or is it just 'command line' and I've got the I/L wrong?
Either way - thumbs up. Some kind of fully scriptable compile, with bash/perl/batch/etc. will be so excellent :)
#94
Excellent :)

I get the following error when run from the command-line in 3.5.1:



Still it was via the Mac command-line; when I ran it on Windows 'cmd.exe', it worked well.
However I notice there's no 'force rebuild of every file', it just creates the exe and exits.

In the new build tools, are there options to set the version number, game description etc. as in everything in General Settings?
#95
Looking to automate my build process.

(You know - type less :)
#96
It's a compiled version of the Mac (3.5.0) engine; not really a wrapper. Well, in the sense it wraps a system-agnostic version of the game (say the windows exe file) as a Mac .app?...
#97
Well there it is - I *didn't* write an unobservable error. Yay :P
#98
Does it 'snap back' in native Windows?
#99
Aw man, I knew I'd forgotten something :P

CW - yes but 57 is not the highest or lowest ID, it isn't at the bottom or top of the dialog list/subfolders, etc....

It's a Mystery - with Father Revere.
#100
Okay, found it - on a totally different line, in dialogue 57 (wtf?) -- a SayBubble contained two sets of Double Quotes in it, so it became a weird, improperly terminate string with 'Doctor' in the middle.

with Double Quote marks around ' "Doctor" Braun ':
Code: ags
cMainframe.SayAtBubble(mainframe_talk_x,mainframe_talk_y,"&36 Hahahahahahahaha! Oh yes -- *"Doctor"* Braun. What was it he was a doctor of? Dog-ology or something?");


...but was supposed to use two Single Quotes around ' ''Doctor'' Braun ' (the usual technique of hiding shitty delimiters):

Code: ags
cMainframe.SayAtBubble(mainframe_talk_x,mainframe_talk_y,"&36 Hahahahahahahaha! Oh yes -- *''Doctor''* Braun. What was it he was a doctor of? Dog-ology or something?");


Hard to see the difference; that's the last time I just copy+paste the tester's corrections off a giant spreadsheet :/

Had to wipe/refill every dialogue with recompile to find the one with the error.
SMF spam blocked by CleanTalk