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 - Ryan Timothy B

#521
The Rumpus Room / Re: AGS Doctor
Thu 16/05/2013 13:12:12
Doctor,
I have a friend who likes to push his farts into the couch cushions for other unsuspecting couch occupants. Is there any chance the forces and pressure of doing this could rupture his anus? Also how can he maximize and improve the quantity of this lethal injection into the soft foam?

Also.. could you hold my balls while I cough again? I kind of enjoyed it.
#522
Does anyone have a copy of this file (or another one)? The link is broken. Thanks!
#523
Code: ags

struct MyStruct{
  int a;
  String b;
  DynamicSprite *c;
  import void MyFunction(); 
};

void MyStruct::MyFunction() {
  this.a = 10;
  this.b = "Test";
  this.c.Delete();
}


This should do it for you.

And your last example would only altar a copy of the variables, not the variables themselves.


Edit: I forgot to include saying this, even though the question is answered, I'll add it for anyone else approaching this issue who stumbles upon this thread. You would call the struct function like so:
Code: ags

  MyStruct instance;  // creates the variable of the struct called instance
  instance.MyFunction();
#524
Quote from: Saltwater Taffy on Fri 10/05/2013 23:50:18
And, I really want some ice cream right now.

....and steak, lots of steak.
Uh-oh...
Cravings... pregnant?  :-D 

(I'm always starting rumors)


And yes. Welcome, everyone!
#525
Where is this located in your script? Animation calls don't like to be called in repeatedly_execute (or _always).
#526
What would possibly work best is having a MAGS competition only every other month.
#527
I thought you meant the button was over top of the character in the room.
Quoterepresents the character and moves in relation to the character
QuoteI need to have the button mimic the characters position

I'm assuming now you mean you want a compass or something that points towards the character. If that's what you want, I'll need a better description.
#528
Code: ags
Button30.X = cFrankj.x - GetViewportX();
Button30.Y = cFrankj.y - GetViewportY();


(you'll have to adjust +/- value, depending where you want it on the character)
#529
No no Leon. It still has the original game resolution, just upscales in your browser so you can actually see it (like the x2, x3 filter).

Also AGA, just use the nearest neighbor resizing instead of smooth scaling.
#530
Quote from: AGA on Fri 10/05/2013 09:54:25
I wonder whether I could make it a necessity to link to a games page entry when you start a new thread in Completed Game Announcements...  Hmm...
Eeek. I don't quite agree with this. There's a few games that people post in the completed games section that they don't quite want on their games list record. To my knowledge, Ben304 has released a few games in the completed games thread but didn't make a games page addition. Likely because they were Oceanspirit games, and in all seriousness, OSD games are a joke (*gasp* blasphemy!).
#531
@Phemar & Nanuaraq: It doesn't make a *huge* difference, but converting int to float or float to int takes a tiny bit of cpu time (just a tiny tiny bit, barely noticeable - all added together could possibly lower your FPS, but only if you were pushing the boundaries of AGS anyway doing a ton of math and other stuff; a regular adventure game will not do that). BUT, it's a better practice to do this:
Code: ags
IntToFloat(LUCK * LUCK)


Instead of:
Code: ags
IntToFloat(LUCK) * IntToFloat(LUCK)  // bad practice


Try to keep all your int calculations together and then convert. Same goes with float calculations (obviously).

Also instead of converting Random(100) to float, you should instead convert the first half of the condition to int. That way you could round (eRoundDown, eRoundNearest, eRoundUp). A float is a floating point number and does some pretty wacky stuff to store the number. It's not often you'll have a float number that is exactly 5, it'll generally do: 4.999999 or 5.000001 (that's written in the manual about float - and common programming knowledge).
#532
General Discussion / Re: AGS Kart
Thu 09/05/2013 18:46:33
Thanks for posting that. It's actually quite embarrassing the glitches the players can exploit.

I ended up watching a regular speed run of SNES MK and it's terrible. Laps are super short. Sound effects are really bad. I don't quite understand how the steering all works out. I'm really just going to design my own system that feels right to me (unless people don't like it).
#533
General Discussion / Re: AGS Kart
Thu 09/05/2013 00:24:52
Just to stir the dust and create anticipation, I'm currently working on the level editor for mine. Trying to decide what kind of gameplay I'm shooting for. I've ALWAYS had a strong passion for Diddy Kong Racing. It's probably the best karting game. But that's a lot of work.

I think I'll shoot for a direct copy of Mario Kart for now - maybe later versions of Diddy Kong? I still don't have a 100% test on rendering the whole map.
#534
I likely over read the tone.

I thought it was "Here we go again, we have someone making *more* suggestions". Unless he was referring to the part of dropping AGS Script for C# (which I agree is one hell of an undertaking - but probably much less work than reworking what's currently there to be *exactly* like C#; which has actually been suggested in the past by numerous people). I only mentioned it because it's something I would ultimately like to see done. I don't expect anyone to do it - but it would be surprisingly awesome.

And yes, I hadn't planned on doing these suggestions myself which is why I posted here. I don't have access to the wonderful version Crimson and the others have been working with, and I figured something like this was relatively easy as it was just a syntax thing - not true OO. I suppose I should've put "AGS clean refresh to OO *style*" in the subject. ;)
#535
Quote from: Monsieur OUXX on Tue 07/05/2013 10:08:39
Here we go again. :D
We have so many code geniuses developing AGS. If only they'd get started, it would be done in a month I'm sure!  :P
That was quite a bit sarcastic for no reason.

I was only putting the record out there that all these functions, in a non OO style, really don't fit with AGS. They're the things I constantly stumble on while programming - forgetting if this is the one that isn't in a OO style or the others.

Drop the attitude next time.
#536
Welcome Myinah
I'm generally always available for scripting assistance, or the nice people in the Beginners' or Advanced programming threads.

I look forward to seeing your progress.
#537
Quote from: Nanuaraq on Sun 05/05/2013 21:11:08
Oh, and Khris, I was sorta aware that I wasn't doing a "function within a function", since that would mean defining a function withint another function, yes? Bear with me for being imprecise, as I know you have before.
You named the thread "functions within functions". Which would be this:

Code: ags

function bakePie() {
  function eatPie() {
  }
}


Which is possible in a "real" programming language, just not AGS.
#538
Quote from: Calin Leafshade on Sat 04/05/2013 17:57:12
I like the idea but AGS script itself does not allow for a truly OOP style so your changes are just syntactic rather than organisational.
That's all I'm really going for - unless AGS script were to be removed for C# or Java (I prefer C# - and would even pay someone a little something of a bonus for a working C# version, perhaps something like Eclipse as the editor within AGS?).

And I mainly just meant organizational for the individual programmers using AGS.
#539
I would love to see AGS's default functions and variables being changed to a more solid OO method. Where things are more conformed and easier to remember and find. It ultimately "shouldn't" break backwards compatibility, still having access to both new and old - only these ones being in the autocomplete list and manual.

Whether the public agrees with this or not - I'm posting it anyway. If you don't agree with any of the name changes or I've missed something - feel free to respond.


List of new OO functions and variables (I accidentally made all variables first letter lower case - which isn't uniform to AGS, I'll edit later):
Code: ags
Background.ColorDepth()
Background.GetDrawingSurface()
Background.frame  <-- int
Background.Animate(Direction, int delay)
Background.StopAnimating()
Background.IsAnimating()

ROOM.Visited()
ROOM.Reset()

ROOM.width
ROOM.height

ROOM.WalkableArea.GetScalingAt(int x, int y)
ROOM.WalkableArea.GetScalingAtScreen(int x, int y)
ROOM.WalkableArea.SetAreaScaling(int areaID, int min, int max)
ROOM.WalkableArea.GetAreaAt(int x, int y)
ROOM.WalkableArea.GetAreaAtScreen(int x, int y)
ROOM.WalkableArea.DisableArea(int areaID)
ROOM.WalkableArea.EnableArea(int areaID)
ROOM.WalkableArea.IsAreaActive(int areaID)

ROOM.Layer.SetBaseline(int layerID, int baselineY)

ROOM.Edge.Bottom.y
ROOM.Edge.Left.x
ROOM.Edge.Right.x 
ROOM.Edge.Top.y 
ROOM.Edge.DisableAll()
ROOM.Edge.EnableAll()
ROOM.Edge.Bottom.active
ROOM.Edge.Left.active
ROOM.Edge.Right.active
ROOM.Edge.Top.active 

Screen.FadeIn(int speed)
Screen.FadeOut(int speed)
Screen.Flip(FlipDirection)  <-- new built-in Enum - instead of int
Screen.SetFadeColor(int red, int green, int blue)
Screen.ResetFadeColor()
Screen.SetTransition(TransitionStyle)
Screen.SetNextTransition(TransitionStyle)
Screen.Shake(int delay, int distance, int duration, BlockingStyle)
Screen.StopShake()
Screen.Tint(int red, int green, int blue, int transparency)  <-- added parameters
Screen.RemoveTint()

Viewport.x
Viewport.y
Viewport.Set(int x, int y)
Viewport.Get()  <-- Returns Vector2 of X and Y
Viewport.Release()
Viewport.FollowCharacter(Character character)
Viewport.Move(int x, int y, int speed, BlockingStyle)
Viewport.width
Viewport.height

Character.RemoveInventory(InventoryItem *item)
Character.IsInteractionAvailable(CursorMode)

Object.IsInteractionAvailable(CursorMode)

Hotspot.IsInteractionAvailable(CursorMode)

Cutscene.Start(CutsceneSkipType)
Cutscene.End()
Cutscene.Active()
Cutscene.Skipping()

Key.IsButtonDown(eKeyCode)  <-- to match Mouse.IsButtonDown

Game.IsInteractionAvailableAtScreen(int x, int y, int mode)
Game.SkipCharacterTravelTime(Character character)
Game.SetSpeechSkipAction(SpeechSkip)
Game.IsPaused()
Game.score
Game.GetLocationTypeAt(int x, int y)
Game.GetLocationTypeAtScreen(int x, int y)
Game.GetLocationNameAt(int x, int y)
Game.GetLocationNameAtScreen(int x, int y)
Game.gameSpeed

System.windowHeight
System.windowWidth

Font.GetTextWidth(String text, FontType)
Font.GetTextHeight(String text, FrontType, int width)



Click to see Overview (what is being replaced with what):
Spoiler
=== ROOMS ===================================
Background:
  ColorDepth
    ^  Change to: Background.ColorDepth()
  GetDrawingSurfaceForBackground(..)
    ^  Change to: Background.GetDrawingSurface()
  GetBackgroundFrame(..)  &  SetBackgroundFrame(..)
    ^  Change to: Background.frame  <-- int
  Add:
       Background.Animate(Direction, int delay)
       Background.StopAnimating()
       Background.IsAnimating()

  HasPlayerBeenInRoom(..)
    ^  Change to: ROOM.Visited()  <-- name may be misleading
  ResetRoom(..)
    ^  Change to: ROOM.Reset()
  Add:
         ROOM.width
         ROOM.height

Walkable Area:
  GetScalingAt(..)
    ^  Change to: ROOM.WalkableArea.GetScalingAt(int x, int y)
    ^  Add: ROOM.WalkableArea.GetScalingAtScreen(int x, int y)
  SetAreaScaling(..)
    ^  Change to: ROOM.WalkableArea.SetAreaScaling(int areaID, int min, int max)
  GetWalkableAreaAt(..)
    ^  Change to: ROOM.WalkableArea.GetAreaAt(int x, int y)
    ^  Add: ROOM.WalkableArea.GetAreaAtScreen(int x, int y)
  RemoveWalkableArea(..)
    ^ Change to: ROOM.WalkableArea.DisableArea(int areaID)
  RestoreWalkableArea(..)
    ^ Change to: ROOM.WalkableArea.EnableArea(int areaID)
  Add:
       ROOM.WalkableArea.IsAreaActive(int areaID)

Walk-behind Area (changed to: Layer):
  SetWalkBehindBase(..)
    ^  Change to: ROOM.Layer.SetBaseline(int layerID, int baselineY)

Edge (this one is overkill on the OO - need suggestions):
  BottomEdge > Add: ROOM.Edge.Bottom.y  <-- int
  LeftEdge   > Add: ROOM.Edge.Left.x    <-- int
  RightEdge  > Add: ROOM.Edge.Right.x   <-- int
  TopEdge    > Add: ROOM.Edge.Top.y     <-- int
  Add:
       ROOM.Edge.DisableAll()
       ROOM.Edge.EnableAll()
       ROOM.Edge.Bottom.active <-- Boolean
       ROOM.Edge.Left.active   <-- Boolean
       ROOM.Edge.Right.active  <-- Boolean
       ROOM.Edge.Top.active    <-- Boolean



=== SCREEN ==================================
  FadeIn(..)
    ^ Change to: Screen.FadeIn(int speed)
  FadeOut(..)
    ^ Change to: Screen.FadeOut(int speed)
  FlipScreen(..)
    ^ Change to: Screen.Flip(FlipDirection)  <-- new built-in Enum - instead of int
  SetFadeColor(..)
    ^ Change to: Screen.SetFadeColor(int red, int green, int blue)
    Add: Screen.ResetFadeColor()
  SetScreenTransition(..)
    ^ Change to: Screen.SetTransition(TransitionStyle)
  SetNextScreenTransition(..)
    ^ Change to: Screen.SetNextTransition(TransitionStyle)
  ShakeScreen(..) & ShakeScreenBackground(..)
    ^ Change to: Screen.Shake(int delay, int distance, int duration, BlockingStyle)  <-- changed parameters
    Add: Screen.StopShake()
  TintScreen(..)
    ^ Change to: Screen.Tint(int red, int green, int blue, int transparency)  <-- added parameters
    Add: Screen.RemoveTint()

Viewport
  GetViewportX()
    ^ Change to: Viewport.x   <-- int
  GetViewportY()
    ^ Change to: Viewport.y   <-- int
  SetViewport(..)
    ^ Change to: Viewport.Set(int x, int y)
  Add:
       Viewport.Get()  <-- Returns Vector2 of X and Y
 
  ReleaseViewport()
    ^  Change to:  Viewport.Release()
  Add:
       Viewport.FollowCharacter(Character character)  <-- releases viewport if character leaves room
       Viewport.Move(int x, int y, int speed, BlockingStyle)
       Viewport.width
       Viewport.height



=== CHARACTER ===============================
  Character.LoseInventory(..)
    ^ Change to: Character.RemoveInventory(InventoryItem *item) <-- keeping opposite of: AddInventory
  Add:
       Character.IsInteractionAvailable(CursorMode)

=== OBJECT ==================================
  Add:
       Object.IsInteractionAvailable(CursorMode)

=== HOTSPOT =================================
  Add:
       Hotspot.IsInteractionAvailable(CursorMode)



=== CUTSCENE ================================
  StartCutscene(..)
    ^ Change to: Cutscene.Start(CutsceneSkipType)
  EndCutscene(..)
    ^ Change to: Cutscene.End()
  Game.InSkippableCutscene
    ^ Change to: Cutscene.Active()  <-- possibly misleading
  Game.SkippingCutscene
    ^ Change to: Cutscene.Skipping()



=== KEY =====================================
  IsKeyPressed(..)
    ^ Change to: Key.IsButtonDown(eKeyCode)  <-- to match Mouse.IsButtonDown



=== GAME ====================================
  IsInteractionAvailable(..)
    ^ Change to: Game.IsInteractionAvailableAtScreen(int x, int y, int mode)
  SkipUntilCharacterStops(..)
    ^ Change to: Game.SkipCharacterTravelTime(Character character)  <-- changed parameters
  SetSkipSpeech(..)
    ^ Change to: Game.SetSpeechSkipAction(SpeechSkip)  <-- new built-in enum - instead of int
  IsGamePaused ()
    ^ Change to: Game.IsPaused()
  GiveScore(..)
    ^ Change to: Game.score  <-- int
  GetLocationType(..)
    ^ Change to: Game.GetLocationTypeAt(int x, int y)
      Add: Game.GetLocationTypeAtScreen(int x, int y)
  Game.GetLocationName(..)
    ^ Change to: Game.GetLocationNameAt(int x, int y)
      Add: Game.GetLocationNameAtScreen(int x, int y)
  GetGameSpeed()  &  SetGameSpeed()
    ^ Change to: Game.fps  <-- int


 
=== SYSTEM ==================================
  System.ScreenHeight
    ^ Change to: System.windowHeight
  System.ScreenWidth
    ^ Change to: System.windowWidth



=== TEXT ====================================
  GetTextWidth(..)
    ^ Change to: Font.GetTextWidth(String text, FontType)
  GetTextHeight(..)
    ^ Change to: Font.GetTextHeight(String text, FrontType, int width)



=== SRIPTING ================================
  While in a "global" script you must refer to the room by name. EG:
    rBeach.Background.Frame = 2;
  OR adding a "currentRoom", equivalent to "player":
    currentRoom.Background.Frame = 2;





=== OTHERS THAT NEED ATTENTION ==============
IsSpeechVoxAvailable()
IsTranslationAvailable()
IsTimerExpired(..)
SetTimer(..)
IsInterfaceEnabled()
DisableInterface()
EnableInterface()
GetGameOption()
SetGameOption()
DisableGroundLevelAreas(..)
EnableGroundLevelAreas(..)
AreThingsOverlapping()
GetRoomProperty()
GetTextProperty()
ChangeRoomAutoPosition()
[close]

I'm sure there's plenty more - these are just the ones that I could remember or saw while quickly scrolling through manual
#540
General Discussion / Re: AGS Kart
Fri 03/05/2013 05:15:17
Hey Khris, your game seems to run easily at 40fps, have you tried to up your game resolution to 640x400/480? Assuming yours is as easy as mine at changing game resolutions.

Edit: I actually PM'd SteveMcCrea, 2 days ago to ask for his assistance on my temporary math issue (using parts of his source code), but didn't realize he hadn't been on since April 1st. Does anyone know if he's okay? Does anyone have him on Skype or anything?
SMF spam blocked by CleanTalk