Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
SneezeOfTheDecade
Feb 6, 2011

gettin' covid all
over your posts
Possibly a dumb question! I'm using Unity and C#, and I have a situation where I want to trigger an event if my character moves within 5 meters of a certain object, but have the object itself only have a collision radius of one meter. I thought I'd solved it by creating the object with just the collision, and then giving it an invisible child object with just a trigger and no collision.

So my hierarchy looks like this:

code:
v Plutocrat
    PlutocratTrigger
The issue comes when I want to access variables and methods on the Plutocrat when the PlutocratTrigger is triggered. I can't just say Plutocrat.AddEnergy() because there's more than one of them.

I've tried using this, which seems to be the accepted way to get a gameObject's parent:

code:
using UnityEngine;

public class PlutocratTriggerManager : MonoBehaviour {

    private Transform myParent;
    private int myParentEnergy;

    void Start() {
        myParent = gameObject.transform.parent;
        myParentEnergy = myParent.GetEnergy();
    }
}
but that throws an error:

code:
error CS1061: Type `UnityEngine.Transform' does not contain a definition for
`GetEnergy' and no extension method `GetEnergy' of type `UnityEngine.Transform'
could be found (are you missing a using directive or an assembly reference?)
Is there another way to gain access to the Plutocrat's methods? (GetEnergy() is a valid function in the Plutocrat .cs.) Can I, for example, give each Plutocrat a different name in the hierarchy and then call them by name (JoePlutocrat.GetEnergy())?

Or is there a way to sidestep the issue entirely and give an object a trigger radius that's larger than its collision radius, so that I can do away with PlutocratTriggers? (I haven't found one, but I only started using Unity this week.)

e: unbreaking the tables, sorry!

Adbot
ADBOT LOVES YOU

Polio Vax Scene
Apr 5, 2009



I know nothing about Unity and this is more a C# answer but can you cast Transform into a Plutocrat?

((Plutocrat)myParent).getEnergy();

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Manslaughter posted:

I know nothing about Unity and this is more a C# answer but can you cast Transform into a Plutocrat?

((Plutocrat)myParent).getEnergy();
Almost right - it's transform.getObject or something. There's a function for it anyway, I forget what it's called.

Bondematt
Jan 26, 2007

Not too stupid
If you are trying to call a method from another script you need to use GetComponent to get access to the script. Right now you are trying to access the method on the transform, and the transform itself has no methods to access.

code:

gameObject.GetComponent("ScriptName").method() is the right syntax if I remember right

So in your case it would be.

code:
myParent.GetComponent("Plutocrat").GetEnergy()
Edit: Just saw you did mention the script name.

Also you may need to get the gameObject of the parent, as if I remember right parent returns the transform. it would just be "myparent.gameObject" if that is the case.

Bondematt fucked around with this message at 03:54 on Nov 17, 2012

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Bondematt posted:

code:
myParent.GetComponent("Plutocrat").GetEnergy()
Oh yeah, in C# it's a bit nicer - you can't just call "GetEnergy" if you do it that way because GetComponent doesn't return an object of the script's type, so it ends up something like (myParent.GetComponent("Plutocrat") as Plutocrat).GetEnergy() (you can do it this way in C# and Unity-Javascript)

But in C# you can also do myParent.GetComponent<Plutocrat>().GetEnergy() which is a little bit less verbose and awkward.

SneezeOfTheDecade
Feb 6, 2011

gettin' covid all
over your posts
Awesome. Thank you guys. :) This is really Baby's First Unity Game but I at least want to make it playable! :)

Centripetal Horse
Nov 22, 2009

Fuck money, get GBS

This could have bought you a half a tank of gas, lmfao -
Love, gromdul

Bondematt posted:

code:

gameObject.GetComponent("ScriptName").method() is the right syntax if I remember right

So in your case it would be.

code:
myParent.GetComponent("Plutocrat").GetEnergy()

I think GetComponent() is slow as poo poo. If you're going to be using it often, you probably want to store a reference in a variable.

Centripetal Horse fucked around with this message at 23:55 on Nov 17, 2012

Ryen Deckard
Jun 28, 2008

My blood is red, white, and blue.
I'm pretty interested in game development, and for the last week have been doing python and java tutorials. I just wanted to get a feel for where you guys started, since I'm in the midst of programming a text adventure from the command line and want to know if I've got a good start.

Paniolo
Oct 9, 2007

Heads will roll.

Ryen Deckard posted:

I'm pretty interested in game development, and for the last week have been doing python and java tutorials. I just wanted to get a feel for where you guys started, since I'm in the midst of programming a text adventure from the command line and want to know if I've got a good start.

I would say a pretty large number of professional game developers started in exactly that same way. For me, the progression was text-based number games, then text-based CYOA games, then top-down shooters with ASCII graphics - all in QBASIC. Next game I made was a 2-player Tron lightcycle game in C, then a weird 3D tetris type game in OpenGL and C++, and then a lot of misc tech demos and half-finished game engines. Feels weird describing a 12 year progression in a single paragraph.

But anyway, as long as you're making something that you are learning from, you're on the right track.

SnowblindFatal
Jan 7, 2011

Ryen Deckard posted:

I'm pretty interested in game development, and for the last week have been doing python and java tutorials. I just wanted to get a feel for where you guys started, since I'm in the midst of programming a text adventure from the command line and want to know if I've got a good start.

Next step from that for me was picking some simple graphics drawing, input handling, sound playing library.

Try Pyglet or Slick2d. Former is for Python, latter for Java.


After that (I'm more or less at this step, even though I've done some simple opengl stuff) I'd say that you should pick up some real game engine like Unity3d, because who the hell except John Carmack makes their own engines these days.

Ryen Deckard
Jun 28, 2008

My blood is red, white, and blue.
Thanks for the responses, I did about a week straight of tutorials (learn python the hard way, then java for total beginners, then thenewboston videos) then decided to try and make a game. I keep throwing new problems at myself that I don't know yet, so I feel like I got that learning thing down pat.

SnowblindFatal posted:

Next step from that for me was picking some simple graphics drawing, input handling, sound playing library.

Try Pyglet or Slick2d. Former is for Python, latter for Java.


After that (I'm more or less at this step, even though I've done some simple opengl stuff) I'd say that you should pick up some real game engine like Unity3d, because who the hell except John Carmack makes their own engines these days.

Right now, I want to get this text game going, then I'll try out Slick2d. I want to stick with Java for the time being since I'm going to college for Computer Science and want to end up with a java development job first and foremost. Don't want to work for the game industry after hearing too many horror stories, would rather do this as a hobby.

I'll try out Slick2d after I feel I've got a decent grasp of arrays, switches, etc. I don't want to add more libraries to my repertoire until I'm comfortable with the baseline java.

Edit: There is no way I will be coding my own 3d engine, but I would like to give my own 2d engine a shot. I might try a basic 3d engine down the line though, because I would really love to have something like even a rudimentary 3d engine in my resume.

Mezzanine
Aug 23, 2009
Hey, another wannabe game maker here. I've got my heart set on making something for iOS, and I've started fiddling around with Core Graphics stuff, but this "Unity" thing is apparently the way to go, right?

Is it possible to at least try out the engine on actual devices without paying some kind of licensing fee, or is that only for PC stuff?

Unormal
Nov 16, 2004

Mod sass? This evening?! But the cakes aren't ready! THE CAKES!
Fun Shoe
http://unityvs.com/

Just started using this and I love it; debugging unity in visual studio! Beautiful.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Unormal posted:

http://unityvs.com/

Just started using this and I love it; debugging unity in visual studio! Beautiful.
Ok, so this wouldn't work if you're using the Unity UI heavily, but... jesus. This plus Futile must be an absolute dream, as far as "making Unity act like any other multiplatform engine."

Ryen Deckard
Jun 28, 2008

My blood is red, white, and blue.
Was really hoping I could keep going without asking for help, but looks like I'm stuck.

Before I catch any flak, I have been programming for a week and I know this code is probably terrible, but I just want it to be functional at this point as I keep learning.

Anyway, I can't seem to get my room1 function to keep looping and accepting inputs while you are still in that room.

http://pastebin.com/cineCNPU

If anybody can help me out here, I would really appreciate it, since I am totally lost.

Edit: I didn't add any other classes since they're all working fine, the error is that the code will just keep pulling inputs after the first one, and never return.

Ryen Deckard fucked around with this message at 20:40 on Nov 18, 2012

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
First of all, you keep looping when first is true, but you never set it otherwise. Was that meant to be an if statement? Second, you make the classic mistake of assignment vs. comparison (= vs. ==) in your torch loop.

Paniolo
Oct 9, 2007

Heads will roll.

Ryen Deckard posted:

Was really hoping I could keep going without asking for help, but looks like I'm stuck.

Before I catch any flak, I have been programming for a week and I know this code is probably terrible, but I just want it to be functional at this point as I keep learning.

Anyway, I can't seem to get my room1 function to keep looping and accepting inputs while you are still in that room.

http://pastebin.com/cineCNPU

If anybody can help me out here, I would really appreciate it, since I am totally lost.

Edit: I didn't add any other classes since they're all working fine, the error is that the code will just keep pulling inputs after the first one, and never return.

Learn to use a debugger, dude. It's the best advice anyone can possibly give you; it's the programming equivalent of teaching a man to fish.


Shalinor posted:

Ok, so this wouldn't work if you're using the Unity UI heavily, but... jesus. This plus Futile must be an absolute dream, as far as "making Unity act like any other multiplatform engine."

That looks sweet, but $125 with no demo is pretty steep for hobby work.

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.
I'm not a java programmer, but in addition to what Suspicious Dish already said this part looks problematic:

Java code:
                String in = input();
                while(inroom == true){
                   // make decisions based on the value of 'in'
                }
It reads the value of in once and then does a while loop that never updates the value of in again. Moving your input reading method inside the loop so that it gets updated with each new command would help:

Java code:
                while(inroom == true){
                   String in = input();
                   // make decisions based on the value of 'in'
                }

PDP-1 fucked around with this message at 20:57 on Nov 18, 2012

The Gripper
Sep 14, 2004
i am winner

Paniolo posted:

That looks sweet, but $125 with no demo is pretty steep for hobby work.
That's my thoughts about it too. I like the VS UI and debugger, would love to use something like UnityVS, but it's something I'm not willing to pay $125 for just on hobby projects. I don't think even a demo would do much to sway me.

Ryen Deckard
Jun 28, 2008

My blood is red, white, and blue.
I fixed the issues you guys pointed out above, and updated the paste. I don't want to poo poo up this thread, but if anybody can send me a pm with advice that would be fantastic.

Regarding the debugger, I'm using eclipse, and just found out that it includes a debugger so I'll be reading up on that. Thanks.

Unormal
Nov 16, 2004

Mod sass? This evening?! But the cakes aren't ready! THE CAKES!
Fun Shoe

The Gripper posted:

That's my thoughts about it too. I like the VS UI and debugger, would love to use something like UnityVS, but it's something I'm not willing to pay $125 for just on hobby projects. I don't think even a demo would do much to sway me.

Yeah, it's pricey; but for the amount of hours I spend wanting to strangle Unity, it was worth it for me to at least feel enraged in a nice IDE. They'd probably be doing themselves a huge favor to release a $20 or $30 "indie" version though.

The Gripper
Sep 14, 2004
i am winner
I'd imagine at a $25-35 price-tag for individuals they'd make a lot more money out of it too. It'd probably make the non-individual license price look overpriced, though, so I guess that's a consideration.

Bondematt
Jan 26, 2007

Not too stupid

Ryen Deckard posted:

I fixed the issues you guys pointed out above, and updated the paste. I don't want to poo poo up this thread, but if anybody can send me a pm with advice that would be fantastic.

Regarding the debugger, I'm using eclipse, and just found out that it includes a debugger so I'll be reading up on that. Thanks.

I don't have PM, but you can email me at (my username)@msn.com

The main thing I see occuring is when the user changes input from "go left" to "open door" or "go right" it will fail the "go left" check and never get to those encapsulated if statements.

You are also assigning torch to true in an if instead of comparing the values. To avoid this it is best to just use the bool and no comparison as the bool is true or false already.

And this while loop can be done with an if
code:
while(first==true){
	System.out.println("You are in a room");
	first = false;
}
is the same as

code:
if(first){
	System.out.println("You are in a room");
	first = false;
}
which is actually the same as just
code:
System.out.println("You are in a room");
in this case, since first is set to true every time room1 is called and it's set to false once the while is run. It will display only once for every call of room1 which is the same as just placing the println before any loop.

I'd also recommend placing comments on what it should be doing as you go through. It helps a lot with logic especially when things get complex. The best part is it makes it so when you have a fresh set of eyes they know what you are trying to accomplish.

Definitely learn to use the debugger as it is probably throwing fits right now.

Ryen Deckard
Jun 28, 2008

My blood is red, white, and blue.

Bondematt posted:

I don't have PM, but you can email me at (my username)@msn.com

The main thing I see occuring is when the user changes input from "go left" to "open door" or "go right" it will fail the "go left" check and never get to those encapsulated if statements.

You are also assigning torch to true in an if instead of comparing the values. To avoid this it is best to just use the bool and no comparison as the bool is true or false already.

And this while loop can be done with an if
code:
while(first==true){
	System.out.println("You are in a room");
	first = false;
}
is the same as

code:
if(first){
	System.out.println("You are in a room");
	first = false;
}
which is actually the same as just
code:
System.out.println("You are in a room");
in this case, since first is set to true every time room1 is called and it's set to false once the while is run. It will display only once for every call of room1 which is the same as just placing the println before any loop.

I'd also recommend placing comments on what it should be doing as you go through. It helps a lot with logic especially when things get complex. The best part is it makes it so when you have a fresh set of eyes they know what you are trying to accomplish.

Definitely learn to use the debugger as it is probably throwing fits right now.

I appreciate this, and I might e-mail you later. I actually solved all the issues I was having on my own, and I think I'm done with this project now. The engine works properly, now all I need to do is add rooms and enemies to fight, but that would take this from a "can I make a working game" to "make an entire text adventure" and I just wanted to prove to myself that I could get an engine running.

I really do appreciate the tips though, as that's all stuff I didn't know and it's good to see I can make my code more efficient.

Vivian Darkbloom
Jul 14, 2004


Vivian Darkbloom posted:

Sooo, I'd really like to make a Paradox-style game, only turn based and with all my own mechanics. Paradox games are strategy games with maps like this, where you control a country in a historical setting:



Is there a practical (and inexpensive) platform I could use to get started with a project like this? Would PyGame be suitable at all? I guess at the very least, I need a way to make a scrolling map, screens with lots of options (as in the Civ series), pop-ups, AI (both strategic and pathfinding), a backend capable of implementing lots of complex rules...

I've started playing around with this project. Is there any recommended way to make a province map, where the provinces are irregular shapes instead of tiles or hexes? I guess I'll need to make a digital copy of my province map and get it into pygame somehow.

e: I'm using PyGame! I thought of maybe drawing all the borders between provinces as vectors and writing some code to infer the provinces from those lines? I'd prefer not to do this with a big ol' bitmap, even though it's a 2D game.

Vivian Darkbloom fucked around with this message at 16:14 on Nov 19, 2012

HaB
Jan 5, 2001

What are the odds?

Vivian Darkbloom posted:

I've started playing around with this project. Is there any recommended way to make a province map, where the provinces are irregular shapes instead of tiles or hexes? I guess I'll need to make a digital copy of my province map and get it into pygame somehow.

e: I'm using PyGame! I thought of maybe drawing all the borders between provinces as vectors and writing some code to infer the provinces from those lines? I'd prefer not to do this with a big ol' bitmap, even though it's a 2D game.

I was working on a game project that did this same basic thing, and was storing the territories as a collection of points, but as I was driving around the other day in the car, it dawned on me that something like a Flood Fill algorithm probably would have been a lot faster. Could even save the results as your "map" file. So - select a point, flood fill to find the limits of the territory and there you go. Assuming your territories are actually closed, that is.

Jewel
May 2, 2009

Vivian Darkbloom posted:

I've started playing around with this project. Is there any recommended way to make a province map, where the provinces are irregular shapes instead of tiles or hexes? I guess I'll need to make a digital copy of my province map and get it into pygame somehow.

e: I'm using PyGame! I thought of maybe drawing all the borders between provinces as vectors and writing some code to infer the provinces from those lines? I'd prefer not to do this with a big ol' bitmap, even though it's a 2D game.

One of the worst things about pygame imo is the inability to draw textured (or even solid) n-dimensional polygons of any shape. The only way you could do it is probably just create the maps dynamically via some kinda.. maybe voronai algorithm subdivided with some random noise displacement added? That might give the best result, dunno though! If you did that, however, you'd be stuck with just lines, no color fills, unless there's an extension for pygame that can draw triangle strips/fans/whatnot, but I haven't found any.

Edit: vvvv Holy poo poo, I can't believe my way is actually how they seemingly do it. That's kickass.

Jewel fucked around with this message at 16:53 on Nov 19, 2012

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

Vivian Darkbloom posted:

I've started playing around with this project. Is there any recommended way to make a province map, where the provinces are irregular shapes instead of tiles or hexes? I guess I'll need to make a digital copy of my province map and get it into pygame somehow.

e: I'm using PyGame! I thought of maybe drawing all the borders between provinces as vectors and writing some code to infer the provinces from those lines? I'd prefer not to do this with a big ol' bitmap, even though it's a 2D game.

I bastardized this tutorial: http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/

In order to create a map generation system similar to a paradox style map:

http://devblog.phillipspiess.com/projects/mapgen/ (Click the map and use the arrow keys to show different modes.) I'm totally available via PM or whatever if you have any questions.

overeager overeater
Oct 16, 2011

"The cosmonauts were transfixed with wonderment as the sun set - over the Earth - there lucklessly, untethered Comrade Todd on fire."



What's the preferred JSON parser for Unity? I'm using MiniJSON right now, but it's got some performance issues with larger files.

(Bonus if it works with Unity Android/iPhone as well.)

Vivian Darkbloom
Jul 14, 2004


Pfhreak posted:

I bastardized this tutorial: http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/

In order to create a map generation system similar to a paradox style map:

http://devblog.phillipspiess.com/projects/mapgen/ (Click the map and use the arrow keys to show different modes.) I'm totally available via PM or whatever if you have any questions.

Awesome, thank you! I will be going through that closely.

Bunny Cuddlin
Dec 12, 2004

Jewel posted:

One of the worst things about pygame imo is the inability to draw textured (or even solid) n-dimensional polygons of any shape.

http://www.pygame.org/docs/ref/draw.html#pygame.draw.polygon ?

edit: this is only solid, but you could maybe fake textured polys by maybe making a surface, blitting the texture to it, then blitting a solid poly over that with the color key set to the color of the poly.

Bunny Cuddlin fucked around with this message at 20:48 on Nov 19, 2012

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Jewel posted:

One of the worst things about pygame imo is the inability to draw textured (or even solid) n-dimensional polygons of any shape.
:psyduck:

n-sided surely!

A note to the guy that was asking about Agile junk a while back, I've recently discovered that my breakdown into small components to work on, while helpful for the most part, was inadequately small chunks when it comes to client-server (or peer-to-peer) communication. I think when breaking down that sort of thing, where you're inevitably implementing the same thing twice (once for what to send, once for what to do with it), it's helpful to break it right down to that level - "client sends XYZ / server receives XYZ / server parses XYZ / server puts XYZ-based data into database / server replies with ABC / client receives ABC / client parses ABC". Not only does having this written out help you not forget to implement a piece of the communication because you got distracted by another piece, but it also helps you spot if you're going to be missing some vital information before you start.

Bunny Cuddlin
Dec 12, 2004

Bunny Cuddlin posted:

http://www.pygame.org/docs/ref/draw.html#pygame.draw.polygon ?

edit: this is only solid, but you could maybe fake textured polys by maybe making a surface, blitting the texture to it, then blitting a solid poly over that with the color key set to the color of the poly.

Here's some code to demonstrate the edit:
Python code:
import pygame
from pygame.locals import *

pygame.init()
window = pygame.display.set_mode((640, 480))

while True:
	scott = pygame.image.load('scottsmall.jpg')
	polysurf = pygame.Surface((scott.get_width(), scott.get_height()))
	polysurf.fill((0, 0, 0))
	pygame.draw.polygon(polysurf, (69, 69, 69), [(30, 30), (120, 30), (170, 60), (170, 120), (120, 125), (100, 85), (30, 95)])
	polysurf.set_colorkey((69, 69, 69))
	scott.blit(polysurf, (0, 0))
	scott.set_colorkey((0, 0, 0))
	window.fill((255, 255, 255))
	window.blit(scott, (10, 10))

	for event in pygame.event.get():
		if event.type == QUIT:
			pygame.quit()
			sys.exit()
		if event.type == KEYDOWN:
			if event.key == K_ESCAPE:
				pygame.event.post(pygame.event.Event(QUIT))
	pygame.display.update()
	pygame.time.Clock().tick(60)
you'll also need this picture of Rick Scott in the directory when you run it named "scottsmall.jpg"

Only registered members can see post attachments!

Bunny Cuddlin fucked around with this message at 21:03 on Nov 19, 2012

field balm
Feb 5, 2012

The futile/Unityvs stack looks like something that would get me interested in unity again, but yeah, $125 is too steep for me. $30 or so would be a different story!

Centripetal Horse
Nov 22, 2009

Fuck money, get GBS

This could have bought you a half a tank of gas, lmfao -
Love, gromdul

Unormal posted:

Yeah, it's pricey; but for the amount of hours I spend wanting to strangle Unity, it was worth it for me to at least feel enraged in a nice IDE. They'd probably be doing themselves a huge favor to release a $20 or $30 "indie" version though.

Speaking of strangling Unity, I spent this past weekend cranking out a few hundred lines of code, perfecting some particle effects, and adding objects to a scene, only to have Unity turn my work into vapor. I saved constantly while working, but as soon as I closed Unity, everything disappeared. All my scripts, which were opened and edited in Mono, are gone (all I can find are old version), my scene reverted back to what it was at the beginning of the week, my particles and other objects are simply gone... I started a thread on the Unity support forum, but drat... How the gently caress does that happen? No warnings that I am saving to a temp folder, or that my changes are not going to stick, or something? Just let me work for almost three straight days, then set fire to all my changes when I close the IDE?

Jewel
May 2, 2009

Bunny Cuddlin posted:

http://www.pygame.org/docs/ref/draw.html#pygame.draw.polygon ?

edit: this is only solid, but you could maybe fake textured polys by maybe making a surface, blitting the texture to it, then blitting a solid poly over that with the color key set to the color of the poly.

Ahah, oh, woah, thanks. I don't quite remember that existing, hmh.

roomforthetuna posted:

:psyduck:

n-sided surely!

:getin:

Mo_Steel
Mar 7, 2008

Let's Clock Into The Sunset Together

Fun Shoe
Relatively straightforward question for folks proficient with Unity: is there a straightforward means to load a music file into an audio source at runtime? So far the closest thing I've found to a solution is using WWW to load up the file like so (using C#):

code:
WWW runtimeAudio = new WWW("file://C:/audioFile.mp3");
audio.clip = runtimeAudio.audioClip;
The only issue is this doesn't support mp3 in PC Standalone platforms. Is there a pay feature to unlock that functionality for PC platform games, or another method to import audio files specified by the user during runtime? I tried digging through the Unity Knowledgebase and Support sections and didn't find much to point me in the right direction. The end goal is to experiment around with a game where gameplay changes according to user selected music (a'la Beat Hazard or Audiosurf as examples).

stramit
Dec 9, 2004
Ask me about making games instead of gains.

Centripetal Horse posted:

Speaking of strangling Unity, I spent this past weekend cranking out a few hundred lines of code, perfecting some particle effects, and adding objects to a scene, only to have Unity turn my work into vapor. I saved constantly while working, but as soon as I closed Unity, everything disappeared. All my scripts, which were opened and edited in Mono, are gone (all I can find are old version), my scene reverted back to what it was at the beginning of the week, my particles and other objects are simply gone... I started a thread on the Unity support forum, but drat... How the gently caress does that happen? No warnings that I am saving to a temp folder, or that my changes are not going to stick, or something? Just let me work for almost three straight days, then set fire to all my changes when I close the IDE?

Unity always saves your work to the actual files, not some temporary location. This seems really really weird. Unity does not keep older versions of the project around and there is no inbuilt local VCS. I have no idea how this could happen at all. Did you run a windows rollback or a time machine restore or something?

Flownerous
Apr 16, 2012

Mo_Steel posted:

Is there a pay feature to unlock that functionality for PC platform games, or another method to import audio files specified by the user during runtime?

Didn't see anything on the Asset Store.

The top answer here has an explanation and two workarounds:
http://answers.unity3d.com/questions/168678/why-mp3-cant-work-on-webstandalone.html?sort=oldest

And I think there's a price to pay if you distribute over 5000 units: http://mp3licensing.com/royalty/games.html

Adbot
ADBOT LOVES YOU

The Gripper
Sep 14, 2004
i am winner

Strumpy posted:

Unity always saves your work to the actual files, not some temporary location. This seems really really weird. Unity does not keep older versions of the project around and there is no inbuilt local VCS. I have no idea how this could happen at all. Did you run a windows rollback or a time machine restore or something?
It can happen if you set the path of an asset to the root directory of your assets AssetDataBase.CreateAsset("Assets") (why would you do this?). I don't think this would roll you back to an old version though, just outright delete all your assets.

It could also possibly happen if your project directory is in %USERNAME% or %APPDATA% and for some reason your system has loaded you into a temporary profile. In that case you could check C:\Users\ for any temporary users (I think they're named <YourUsername>.<RandomCharacters> e.g. "CentripetalHorse.dghsd").

I'm not sure whether that would have you working on a separate copy of your unity project, but it can't hurt to check.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply