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.


Messages - Nomosoft

Pages: 1 ... 5 6 7 8
91
Ask a Question / Re: Actor changing glitch
« on: April 06, 2012, 04:38:07 pm »
Does it need to be a different actor? What if you just made a bunch of different animations for one actor, and enabled/disabled/set the variables for any behaviors after switching the animation?

92
Ask a Question / Re: How to create height illusion
« on: April 05, 2012, 12:45:25 pm »
Manipulating the size of the object/player and adding a shadow that also changes size during the object's flight should give the illusion you're looking for. As for when to make the object bigger or smaller, you have a couple of simple options:

1) Pre-calculate the time and distance of the throw, then grow for half and shrink for half.
2) While velocity of the object is increasing, keep growing. While velocity is decreasing, shrink.

Those are simplifications, but should work OK for what I understand you are trying to do.

93
Resolved Questions / Re: Is there a better way to do this?
« on: April 05, 2012, 12:40:58 pm »
If (right was pressed) {
  Move arrow 32 pixels to the right
  If arrow x position is now > width of screen (or x of last achievement icon) {
    Move arrow back to 32 (or whatever the first x-position is) and move arrow down 96 pixels (or whatever number is correct)
  }
  If arrow y position is now > bottom of screen (or y of bottom achievement row) {
    Set arrow y to y of top row
  }
}

Same thing for other arrow keys, just move the actor up, down, left, or right the appropriate number of pixels and check to see if he needs to wrap around to the next row/column.

Edit: In fact, you could just move the arrow on keypress and do all the position checking and row/column wrapping at once in its own block instead of putting it inside each keypress block.

Thank you, sir! This worked like a charm and was super easy to set up!

Thanks again!

You're welcome, I'm glad I was able to help.

94
Resolved Questions / Re: Is there a better way to do this?
« on: April 04, 2012, 03:46:10 pm »
If (right was pressed) {
  Move arrow 32 pixels to the right
  If arrow x position is now > width of screen (or x of last achievement icon) {
    Move arrow back to 32 (or whatever the first x-position is) and move arrow down 96 pixels (or whatever number is correct)
  }
  If arrow y position is now > bottom of screen (or y of bottom achievement row) {
    Set arrow y to y of top row
  }
}

Same thing for other arrow keys, just move the actor up, down, left, or right the appropriate number of pixels and check to see if he needs to wrap around to the next row/column.

Edit: In fact, you could just move the arrow on keypress and do all the position checking and row/column wrapping at once in its own block instead of putting it inside each keypress block.

95
I'm thinking you can use a game attribute list (or multiple lists) that stores the values for each bullet actor.

Tell me if this makes any sense (I am not an AS3 programmer and don't really know where the performance bottlenecks are):

I create a scene behavior which, on loading, iterates through all the ammo actors, creates one of each type, and stores the relevant information from each type in an associative array, thus:
[Ammo actor type]_[attribute] = Value;

So,
Bullet_speed = 40
Bullet_damage = 1
Bullet_firedelay = 100
Bullet_lastfired = 293847
Missile_speed = 25
Missile_damage = 4
Missile_firedelay = 400
Missile_lastfired = 293606

Then, I simply access the associative array for each ammo type in my gun's list. Is this a reasonable way to go about this?


96
I have a behavior called "Gun," which accepts a few parameters, including an actor type to use as ammunition. Every X seconds, the gun spawns an ammunition actor and sends it on its way. Great, except that I want multiple guns on my Player actor, and I don't want to do something silly like make ten copies of my gun behavior and call them Gun1 through Gun10.

So, I thought it would be good to have the gun store a list of all the types of ammo that it can fire, and each frame it checks each piece of ammo to find out whether that piece of ammo should be fired (checks the time since the last piece of that type was fired, checks whether a target is in range, etc.) Imagine the Gun behavior having a list with Bullet, Laser Beam, Missile, Grenade, etc.

I want to build all of the relevant information (delay between firings, time last fired, range, etc) into the actor. That way, the gun simply checks each actor type in its list, gets the information from the actor, then either spawns or doesn't spawn the ammo actor. I do _not_ want to have to hard-code each possible kind of ammo into the Gun behavior, I want to simple have every ammo actor share a behavior, such as "Ammo Stats" that the gun can read. That way, I can simply create a new ammo actor type, fill in the necessary information, and add it to the Gun's list, and the Gun itself does not need to be modified for each new piece of ammo I add.

Still with me? OK, here's the problem: the only way for me to do this seems to be if I create an actor of every type from the ammo list and have them exist somewhere in the scene at all times. Otherwise, I can't read from the "Ammo Stats" behavior because, if there is no actor, there is no behavior. Is there any way to do what I've described without having a bunch of invisible ammunition actors hiding in every scene?

97
Ask a Question / Two questions about slopes
« on: March 22, 2012, 11:56:02 am »
I am working on a platformer that involves sloped terrain. Instead of rolling my own, I'm using the slope detection behavior from the Run-n-Jump kit. I have a couple of questions I'm hoping someone can help me with.

1) What is the "slope grade" reported by the slope detection code? A 45 degree incline should be a 100% grade, but when my actor hits a 45 degree slope, the "slope grade" is reported as 29.xxxx.
2) I want my actor to elegantly rotate to match the slope he is on. I'm wondering which of several options my fellow Stenylers think is best.
2a) One option is to use multiple collision boxes at the bottom of my actor (which is a vehicle, not a humanoid character), and when the first box hits, rotate a certain percentage of the slope, when the second box hits, rotate a little more, and so on.
2b) The other option I am considering is turning on rotation in physics (currently, the actor cannot rotate in the physics engine), but limiting it to +/- X degrees of rotation. Then, of course, I need to make sure he only rotates when entering or leaving a slope, and not when bumping into things in mid-air, or when ramming a wall. Another problem with this approach is that my actor seems to want to rotate FORWARD when the bottom of his collision box hits a slope, like he's tipping forward from momentum. I don't know how well I can counter this by changing the shape of his collision box.

I'm open to suggestions. I usually do my own crude physics with platformers, but I would really like to use the built-in Box2D functionality, this time around.

98
Ask a Question / Re: Create an actor just once and not ...
« on: December 19, 2011, 04:42:53 pm »
If you're having a problem with a behavior not shutting itself off, just use a Boolean variable and an If block to skirt the issue.

OnCreate() {
  var hasAlreadySpawned = False;
}

OnCollission() {
  if (hasAlreadySpawned == false) {
    SpawnPlatform();
    hasAlreadySpawned = true;
  }
}

So, once a platform has spawned another platform, it will set hasAlreadySpawned to true, and it will not spawn any more platforms.

Edit: Also, if Disable Behavior is not working, that should probably go in Bug Reports.

99
Ask a Question / Re: BigFish wants to publish my game, BUT...
« on: December 19, 2011, 12:23:23 pm »
FlxG._game.contextMenu.customItems = new Array();
FlxG._game.contextMenu.hideBuiltInItems();

You can't get rid of the settings or about in any flash app without use of JavaScript, but the code above along gets rid of everything else.

Cool, thanks for the tip.

Congrats on BFG! Sounds great.

Congrats on getting sponsored by BigFish - we'd be happy to work with you to iron out any sponsor's terms if you contact us. Let me know if Mike's solution works for you.

http://www.stencyl.com/about/contact/

This is for Ace Escape I assume?

Thanks :) "Sponsored" is maybe a bit grandiose, it's just a flat rate for non-exclusive use of the game on their site, but it's still pretty cool. Yes, this is for Ace Escape, but it is for a much-improved version of Ace Escape, with graphics and music redone by Ethan718. People with a Flash Game License account can see it, here: www.flashgamelicense.com/view_game_external.php?game_id=20995&cmd=next I will also post the updated version here on Stencyl when I get a chance, probably tonight.

I will implement Mike's solution as soon as I get home, and I'll update this thread with results.

100
Ask a Question / BigFish wants to publish my game, BUT...
« on: December 18, 2011, 11:50:14 am »
... one of their requirements is that I "Disable the Adobe Flash right-click context menu." I've been all over the internet, and these forums, looking for the solution. Mostly, what I find is "stage.showDefaultContextMenu = false," which I finally figured out needs to be "FlxG._game.stage.showDefaultContextMenu=false," but which doesn't seem to do anything, at all. Anyway, that apparently only hides some of the menu items. The other solution I see looks something like this:

var newMenu:ContextMenu = new ContextMenu();
newMenu.hideBuiltInItems();
this.menu = newMenu;

However, Flash chokes on "ContextMenu." I have no idea what package or library ContextMenu is part of, or how to import it into a StencylWorks project, even if I did. I see this question has been asked once or twice, but there doesn't seem to have been any real solution discovered. Can I disable the right-click menu in code, or not?

101
Old Bugs (1.x/2.x) / Behavior confusion error
« on: December 13, 2011, 12:14:09 am »
If you delete a behavior, then create a new one, some wires seem to get crossed in StencylWorks.

Let's say "Behavior A" is attached to the actor "Player." Now, in the "Logic" tree, delete Behavior A. Reload the project (CTRL-R, not close/open), and you'll see that Behavior A has disappeared from Player's behavior page. Now, create "Behavior B" and attach it to another actor, "Enemy." Reload the project. You will see that Behavior A has reappeared on Player's behavior list. Behavior B is on Enemy's page, just as you'd expect. If you try to edit Behavior A, it will open Behavior B. If you close the game and re-open the project, "Behavior A" will have turned into "Behavior B" on Player's behavior page.

So, it seems that deleting a behavior, then creating a new one, causes the new behavior to occupy the same space in the project as the behavior you deleted. For the most part, this just causes Player to execute Behavior B, but I first stumbled onto this because I was getting an error about Type Coercion failing, and something having to do with BehaviorManager.as when I tried to test my project. I am not 100% sure, but I think the type coercion problem might come from deleting a scene behavior, then creating a player behavior (or vice-versa), because you then end up with a behavior attached to the wrong type of object.

102
News / Re: StencylWorks 1.3.x - Includes iStencyl - (Updated Dec. 10)
« on: December 12, 2011, 04:24:37 pm »
Not that I figured out your problem but I really like the preciseness of the way you describe the whole process. I get the exact picture of what you have been doing.

I'm on Win-xp and this worked for me 100%.

Couple of questions:

1. Where did you install your SW (is it in program files)?
2. How about your datafiles (check File/preferences/workspace/workspace folder)? Whatever it is, you should go to that folder and double check that there is a Stencylworks folder created there.

Thanks :) I'm a tech guy, and I understand how useless vague descriptions are.

I have had StencylWorks installed, variously, in Program Files (x86) and C:\Stencyl. Currently, I have Stencylworks installed in Program Files (x86). My data Files have been in C:\Stencyl\stencylworks\projects\. Now, they are in C:\Users\MyAccount. The files seem to all be where they are supposed to be. I've tried various permutations of program folder, data folder, and running as administrator to no avail.

Odd, the Alien Behavior is working for me.  On Windows Vista 64bit.  Not sure why the circle-with-a-slash-through-it cursor is appearing for you.

Can you drag and drop in other programs?  Maybe you're experiencing this issue.

Anybody else on Win 7 64bit experiencing this?

I have drag-and-drop enabled and my escape key is not stuck down due to crumbs, so I guess my issue is different :)

103
News / Re: StencylWorks 1.3.x - Includes iStencyl - (Updated Dec. 10)
« on: December 12, 2011, 12:06:33 pm »
Attach the png of Alien Behavior.  Also, attach logs after you try to drag and drop into the snippet list.

I am on a different computer, now, still running Windows 7 x64. I just did a fresh StencylWorks install and performed the 1.3.2 update. The .png and the log file are both attached. The log file has a couple of "could not delete" and "could not parse" lines, but nothing else very interesting. It doesn't even look like the logs specifically record the export, as neither the path nor filename nor behavior name show up anywhere in the log.

Same problem as before: When I drag the exported .png file into the StencylWorks window, I get the circle-with-a-slash-through-it icon, and I can't drop the png.

Here are the exact steps I followed:
- Open StencylWorks
- Open Alien Escape
- Click on "Actor Behaviors"
- Enter "Motion" folder
- Right-click on "Alien Movement," select "Export"
- Save file (tried multiple locations)
- Close Alien Escape
- Open or create a different game (tried both)
- Click on "Actor Behaviors"
- Drag exported .png file into StencylWorks window (tried every portion of the window)
- Try above on "Logic" tab, inside specific behavior folders, etc.
- Try above with scene behaviors.

104
News / Re: StencylWorks 1.3.x - Includes iStencyl - (Updated Dec. 10)
« on: December 12, 2011, 02:09:51 am »
I'm on win xp. What about yours?

Do you have 12 sample stencyl games (6 0f them ios)?

You should preferably save your behavior to somewhere below document folder and then drag it directly into SW from windows filesystem.

I used a behavior called Alien Movement in a game called Alien Approach. Look for that, export it to a document folder and you should see a spaceship, then open another game, go to behavior list, you may see a bunch of folder, just drag the spaceship icon over next to all these folders.

I'm on Windows 7.

I just did a complete Stencylworks removal. I uninstalled using the Stencylworks uninstall program. I checked the Windows add/remove dialog and found no traces. I used RegEdit to seach for anything with "Stencyl" and found nothing. I deleted the Program Files folder, as well as a nightly build install I had in another folder. I ran CCleaner just for the heck of it. I downloaded the 1.3.0 installation file from the front page. When I ran the newly-installed copy, it still remembered my old Workspace directory (which is not the default) and it said 1.3.1 b410, even though the install package said 1.3.0. The Check For Updates reported that I was up-to-date.

I still couldn't drag/drop anything, even after reverting my workspace to the install directory (which caused me to be able to see all the iOS sample games), letting Stencylworks copy all my files, and running the program as an administrator.

Now I have done all of the above, again, this time scouring my hard drives for anything with "Stencyl" in the name, as well as renaming my old projects folder, and I am going to try one more install.

The result is: Success and failure.

This time I got the license agreement, and had to input my username, and got prompted to download the update. That's nuts, the software really should know what version it is without having to go through all this.

Anyway, I exported Alien Movement, and still cannot drag it back into an existing game, or a brand new game that I created just to try and import the behavior.

105
News / Re: StencylWorks 1.3.x - Includes iStencyl - (Updated Dec. 10)
« on: December 12, 2011, 12:02:46 am »
I think any 1.3.x would work.

Try this for any actor behavior:

1. Go to Game A
2. Go to any actor behavior at the icon list level (not opening that particular behavior).
3. Right click and you'll see export option.
4. Export it to any folder of your choice.
5. Close game A.
6. Open Game B.
7. Go to same area with all the icon list.
8. Drag the png image into SW.

Yep, this is exactly what I've been doing. I just did it, again, making sure the behavior was in the root instead of a folder (not that I think it should matter.) No dice.

The only behavior that can't be dragged back in ATM are the ones under Code.

These are all Design Mode behaviors and show up under Actor or Scene.

Edit: Also, I just installed a nightly build to no effect. Maybe I should wipe all traces of Stencylworks from my system and reinstall?

Pages: 1 ... 5 6 7 8