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 - Sparkplug.Creations

#1
Nikolas, nice job with the post, thanks for doing it!

Dualnames, if the game got you to think, then it has done its job. Huzzah!
#2
Found the solution using my below idea. Consider this solved! Thanks for the insight NsMn.

Quote from: Sparkplug.Creations on Fri 11/09/2009 22:08:18
Quote from: NsMn on Fri 11/09/2009 21:53:48
That can only be because the sprite of the animation is wider. Also remember that the object's position always is the lower-left corner.

I think that's it. The sprite animation frames are 318x318 and the Predator object is 128x33.

Anyway I can offset this? One idea I have is to change the view of the predator to the explosion view, making sure the first frame is clear. This will make it look like it disappeared. Then, I move the invisible predator object to a new location (offsetting from where it was) so that when the animation plays, it looks like its centered on where it was.

Is there an easier way? Somehow reset the animations' origin?
#3
Quote from: NsMn on Fri 11/09/2009 21:53:48
That can only be because the sprite of the animation is wider. Also remember that the object's position always is the lower-left corner.

I think that's it. The sprite animation frames are 318x318 and the Predator object is 128x33.

Anyway I can offset this? One idea I have is to change the view of the predator to the explosion view, making sure the first frame is clear. This will make it look like it disappeared. Then, I move the invisible predator object to a new location (offsetting from where it was) so that when the animation plays, it looks like its centered on where it was.

Is there an easier way? Somehow reset the animations' origin?
#4
Hello,

I have an animation view of an explosion for a specific object. Everything is scripted and functionally works, but the animation view is offset from the object. The object is called oPredator and here's my code:

Code: ags

if (bCheckCollisions == true)
    {
      // EXPLOSION
      if (oHellfire.IsCollidingWithObject(oPredator))
      {
        //Display("KABOOM");
        //ShakeScreenBackground (int delay, int amount, int length)
        ShakeScreenBackground(5, 15, 20);      
        oPredator.StopMoving();
        //oPredator.Visible = true;
        oHellfire.Visible = false;        
        oPredator.SetView(4);
        oPredator.Animate(0, 5, eOnce, eNoBlock, eForwards);
        
        // Stop moving the missile
        moveHellfire = 2;        
      }
    }


For some reason, the animation of the explosion appears in a different location from where the oPredator object is. Any idea how I can make the animation centered over the oPredator object? Thanks,

-Reid
#5
Hi Matt,

Glad you also like the posters.

I guess I'll use placeholders for now as well, but I'd rather be concentrating on other parts of the game.

It may seem like a lot of "trouble" for one animation, but I find most artists want a Work Order contract made up. It helps define expectations by both myself and the artist so there's no confusion.

Haha, re: addictiveness of the game. I can see that it could get that way, but I honestly don't want it to be addictive. It's a game with a message to communicate. I want people to get that message, turn off the game and talk to other people about the futility of war. How it's a cycle that always seems to come back and haunt people and nations later.

-Reid
#6




What Goes Around
This is a ONE screen game where the player attacks a strange alien like object with their Predator Hellfire missile but then it disappears. The missile loops from right edge to left edge and the player can't do anything but avoid it for as long as possible. That gets difficult as time passes since the missiles' path becomes more erratic and harder to predict.

The game sacrifices traditional gameplay structures to communicate a specific message, which is, "What Goes Around, Comes Around." It is based on a anti-war campaign by the Global Coalition for Peace, designed by the ad firm Big Ant International.

Example images:
http://theinspirationroom.com/daily/2009/what-goes-around-comes-around/

Upon seeing the second image of the fighter jet firing the missiles and then upon wrapping the poster around a pole, those same missiles end up on the tail end of the fighter jet, I knew I could make a game that communicated the same message just as well. I decided to take on the challenge and I am happy to report my progress.

Progress
- graphics collected or made (80%)
- graphics implemented (50%)
- puzzles N/A
- scripting 80%
- music/sound 0%

Todo Tasks
- implement images of civilians caught in war scrolling in top bar
- implement quotes of war scrolling in bottom bar
- create and implement main menu text and scripting
- create and implement help text/UI images of how controls work
- find free sounds and implement them

Contract Work
I am looking for an animator who can create an explosion for when the missile collides with the players' Predator drone. Please email me, info [at] sparkplugcreations [dot] org. I am able to pay and provide a contract Work Order that we both sign. If interested, please provide samples of prior work.

I'd be happy to hear your feedback, criticism and questions.

Thanks,

-Reid
#7
Thanks for the replies everyone. I'm so not ready to do what I wanted. I have decided to scale back and only allow one missile to be fired but that missile will be permanent, constantly looping on screen and changing elevation randomly until it hits the player's own plane (goal is to avoid it).

-Reid

#8
Hello,

I am working on a very small game, one playable character, one enemy and one weapon. I have player movement done and I attempted to figure out how to allow the player to fire their weapon with the spacebar and only half succeeded.

Right now, when players press spacebar, the missile moves from left to right. What I am stuck on, is the logic (and where to place the code) for expanding this so that when players press spacebar, a new missile object is created and behaves independently of other, previously fired missiles.

Here's what I think I need:
1. On key press events must be in the global script (this works already)

2. When spacebar is pressed, create a new missile object (how do I do that?)

3. Run a function controlling the motion of the missile object. How fast it moves and when to loop around to left of screen when it exits on right side. (Where do I write this function? Room script? I have this code working on my room placed missile object.)

4. Collision detection between missile object, enemy character and player character. (What functions are needed and where do I write them?)

Summary
How do I create new missile objects upon key presses and control them independently of others?

Thanks for the help,

-Reid
#9
I got the following error because my description text had too many characters. It's fixed now but the dialog box that came up made it look like the editor crashed. Is it possible to pop up a friendly looking warning box and let users know what the character limit is? Or even better, when typing in a description for anything, if it has a limit, prevent the user from entering more text beyond the limit?

Code: ags

Error: String is too long: Executive Branch confidentiality interests
Version: AGS 3.0.2.42

AGS.Types.AGSEditorException: String is too long: Executive Branch confidentiality interests ---> AGS.Types.AGSEditorException: String is too long: Executive Branch confidentiality interests
   at ConvertStringToCharArray(String clrString, SByte* textBuffer, Int32 maxLength)
   at save_crm_file(Room room)
   at AGS.Native.NativeMethods.SaveRoomFile(Room roomToSave)
   at AGS.Editor.Components.RoomsComponent.SaveRoomOnThread(Object parameter)
   at AGS.Editor.BusyDialog.RunHandlerOnThread()
   --- End of inner exception stack trace ---
   at AGS.Editor.BusyDialog.Show(String message, ProcessingHandler handler, Object parameter)
   at AGS.Editor.Components.RoomsComponent.SaveRoomButDoNotShowAnyErrors(Room room, CompileMessages errors, String pleaseWaitText)
   at AGS.Editor.Components.RoomsComponent.SaveRoomAndShowAnyErrors(Room room)
   at AGS.Editor.Components.RoomsComponent.AGSEditor_PreSaveGame(PreSaveGameEventArgs evArgs)
   at AGS.Editor.AGSEditor.PreSaveGameHandler.Invoke(PreSaveGameEventArgs evArgs)
   at AGS.Editor.AGSEditor.SaveGameFiles()
   at AGS.Editor.Components.FileCommandsComponent.CommandClick(String controlID)
   at AGS.Editor.GUIController._mainForm_OnMenuClick(String menuItemID)
   at AGS.Editor.MainMenuManager.MenuEventHandler(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripMenuItem.ProcessCmdKey(Message& m, Keys keyData)
   at System.Windows.Forms.ToolStripManager.ProcessShortcut(Message& m, Keys shortcut)
   at System.Windows.Forms.ToolStripManager.ProcessCmdKey(Message& m, Keys keyData)
   at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Form.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
   at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
   at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
#10
Quote from: KhrisMUC on Mon 28/07/2008 10:20:18
To convert the distance to a transparency value, you'll need a little more math.
Say you want the following relationship:
Distance = 0 -> Transparency = 0 (opaque)
Distance = x -> Transparency = x (fading)
Distance >= 200 -> Transparency = 100 (invisible)

Code: ags
  int t = intDistObject01/2;
  if (t > 100) t = 100;
  oTestObject01.Transparency = t;


This is what I wrote before I saw your post Khris and it worked.

Code: ags

intTransTestObj01 = intDistObject01;

  if (intTransTestObj01 < 10)
  {
    intTransTestObj01 = 10;
  }
  else if( intTransTestObj01 > 90)
  {
    intTransTestObj01 = 90;
  }
  else
  {
    oTestObject01.Transparency = intTransTestObj01;
  }


Your approach to divide the distance by 2 works better, considering on the screen the distances can be 200+ and that doesn't match up 1:1 with the transparency values. Yay, I'm nearly done with this!
#11
OK, I'll try to do better managing which variables should be local vs. global. Thanks all for the input.
#12
I only use global variables with the new 3.02 release because it's super easy to use, declare them in one place and then any room script can access them.

Are there any downsides to doing this instead of using local variables?
#13
When I read Khris' post I missed seeing the "IntToFloat" was inside the Maths.sqrt function and not outside of it. I fixed that, but then read Gilbot's post about using FloatToInt outside everything to match it to my variable and now everything works beautifully.

Next I need to figure out how to convert the distance value to a number that can be used for setting transparency on the object.

Thanks for your help Khris and Gilbot!
#14
Thanks, now I have:

Code: ags

intDistObject01 = IntToFloat(Maths.Sqrt((oClearArea.X - oTestObject01.X)*(oClearArea.X - oTestObject01.X)+(oClearArea.Y - oTestObject01.Y)*(oClearArea.Y - oTestObject01.Y)));
lblDistObj01.Text = String.Format("Distance: %d",intDistObj01);


and I still get the same error msg:

Quote
Failed to save room room12.crm; details below
room12.asc(524): Error (line 524): Type mismatch: cannot convert 'int' to 'float'

Also, why do I need to find the sqrt of the main equation? Doesn't the main equation give me the distance? The square root will make the distance number smaller I think. If that's the case, then I think I can get this work since it won't be creating floats.
#15
Hello,

I'm getting error when I use the following code in the repeatedly execute funtion of my room:

Code: ags

intDistObject01 = Maths.Sqrt((oClearArea.X - oTestObject01.X)*(oClearArea.X - oTestObject01.X)*(oClearArea.Y - oTestObject01.Y)*(oClearArea.Y - oTestObject01.Y));

lblDistObj01.Text = String.Format("Distance: %d",intDistObj01);


The error is:

Quote
Failed to save room room12.crm; details below
room12.asc(524): Error (line 524): Type mismatch: cannot convert 'int' to 'float'

Truthfully, I copied this code from another thread here and changed the object names to my own. I am trying to caculate the distance between objects and display the distance in a label. Ultimately, I want to fade out an object the further away it is using transparency.

I have tried using a float variable to save the result of the equation and tried using FloatToInt() on the equation, saving it to an int variable, but neither worked.

I appreciate your time, thanks,

-Reid
#16
Thanks to everyone for your input.

-Reid
#17
Hi,

I know that the executable is based on the name of the directory the game is in, which isn't what I want since my directory is named "DevTree". I know I can rename it, but I would like to request the ability to manually specify a different name for the executable instead of the directory name. Perhaps in the General Settings?

Thanks,

-Reid
#18
Quote from: Pumaman on Sun 13/01/2008 15:42:24

QuoteI'm working with larger than normal character sprites 591 tall by 351 wide (temp size for testing purposes) and when I go to preview the animations, the preview window is not able to show the whole view at once. Here's a picture of what I'm seeing:

It's a reasonable point, 2.72 did this as well. I guess ideally it should scale down the sprite to fit the preview window.


Thanks, though I prefer being able to preview it in original size, if the only solution is to shrink it down to fit within the current preview window, I'll accept that!

#19
I hope this is the right place to mention this.

I'm working with larger than normal character sprites 591 tall by 351 wide (temp size for testing purposes) and when I go to preview the animations, the preview window is not able to show the whole view at once. Here's a picture of what I'm seeing:

http://sparkplugcreations.org/temp/AGS_char_preview.jpg

The sprites are of the characters mouth moving as a test, but eventually I'd like to use animations that are much more detailed and elaborate, using full body motion.

Is it possible to allow one to resize the preview window or use a pop-up window that can be resized? Thanks!
#20
I'm doing some testing now with large images for characters and I see there's an option in the View editor to "Run the next loop to make a long animation." Sounds like that can be a solution to overcome the 20 frame limit per loop.
SMF spam blocked by CleanTalk