[QUOTE=Lord_Ragnarok;47433703]Is there a way to slice textures like sprites through a grid? Or am I going to have manually cut and align them?[/QUOTE]
You can do that from the sprite editor by choosing type grid from the slice menu where you can specify the size.
[QUOTE=Proclivitas;47436907]Have you tried to Debug.log the CurrentWeight, SlotsList.Count, i, ect every iteration? Might tell you something more, we can't really do much with just that other than say it must go forever because whatever you set in the editor for the SlotsList list has something funky going on.[/QUOTE]
I managed to get it fixed by moving SlotsWeight += SlotsList[i].CurrentWeight; to the method where I pick up an item. I know I haven't said that but I though that would be enough. Anyway it's fixed, but thanks for the reply.
[editline]1st April 2015[/editline]
[QUOTE=Protocol7;47436962]Maybe try iterating through the list using List.ForEach()?
[url]https://msdn.microsoft.com/en-us/library/bwabdf9z%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396[/url][/QUOTE]
Not sure what exactly this is but I will try it out anyway to see what it does.
Well never mind my question find a way around that and still managed to get it working.
I have a question, if I want to save a players inventory what would be the best thing to use? PlayerPrefs, BinaryFormat, XHTML ( theses are the ones I heard about ).
Which one would you recommend and why, ignore PlayerPrefs as I know no one is going to use them as they are only for testing purposes.
[QUOTE=BoowmanTech;47438995]Well never mind my question find a way around that and still managed to get it working.
I have a question, if I want to save a players inventory what would be the best thing to use? PlayerPrefs, BinaryFormat, XHTML ( theses are the ones I heard about ).
Which one would you recommend and why, ignore PlayerPrefs as I know no one is going to use them as they are only for testing purposes.[/QUOTE]
I use binary files for data I wouldn't want people to tamper with (save games, inventory, etc). It doesn't mean they can't change data, but at least I can make it more difficult.
[editline]1st April 2015[/editline]
I've come across a strange problem when changing screen resolutions in full screen. To start off, I'm using Unity 4.6.4 and here are my player settings:
[img]http://puu.sh/gYg1U/391b952d1c.png[/img]
When the game is full screen in a 16:9 resolution (same as my monitor) everything looks fine:
[thumb]http://puu.sh/gYfVB/daa178f0c4.jpg[/thumb]
But if I change it to a different aspect ratio, either side gets chopped off into some some unrenderable space:
[thumb]http://puu.sh/gYfPX/7f0c8f6eb0.jpg[/thumb]
Here's the same resolution in windowed mode:
[thumb]http://puu.sh/gYgNZ/0200bd113d.jpg[/thumb]
The black letter box is expected because I'm using a script that enforces an aspect ratio (yes I've tried turning this off and the problem still persists).
I'm moving three cubes along their Z axis by their transform component at different rates while having a camera following one of them.
[t]http://i.imgur.com/RXsOVDU.png[/t]
How would I be able to rid of the jerkiness that represents from the other two if they are moving at random rates every update to have all three cubes appear smooth?
[editline]Edited:[/editline]
I'm beginning to think I'm going to have to lerp from the previous position to the next; just reading some Q&A on their forums. Not sure what "lerp" is yet.
[editline]Edited:[/editline]
I'm assuming change the speed every update is just going to be jerky, still looking for a way around it.
[CODE]
using UnityEngine;
using System.Collections;
public class CarControllerAI : MonoBehaviour {
private float speed;
private Transform _endPoint;
void Start() {
//The point we want our transform to reach.
_endPoint = GameObject.FindGameObjectWithTag("FinishLine").GetComponent<Transform>();
//The speed from .1 to 1 for our lerp
speed = Random.Range(.1f, .5f);
}
void Update() {
speed = Random.Range (.1f, .5f);
}
void FixedUpdate() {
transform.position = Vector3.Lerp (transform.position, new Vector3(transform.position.x, transform.position.y, _endPoint.position.z), speed * Time.deltaTime);
}
}[/CODE]
[QUOTE=Clivens;47442168]I'm moving three cubes along their Z axis by their transform component at different rates while having a camera following one of them.
[/QUOTE]
Linear interpolating (Lerping) the position sounds like a possible solution, however I have to know why you would want to randomize the speed every frame.
[QUOTE=MadPro119;47442292]Linear interpolating (Lerping) the position sounds like a possible solution, however I have to know why you would want to randomize the speed every frame.[/QUOTE]
I'm just messing around with Unity. I've only ever done POS development and I've been stuck doing boring things instead of something interesting. I'm just beginning to understand game engines and how they work. I can see why changing the speed about ~2 times a frame at 30FPS would cause the jittering ;3
[QUOTE=foszor;47439903]I've come across a strange problem when changing screen resolutions in full screen.
[...]
But if I change it to a different aspect ratio, either side gets chopped off into some some unrenderable space:
[thumb]http://puu.sh/gYfPX/7f0c8f6eb0.jpg[/thumb][/QUOTE]
In [url=http://unity3d.com/unity/qa/patch-releases?version=4.6]4.6.4p1[/url] they fixed the following issue:
"Rendering: Now the back buffer is cleared after the resolution is changed from a script in Windows standalone.".
Is it possible to save an entire scene?
Basically if I instantiate some object in the scene, close the game and start it again everything is still there.
[QUOTE=Z_guy;47442456]In [url=http://unity3d.com/unity/qa/patch-releases?version=4.6]4.6.4p1[/url] they fixed the following issue:
"Rendering: Now the back buffer is cleared after the resolution is changed from a script in Windows standalone.".[/QUOTE]
Good man! Thank you! Ironically, when I couldn't figure out how to fix it, I downloaded the most recent patch at the time but it didn't fix it. Then Unity released an update less than 24 hours later that fixed the problem.
I got my cube speeds randomized over every frame smooth finally :3 took me longer than I'd like to admit, but that's just learning the engine I guess.
[CODE]using UnityEngine;
using System.Collections;
public class CarControllerAI : MonoBehaviour {
private Transform target;
private float yVelocity = 0.0f;
void Start() {
target = GameObject.FindGameObjectWithTag("FinishLine").GetComponent<Transform>();
}
void Update() {
float speedMod = Random.Range(0f, 20f);
int randomMult = Random.Range(0, 100);
float newPosition = Mathf.SmoothDamp(transform.position.z, target.position.z, ref yVelocity, 100f % speedMod * randomMult, 100f);
transform.position = new Vector3(transform.position.x, transform.position.y, newPosition);
}
}[/CODE]
[QUOTE=atrblizzard;47425174]I've started working on a BSP loader in just for fun, which I'm pretty sure has been done in this thread alone. Seeing how Ziks got an GTA:SA map loader working and Layla on his BSP loader, inspired me to see how far I can go with it, which starts to become quite a challenge, but it's getting somewhere.
[IMG]http://files.atrblizzard.com/sharex/2015-03-30_22-58-22.png[/IMG][/QUOTE]
I once wrote a parser for the Quake 3 BSP format, I had originally planned to make a full importer but I never really got beyond just getting the data in. Still, it wasn't *that* hard, the format is fairly straightforward (don't know about Source though...)
On a side note, now that Unity Webplayer is out the window with Unity 5 is there a way to embed WebGL exports in the forums?
EDIT: In the meantime, here's a platformer prototype I'm working on. The idea is to later add in a bunch of sword fighting and combat mechanics, but for now I'm just getting the basic movement working.
[url]https://dl.dropboxusercontent.com/u/99106620/Combat%20Platformer/index.html[/url]
Disclaimer: doesn't run well in Chrome (runs at around 10-20 FPS). Runs great in Firefox, however.
Controls:
WASD or Arrow Keys - move
Space - jump (press again for double jump)
When in contact with a wall, hold arrows in direction of the wall to slow your descent. While sliding down a wall in this manner, you can jump off of the wall (for wall jumping).
There's also ledge hanging. If there's a ledge in front of the character and the character is falling, it will automatically grab the ledge and hang from it. Press down to let go of the ledge, or space to jump up from the ledge.
[QUOTE=KillaMaaki;47460550]
[url]https://dl.dropboxusercontent.com/u/99106620/Combat%20Platformer/index.html[/url]
Disclaimer: doesn't run well in Chrome (runs at around 10-20 FPS). Runs great in Firefox, however.
[/QUOTE]
Runs fine in chrome for me.
A small gripe I have with this thing is that if you're wall sliding and press space, you bounce in the opposite direction of where you're holding button to move. This does not work well for me since right after the bounce you need to stop holding one key and hold opposite one for desired bounce effect.
[QUOTE=KillaMaaki;47460550]EDIT: In the meantime, here's a platformer prototype I'm working on. The idea is to later add in a bunch of sword fighting and combat mechanics, but for now I'm just getting the basic movement working.
[url]https://dl.dropboxusercontent.com/u/99106620/Combat%20Platformer/index.html[/url]
Disclaimer: doesn't run well in Chrome (runs at around 10-20 FPS). Runs great in Firefox, however.
Controls:
WASD or Arrow Keys - move
Space - jump (press again for double jump)
When in contact with a wall, hold arrows in direction of the wall to slow your descent. While sliding down a wall in this manner, you can jump off of the wall (for wall jumping).
There's also ledge hanging. If there's a ledge in front of the character and the character is falling, it will automatically grab the ledge and hang from it. Press down to let go of the ledge, or space to jump up from the ledge.[/QUOTE]
Doesn't want to run at all for me, Chrome or Firefox. Chrome doesn't do anything, while Firefox just loads to a certain point and stops.
[QUOTE=Rahu X;47461939]Doesn't want to run at all for me, Chrome or Firefox. Chrome doesn't do anything, while Firefox just loads to a certain point and stops.[/QUOTE]
Same for me, it's like this and it just won't change the view: [url]http://i.imgur.com/pteiFTE.png[/url]
[QUOTE=BoowmanTech;47462181]Same for me, it's like this and it just won't change the view: [url]http://i.imgur.com/pteiFTE.png[/url][/QUOTE]
You have to wait a little bit, it stalls there.
[QUOTE=Rahu X;47461939]Doesn't want to run at all for me, Chrome or Firefox. Chrome doesn't do anything, while Firefox just loads to a certain point and stops.[/QUOTE]
[QUOTE=BoowmanTech;47462181]Same for me, it's like this and it just won't change the view: [url]http://i.imgur.com/pteiFTE.png[/url][/QUOTE]
Keep in mind that even after the bar gets full it still is loading a 104MB .js file in the background
[QUOTE=galimatias;47462292]Keep in mind that even after the bar gets full it still is loading a 104MB .js file in the background[/QUOTE]
The thing is that my bar was always pink so I didn't know that it loaded. But this time when I started it I was able to see the loading.
[editline]5th April 2015[/editline]
It works fine for me and I am using chrome.
[QUOTE=itisjuly;47461818]Runs fine in chrome for me.
A small gripe I have with this thing is that if you're wall sliding and press space, you bounce in the opposite direction of where you're holding button to move. This does not work well for me since right after the bounce you need to stop holding one key and hold opposite one for desired bounce effect.[/QUOTE]
Hm... do you have any demos I can check out for how wall jumping should behave?
Just played around with the Acrocatic demo and I notice they have a feature where, say, if I'm sliding down a wall and I press the opposite direction, the character momentarily freezes in place and looks in the direction I'm pressing, and I can press space to leap off of the wall (otherwise, it seems to behave largely the same as mine), which looks like it was added to make it easier to switch directions while wall jumping.
[QUOTE=KillaMaaki;47460550]EDIT: In the meantime, here's a platformer prototype I'm working on. The idea is to later add in a bunch of sword fighting and combat mechanics, but for now I'm just getting the basic movement working.
[URL]https://dl.dropboxusercontent.com/u/99106620/Combat Platformer/index.html[/URL]
Disclaimer: doesn't run well in Chrome (runs at around 10-20 FPS). Runs great in Firefox, however.
Controls:
WASD or Arrow Keys - move
Space - jump (press again for double jump)
When in contact with a wall, hold arrows in direction of the wall to slow your descent. While sliding down a wall in this manner, you can jump off of the wall (for wall jumping).
There's also ledge hanging. If there's a ledge in front of the character and the character is falling, it will automatically grab the ledge and hang from it. Press down to let go of the ledge, or space to jump up from the ledge.[/QUOTE]
Loading bar fills up then it just hangs. On chrome btw
Oh, I just read the above posts. I'll let it sit a bit longer
Edit: Took me a while to be able to get over the first wall after the stairs.
[QUOTE=Pelf;47463878]
Edit: Took me a while to be able to get over the first wall after the stairs.[/QUOTE]
Yeah, sorry about that. The way I get over it is by standing on the top of the stairs, double jumping over, and then grabbing the ledge and jumping up. Don't know if there's another way to do it.
[QUOTE=KillaMaaki;47464276]Yeah, sorry about that. The way I get over it is by standing on the top of the stairs, double jumping over, and then grabbing the ledge and jumping up. Don't know if there's another way to do it.[/QUOTE]
That's how I managed to get over it.
[b]Edited[/b]
Is it possible to add blur to a panel? Something like this: [url]http://i.imgur.com/BRg1rGK.png[/url]
Made a bunch of tweaks. How's this?
(same link as before)
[url]https://dl.dropboxusercontent.com/u/99106620/Combat%20Platformer/index.html[/url]
Now wall sliding is implemented as a separate state. When wall sliding, you can release all keys and you'll continue to slide for a split second before falling. You can also press the arrows in the opposite direction of the wall, in which case you'll freeze in midair for a split second before falling, unless you press space during this period in which case you'll vault off of the wall.
Overall, wall jumping should feel much more forgiving now.
[QUOTE=KillaMaaki;47465451]Made a bunch of tweaks. How's this?
(same link as before)
[URL]https://dl.dropboxusercontent.com/u/99106620/Combat Platformer/index.html[/URL]
Now wall sliding is implemented as a separate state. When wall sliding, you can release all keys and you'll continue to slide for a split second before falling. You can also press the arrows in the opposite direction of the wall, in which case you'll freeze in midair for a split second before falling, unless you press space during this period in which case you'll vault off of the wall.
Overall, wall jumping should feel much more forgiving now.[/QUOTE]
Feels great. Only slight issue I had is with the ledge grabbing mechanic happening on the small stairs. Sometimes, when I jumped towards the stairs at a certain distance/angle, a ledge grab would happen and the character would clip through the step under them. You don't necessarily get stuck when it happens, as you can just jump out, but it's still a weird issue.
Other than that, it's a great prototype, and it runs great on Chrome 64 bit.
[QUOTE=Rahu X;47466096]Feels great. Only slight issue I had is with the ledge grabbing mechanic happening on the small stairs. Sometimes, when I jumped towards the stairs at a certain distance/angle, a ledge grab would happen and the character would clip through the step under them. You don't necessarily get stuck when it happens, as you can just jump out, but it's still a weird issue.
Other than that, it's a great prototype, and it runs great on Chrome 64 bit.[/QUOTE]
Yeah, I keep seeing that too. It looks like it happens when you jump from the bottom of the stairs and just barely clip the corner of the second stair. I'll have to look into that and see why that's happening.
Nice to hear that it runs fine on [I]everyone else's Chrome[/I] -_-
Be great if it ran well on mine too, since that's my main browser.
EDIT: Oh. Apparently I just had to update Chrome >.<
EDIT: Ah. I think I fixed the issue. The raycasts for ledge hanging were way too long, so I've reduced the range drastically and can no longer seem to reproduce it. Also fixed an occasional bug where the wall sliding dust effect would continue playing if you grabbed a ledge while in the wall sliding state (forgot to disable the effect before triggering the state transition). Now making a new build and will upload when that finishes.
I think I may go ahead and start working on melee combat mechanics now :D
EDIT: It's uploaded. Again, same link. [url]https://dl.dropboxusercontent.com/u/99106620/Combat%20Platformer/index.html[/url]
[QUOTE=KillaMaaki;47466271]
EDIT: It's uploaded. Again, same link. [url]https://dl.dropboxusercontent.com/u/99106620/Combat%20Platformer/index.html[/url][/QUOTE]
Feels great. Walljumping is really easy and intuitive to execute now.
[QUOTE=itisjuly;47467536]Feels great. Walljumping is really easy and intuitive to execute now.[/QUOTE]
Good to hear.
Now to start working on combat... :)
I've been trying to create my own character controller and I just found that Unity already has one sigh :/ Been trying to play with platformers/racing games because they are easy to make afaik
[url]https://dl.dropboxusercontent.com/u/99106620/Combat%20Platformer/index.html[/url]
- Working out some sword fighting combat mechanics. I think they might be a little janky still, what do you guys think? X to attack. You can chain up to three attacks in a combo. If you finish a combo in midair, you have to wait until you land before you can continue attacking.
- Tweaked acceleration, player has a faster max speed but a slower acceleration.
- Fixed issue where I was a dummy and didn't code jump cut properly. Now you can release the jump button to cut your jump short.
- Added prototype art and sounds. I'm aware that there is a slight delay on the audio, this is apparently a known wontfix issue in Unity (they say it's because they convert audio to MP3 and that it will be fixed when they switch to AAC in 5.1, but I'm a little skeptical since I've never had this issue with MP3 files in the past)
- Changed controls. It's now X to attack, and C to jump.
- Refactored a lot of functionality from the player class into a base class (which all of the NPCs use).
EDIT: I think the code for attacking in particular might take the prize as the fugliest code I've ever written.
[QUOTE=KillaMaaki;47473546][url]https://dl.dropboxusercontent.com/u/99106620/Combat%20Platformer/index.html[/url]
- Working out some sword fighting combat mechanics. I think they might be a little janky still, what do you guys think? X to attack. You can chain up to three attacks in a combo. If you finish a combo in midair, you have to wait until you land before you can continue attacking.
- Tweaked acceleration, player has a faster max speed but a slower acceleration.
- Fixed issue where I was a dummy and didn't code jump cut properly. Now you can release the jump button to cut your jump short.
- Added prototype art and sounds. I'm aware that there is a slight delay on the audio, this is apparently a known wontfix issue in Unity (they say it's because they convert audio to MP3 and that it will be fixed when they switch to AAC in 5.1, but I'm a little skeptical since I've never had this issue with MP3 files in the past)
- Changed controls. It's now X to attack, and C to jump.
- Refactored a lot of functionality from the player class into a base class (which all of the NPCs use).
EDIT: I think the code for attacking in particular might take the prize as the fugliest code I've ever written.[/QUOTE]
It's a lot easier for me to climb over because whenever I attack the player is stuck at a fixed Y position and I can jump from there if I am near a wall.
Sorry, you need to Log In to post a reply to this thread.