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

#121
also - i'm having trouble figuring out how to draw onto a gui ... could you point me in the right direction?

figured it out.
#122
Quote from: Vince Twelve on Wed 09/06/2010 20:08:47
To get it on top of the characters, you would draw it to an object, GUI, or overlay.  You would then Wait() for however long you want it to show up and then release the drawing surface, delete the sprite, dispose of the overlay, whatever is appropriate to clear out that memory.  You'll need to read about dynamic sprites and drawing surfaces in the manual if you're not clear on them.

Let me know if you need something more specific.

To be honest ... that is exactly how i thought i would need to do it ... i just was wondering if there might be a simpler way.  Maybe a piece of code or something i knew nothing about.  Anyway being that this is the case - i did read up on dynamic sprites some and experimented with it but couldnt seem to get it to work just right so that this line that is drawn would be deleted (not just hidden) after the wait time ... and actually wait() wouldn't work here cus i don't want other scripting to halt ... so i should probably use a timer correct?
#123
Quote from: Vince Twelve on Wed 09/06/2010 19:40:08
When you draw a line, the whole line just pops into existence, it doesn't start at one end and grow outwards.  Is that what you're trying to do?

If you want to do that, it's going to be more complicated because you'll have to calculate the point forming an increasingly large line segment each frame and draw the line onto a GUI or overlay every frame until it reaches the other character.

Is that what you want to see?  The line starting at one character and growing outwards until it reaches the other character?

well having it drawn from point a to point b would be nice - but if the code is too complicated its not necessary ... the most important things are how to get the line above the characters and get it to be deleted.
#124
there is a function in AGS called Random.  Here is the help file info on it (should be useful to you):

Random

Code: ags
Random (int max)

Returns a random number between 0 and MAX. This could be useful to do various effects in your game.
NOTE: The range returned is inclusive - ie. if you do Random(3); then it can return 0, 1, 2 or 3.

Example:
Code: ags

int ran=Random(2);
if (ran==0) cEgo.ChangeRoom(1);
else if (ran==1) cEgo.ChangeRoom(2);
else cEgo.ChangeRoom(3);


will change the current room to room 1,2 or 3 depending on a random result.
#125
I've searched the AGS help files for this and i can't find anything that i understand well enough to be of any help.  I am drawing a line from one character's coordinates to another characters coordinates.  The first issue is I need the line to appear ON TOP of the characters not below them on the background.  The second issue is I need to be able to "Delete" the line pretty much as soon as its finished drawing.  It needs to be "Deleted" in such a manor as if it were never there to begin with.  So I guess what i'm trying to say is simply "hiding" the drawing probably won't work (at least I don't think it would be the best idea).  The third issue - although not really an issue - more of a question: can  you change the speed at which the line is drawn?

Possibly useful information:
I have it set so that the line is drawn from cCharacterA's x,y TO cCharacterB's x,y because the characters are moving around the screen randomly so at any one point when this script is initiated the characters could be anywhere on screen.  This isn't an issue as I know how to code this ... i just thought it might effect how to do the other stuff i'm having problems with. So keep that in mind.

Recap:
1) Need the line to appear above characters.
2) Need line to be deleted after being drawn.
3) Can you change the speed in which the line is drawn?
Keep in mind: Characters move randomly around.

thanks.
#126
Quote from: AdamM on Wed 09/06/2010 00:13:28
So:

Code: ags
ViewFrame *frame = Game.GetViewFrame(cEgo.NormalView, 0, 0);

//And then:

cEgo.z=(0 - (Game.SpriteHeight[frame.Graphic] / 2));



That, uh, that would work, right?

where would you put that? in Room Load?
#127
The issue is:

When characters walk from point A to point B (say one character is walking to another character) AGS takes your move character code and tells the bottom coordinates of one image  to move to the bottom coordinates of the other image right?  (if the character was a human who had feet then the general area of the "bottom coordinates" would be where the characters feet are) Everyone still with me?

I hope so ... so anyway - what we have happening is character a walks to character b's position and stops when character a's feet touch character b's feet - maybe that cleared it up for anyone i lost.

well my issue is this ... i dont need ags to take the bottom right corner of the image and move it to a destination ... i want it to take the top center of the image and move it to the destination.  does that make sense? i sure hope so cus i need to figure this out .... help ... please .... pretty please.
#128
Quote from: Khris on Sun 06/06/2010 18:34:18
Drew, this won't work as intended.

Your code will only check if the player is within a 200x120 rectangle to the top-right of the NPC.

Code: ags
  int xd = player.x - cNPC.x, yd = player.y - cNPC.y;
  if (xd >= -200 && xd <= 200 && yd >= -120 && yd <= 120) {
    ...
  }


As for the actual distance, there are several threads dealing with that, including how to check for the NPC being inside an ellipse, like Lyaer explained.
The factor's supposed to be 200/120 = 1.67, btw.

yeah i noticed that it wasn't working exactly as i intended as i continued to play with it. I did come up with this though ... which looks basically like what you came up with only my version is longer and more complex where yours is a simplified version. Right?

Code: ags

if ((cNPC.x - cPlayer.x < 200) && (cNPC.x - cPlayer.x > -200) && (cNPC.y - cPlayer.y < 120) && (cNPC.y - cPlayer.y > -120)) {
      ........
  }


I'm fairly new to coding and understanding everything AGS can do but i'm learning ... sometimes i find myself doing things the "long" way when there is a "shorter" way to do it or better way.  But thank God we have these wonderful forums where people are willing to help.

THANKS GUYS!
#129
I have it set up so that when  you push a button something will happen if the main character is close enough to the NPC.  I'm having a hard time trying to figure out how to check and see if the Main Character's x,y coordinates are within a certain distance of the NPC's x,y coordinates. Heres a piece of my code that i need help with:

Code: ags

 if ((cNPC.x <= 200 cMainCharacter.x) && (cNPC.y <= 120 cMainCharacter.y)) {
    stuff happens;
    }


my idea behind this was simple:
if the NPC's x coordinate is within 200 of the Main Characters x coordinate AND the NPC's y coordinate is within 120 of the Main Characters y coordinate then stuff would happen.

For some reason, AGS doesn't like my code though.  Can you guys help me out?


EDIT:
Okay, i'm an idiot. lol. i figured it out ... in case anyone else has this problem the solution i came up with is:

Code: ags

if ((cNPC.x - cMainCharacter.x <=200) && (cNPC.y - cMainCharacter.y <= 120)) {
stuff happens
}
#131
I know this thread has been dead for an awfully long time but after reading the entire thread I just couldn't help myself ...

So .... when is the first Cyb Tycoon game being released?
#132
General Discussion / Re: Hoursong?
Fri 28/05/2010 02:58:57
This is a GREAT idea. I love it!
#133
General Discussion / Tycoon Games
Fri 28/05/2010 02:57:45
Okay - there are A LOT of tycoon games out there ... and i love tycoon/management style games.

Do you?

If so, is there a tycoon game out there you love the most AND is there a tycoon game you would love to see? (or maybe one that could be made a lot better - if so how?)
#134
Quote from: Chicky on Wed 26/05/2010 12:35:39
Why the photo mashup? This would like nice if it was 3d  :-\ Panorama module etc.

It is a very clean art style, i'll give you that. Is there any actual story?
Quote from: Chicky on Wed 26/05/2010 18:15:43
Why follow the trend?

Fair play though, i like the textures you've got going drew.

It probably would look nice if it was 3d. But i currently don't do 3d work (however i'm planning on getting into it more in the future) so I did what i'm good at and what i wanted the game graphical style to look like.

WHy follow the trend? Why do people make Indiana Jones remakes, HG2G remakes, King's Quest remakes, Space Quest remakes, etc etc the list goes on.  Remakes are a big part of entertainment whether it's video games, movies, tv shows, songs, you name it.

Now this isn't exactly a remake - but it's a game style.  A popular online flash game style in particular (at least I thought it was pretty popular).  But it's a style of games ... like RPGs, FPS, Action, Point-and-Click, etc ... this is a point and click style escape the room game.

I'm trying to make a point here but it's not coming across just right - lol. I guess what I'm trying to say is that if no one ever "followed the trend" then there would only be about 20-30 crappy games in the world for us to "enjoy".

The simple answer to your question is ... I like escape room games and i just wanted to make one of my own.

Is there a story? Kind of, but not an in-depth one ... it's basically (like cat said) you are stuck in a room and you have to use the things around you to figure out how to get out of that room.  I'm going to try and give my game a bit of a horror feel too it ... the idea here is a crazy maniac has captured you and locked you in this garage where he plans to eventually return and kill you.

P.S. Thanks for your comment on the textures.  I like the too :D

Quote from: Mods on Wed 26/05/2010 14:19:19
Looks good, Drew! I expect to tear my hair out over the solution...

I hope it's going to be entertaining and fun to play. That's my goal anyway - lol.




#135
thanks ... i wear them proudly!
#136
Quote from: Snake on Tue 25/05/2010 23:52:39
Drew, where is the cursor and/or GUI? These need to be IN-GAME screenshots.

well the only thing thats really missing is the cursor -which i havent designed yet (but its a cursor ... who doesn't know what that looks like?) ... the gui is hidden until mouseover. and i havent designed it yet hence why i don't have it shown ... this is a progress ... the game is not finished ... everythings not in place ... i just thoughtyou might would like to see what I do have ... if you want to see everything the game will have to offer then you should play the game ... once its released ... but if that were the case then this post would be in the AGS Completed Games thread.

also note - there are no characters to speak of - it is a first person style game ... so what u see is basically what u get in the game (minus the cursor as mentioned earlier).
#137
You've probably all played at least one of the hundreds of room escape games out there.  You know the simple point and click game where you get to be MacGyver and use your surroundings to escape an area (usually a room).

Well i've always liked most of these games so i wanted to give it a shot.  So i've started work on AGS Escape Room: The Garage ... here are a FEW screen shots to give you an idea of the feel.  I promise ... this will be unlike most room escape games you've played - but at the same time it will have all you love about those games.









#138
im not a fan of the first background (for the contest entry).

and the swastika was just a swastika in my eyes ... nothing special. (although it did look like a cool swastika ... if swastikas can be pronounced "cool")

but i do like the third one a lot.  However it looks too desaturated - which i understand is part of the style but what i guess the biggest problem for me is the light source. it seems like you want light to project through the doors into the room ... but i dont think theres enough contrast between what's being "hit" by the light and what's not ... it almost looks like the image is wrapped in cellophane ... if that makes any sense to you?

all in all - good art though.
#139
Critics' Lounge / Re: School character C&C
Sun 23/05/2010 00:43:13
looks a little like harry potter.
SMF spam blocked by CleanTalk