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

Topics - DrewCCU

#21
I have a couple quick questions here.  Let's knock out the easy one first:

Q1
AGS reads the "location" of a character as the coordinates where the bottom center of the graphic is.  (so say you click on a circle on the ground with your mouse then the bottom center of the characters graphic will move to that circle (in most cases the player character has feet so it looks as if his feet are at that location)).  Okay - well a while back someone told me you could change this by altering the "z" property of the character. (so if you have maybe a snake for a character then you wouldn't want his tail to move to the point you click on, you'd want his head to move there.)

Anyway, can the same be done with objects?  Now if i'm correct AGS does things a little different with objects.  Instead of the bottom center, AGS reads the bottom left corner for object location/positioning.  I'm making a set of laser beams that "fly/shoot" to whereveryou click and as of now if you click a location, ags is putting the bottom left corner of the object sprite there, not the top center like i would like.  (i'd like to avoid using these lasers as a character if possible).

okay, so onto my next question:

Q2
In this first person part of the game where you're firing lasers (the lasers come from off the bottom of the screen to the target) i have a nifty little laser animation that works pretty well but the problem is if you click on a location closer to you "aka bottom of the screen" then the lasers get there faster obviously, and the animation doesnt finish before reaching the location.  So i need some sort of formula that will allow me to match the distance traveled with the animation speed (so that the animation finishes as it reaches the destination).
#22
Error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Version: AGS 3.1.2.82

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
  at GetSpriteHeight(Int32 )
  at AGS.Native.NativeMethods.GetActualSpriteHeight(Int32 spriteSlot)
  at AGS.Editor.NativeProxy.GetActualSpriteHeight(Int32 spriteSlot)
  at AGS.Editor.ObjectsEditorFilter.GetSpriteHeightForGameResolution(Int32 spriteSlot)
  at AGS.Editor.ObjectsEditorFilter.PaintToHDC(IntPtr hDC, RoomEditorState state)
  at AGS.Editor.RoomSettingsEditor.bufferedPanel1_Paint(Object sender, PaintEventArgs e)
  at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
  at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
  at System.Windows.Forms.Control.WmPaint(Message& m)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

------------------------------------------------------------------------------------------------

Don't know exactly what caused this.  I just know that whenever i try to load a room in my game and edit objects I get this error.

I've searched through the forums for similar problems but no one seems to be giving any answers out.  What's the deal?
#23
Here is what I need:

When all the planets are aligned and the stars are just right (i.e. a bool named Alpha is true) then clicking on the left mouse button does something specific.  Now this can't go in the global script because this event should only happen in a specific room.

The code might look something like this:
Code: ags

if ((Alpha) && (button == eMouseLeft)) {
...
}


However, that obviously wouldn't work in a room script.

The solution may be a simple one and i'm just way over thinking the matter or something ...
#24
I have cPlayerA "shooting" cPlayerB.  cPlayerB (the enemy) is moving randomly around the screen. 

The way I'm doing this is i have the projectile as an invisible character that's following the player.
(Note: I'm not using the FollowCHaracter command for this. Rather, I have it simply cProjectile.x = cPlayerA.x (same goes for the y)

Anyway, I have it set up so that when the "Fire" button is pressed the cProjectile becomes visible and cProjectile.Walk (cPlayerB.x, cPlayerB.y);

So to finish up this little action I need to have it when CProjectile reaches the enemy then it resets (becomes fully transparent again and goes back to following cPlayerA) right?

Well all that is good and well but the problem lies here:

cPlayerB is moving so fast that the part of the script that says "if cProjectile is colliding with cPlayerB then do all the resetting stuff" isn't being triggered because by the time cProjectile gets to the cooridnates he is no longer close enough to cPlayerB to trigger a collision.  cProjectile is where cPlayerB was a sec ago.

Does all this make sense? If not, let me know what i need to clear up.

So, can someone tell me a better way of doing this or how to fix this problem?
#25
I need to figure out how to get a characters screen coordinates (NOT room coordinates, as my room is larger than the screen resolution).

I looked into the Character.GetAtScreenXY code but that seems that it only checks if there is a character at screen coordinates but i dont need to check and see if a character is at a specific location ... i need to figure out where the character is in terms of screen coordinates.
#26
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.
#27
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.
#28
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
}
#29
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?)
#30
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.









#31
Okay - so I have a bunch of identical objects with minor changes made to each object (so they arent exactly identical but they are all the same size - put it that way).  I've stacked them directly on top of each other in my room.  For the sake of argument, just go with me on this next part:

Based on what the player does, a new object will appear.  So if there were only 2 objects it may work something like this:

Player does Thing1
  Object1.visible=true
  Object2.visible=false
(this will make it so when player does thing1 object 1 will appear and in case object2 was visible - it is set to disappear ... just in case it was there)

also works vice versa
Player does Thing2
  Object2.visible=true
  Object1.visible=false


This would be just fine if i ONLY had 2 or 3 or even 4 objects.  But i'm using A LOT of objects. So to reduce the size of the code i was hoping i could do something where all the objects could stay visible on the screen (instead of turning the uneeded ones off) ... and since all the objects are the same size when player does thing1 object1 would be "brought to the top/front" and all of the objects below it would no longer be seen.  I tired playing with the baseline function but i couldnt get it to work just right.  I know there has to be a way to do this with objects ... right?
#32
Let it be known that i've been working on this one particular piece of my game for just about all day.

And i have realized that coding an NPC to have artificial intelligence (while very possible) is harder than I thought. LoL. I needed a break fro the world of If's, else's, integers, operators, and bools so I thought I would just vent a little bit here on the forums.

I'm trying to create a realistic AI and it's coming along nicely but slowly.  However, I'm almost done and I can't wait to finally be through with this!!!!!

So, with that being said, I'd like to ask all of you a question:

Is there one section of coding in your current (or a previous) game that you imagined would be much easier than it actually was?  If so, what were you coding that gave you the biggest headache and took longer than expected?
#33
Hey guys, i'm back (sorry so quickly lol)

Maybe my brain is just tired but this seems like it should be a hell of a lot easier than it is turning out to be ... anyway - the issue:

If (something) {
   text overlay displays
}

however, i only want that overlay to display for one second then go away.  Keep in mind, please, that I do not want to use the wait command because I do not want other scripting to halt. Also, keep in mind that this will not (and can not) go in the RepExec section of the script. (it is currently in a hotspot interaction part of the script)

Again, I know this is probably simple ... but my brain gave me the finger so i'm turning to you guys for your help. Thanks.
#34
Okay, this one is a little tricky to explain in simplest terms, but allow me to try:

I have defined an integer at the top of my room code:
Code: ags

int Thing=120;


and in my repexec script i have this:
Code: ags

if (Thing<=120) {
  Event1 happens;
}
if (Thing<=0) {
  Event2 happens;
}


Now I know the problem and I know why the problem is happening ... i just don't know how to fix it.

The deal is I want Event1 to happen if Thing (a variable that is constantly changing through the course of this room) <= 120 but as soon as Thing <= 0 I want Event2 to happen.  What's happening is that even though Thing becomes <= 0 Event2 isn't happening - it's staying on Event1.  I realize this is happening because 0 is <= 120 so it still fits the conditions set by  if (Thing<=120) {

But how do i set it up so that Event1 occurs only until Thing reaches <=0?

I've tried modifying the code and rearranging things but nothing seems to work.  I thought this would surely work:
Code: ags

if (Thing<=120) {
  Event1;
}
else if (Thing<=0 && !Thing>=0) {
  Event2;
}


but that didn't work either. little helpplease.
#35
The moment you've all  been waiting for guys! The demo is FINALLY available. Here is the link:

http://www.startrekadventures.com/yearone/index.php?option=com_content&view=article&id=75&Itemid=71



also - feel free to browse the site and check out some screenshots and other links. Some pages are still being worked on but most of them are available.

Most importantly, we hope you enjoy Star Trek Adventures: Year One "Arena"!!!!
#36
I was sitting around one day and suddenly something strange popped in my head: make an AGS Price Is Right game.

I started thinking about all the different coding it would take to make a game like this and all the headache I would probably go through.  However - something still urges me to do it.  I was just wondering if any of you guys would be interested in playing a well put together AGS version of The Price Is Right?

(of course you would have the option to choose your host: Drew Carey or Bob Barker)
#37
Critics' Lounge / Suggestions?
Tue 20/04/2010 01:46:45
I posted a version of this thread in General Discussion but it got no attention so I'm thinking it would probably be better and more suited here.


Okay, i've been thinking about what i want my next tattoo to be.  i've come to the conclusion that i'm seeing as how i'm a HUGE Carolina Panther fan (and love the team as a Boston fan loves the Red Sox) I need a panther tattoo (plus panthers are pretty f'n cool anyway).

However, i don't want to just get a tattoo of the Carolina Panthers logo (cus thats just tacky and unoriginal in my opinion) and i don't want some panther design that 10000000 people already have (cus lots of panther tattoos look the same).

So what i came up with is I want a tattoo that looks like a real panther - like an airbrush or painting.  However, when someone looks at it (especially a Carolina Fan) then they will know exactly what it represents. So i played around on photoshop and came up with a concept of kind of what i want:



It's a real panther but in the "Shape" (or a very similar shape) of the Carolina logo.  I'd like this guy to look a little meaner and i'm thinking MAYBE have a tint of the carolina blue in there somehow ... like, i dunno, possibly have it look like theres some sort of blue light source or something.

Anyway, i'm not a very good sketch artist/painter so i was hoping maybe some of you guys out there could draw me up something (better than this image) i can take to the tattoo artist and say "Make me something that looks cool like this".  I mean, i know i could take this image i came up with and explain it to the tattoo artist and he could do his on thing based on that - but i'd like to see what you guys can come up with if anyone wants to give it a shot.
#38
General Discussion / Help with Panther Tattoo
Sun 18/04/2010 18:17:01
Not sure if this is exactly the right thread to post this - if not - feel free to move it :D

Okay, i've been thinking about what i want my next tattoo to be.  i've come to the conclusion that i'm seeing as how i'm a HUGE Carolina Panther fan (and love the team as a Boston fan loves the Red Sox) I need a panther tattoo (plus panthers are pretty f'n cool anyway).

However, i don't want to just get a tattoo of the Carolina Panthers logo (cus thats just tacky and unoriginal in my opinion) and i don't want some panther design that 10000000 people already have (cus lots of panther tattoos look the same).

So what i came up with is I want a tattoo that looks like a real panther - like an airbrush or painting.  However, when someone looks at it (especially a Carolina Fan) then they will know exactly what it represents. So i played around on photoshop and came up with a concept of kind of what i want:



It's a real panther but in the "Shape" (or a very similar shape) of the Carolina logo.  I'd like this guy to look a little meaner and i'm thinking MAYBE have a tint of the carolina blue in there somehow ... like, i dunno, possibly have it look like theres some sort of blue light source or something.

Anyway, i'm not a very good sketch artist/painter so i was hoping maybe some of you guys out there could draw me up something (better than this image) i can take to the tattoo artist and say "Make me something that looks cool like this".  I mean, i know i could take this image i came up with and explain it to the tattoo artist and he could do his on thing based on that - but i'd like to see what you guys can come up with if anyone wants to give it a shot.
#39
Beginners' Technical Questions / Bool issue
Sat 17/04/2010 20:57:40
Okay ... i dont know exactly how i need to set this code up or exactly where (room or global) - i've tried a couple different things but can't get anything that doesn't give me an error. Maybe you guys could help me out real quick and tell me what i need to do. here is what i need.

I have a bool - when it is set to false and you click on certain buttons within gui menus then i need certain stuff to happen. 

So ...

If (!bool) {
    press this gui button and you get this result.
}

the bool will be turned on/off by switch in the game the player can flip on and off again anytime they want. so i assume i would also need something thats constantly checking if that bool is on or off?
#40
okay ... this is going to be a little tough to explain ... but let me try.

My friends and I are working on designing a part of our game where you are piloting a space ship.  Take a look at this mock-up and it should give you a better visual idea of what's going on.


*note: the game is in 800x600 resolution but the space background will be larger to allow a panning effect*

My idea is when the player moves (say left) by pressing the left arrow key the space background pans and makes it appear as though you are "moving" left. Same thing should happen in all other directions. The trick here is this:

When you get all the way to the left edge of the space background i don't want you to stop. Because in real life why would u stop? you would keep going and just turn around 360 degrees.  So i need the effect as though you're spinning in a circle.  (whether you go from left to right, right to left, top to bottom, bottom to top) you should always end up back where you were.

Just to clarify, you won't actually be moving in space - as from one point to another. You are more or less sitting in one spot and spinning all around looking at whats around you. (the moving from point a to point b will be done a different way)

i'm sure you probably understand what i'm looking for by now but just to give you a little something extra to make sure:
Visualize yourself in a spaceship in real life. Imagine say a planet in the middle of the ships window/viewscreen/whatever u want to call it. Ur looking at it through your space ship.  You begin to turn your ship left.  Well what is going to happen is you are going to see the planet leave your view (exiting to the right - cus ur turning left) and then eventually you are going to get back around to it.

So i guess my ultimate question in this big long mess of a post is:
How can i pan my space background (using arrowkeys) and cause it to when it reaches the left edge of the background to the switch over to the right side of the background and still continue panning left? (same goes for all other directions)

I know this may be complicated - or it may be very simple (there have been things i made out to be really complicated but turns out what took me like 20 lines of code took someone else 2).

Eitherway, all suggestions/ideas are welcome.

THANKS!
SMF spam blocked by CleanTalk