Barthap
Member
|
RE: EEDevTools (Developer's Console / Events System)
Wrapping to lua isn't difficult for me but one question: Why do you use Actors for events, not Game objects? In LUA I use Game Object classes. Yes, I can use Obj.actor but this can complicate code.
Sorry for my bad English
|
|
07-09-2011 09:52 AM |
|
Driklyn
Member
|
RE: EEDevTools (Developer's Console / Events System)
I suppose the main reason I chose to use Actors over Objs is because you can access the obj via the actor, but you can't access the actor via the obj (without casting first).
For example:
versus:
Code:
Game::Item *item = CAST(Game::Item, obj);
item->actor
Also, you're likely going to need the Actor for checking collisions to see if a certain event type has occurred.
Other reasons are:
- It seemed like Actors would be needed more often than just a basic Game::Obj
- It seemed like using Actors would give you easier access to more information (for instance, the most useful info in Game::Obj is pos and matrix, Actor gives you both plus more)
- Events Editor uses Actors for ray testing
- At the time, for whatever reason, I remember thinking Objs wouldn't even work (but now, I suppose they could)
I remember thinking, if you could access the actor via the obj (without casting), I would have chosen to use Objs instead, but since you can't (because not all Objs require an Actor), for the reasons above, I decided against it.
|
|
07-09-2011 10:45 AM |
|
Driklyn
Member
|
RE: EEDevTools (Developer's Console / Events System)
Forgot to mention that the fix for the font bug in the Console tool has also been uploaded, along with a new font.
Also, you no longer have to rebuild the included version of the Events Editor to get it to open without crashing (forgot to include the most up-to-date version in the download).
|
|
07-10-2011 12:36 AM |
|
Aniketos
Member
|
RE: EEDevTools (Developer's Console / Events System)
Awsome tools. Just tested the console seems to work good although from the code I noticed you can't really create a command that would take a string?
Example: spawn rock
since the setCommand overloads seem to take int's?
|
|
07-12-2011 03:01 PM |
|
Driklyn
Member
|
RE: EEDevTools (Developer's Console / Events System)
That's right. No strings, the console only accepts Byte values (or values that can be casted to Byte, such as Int).
You can, however, create the command as "spawnRock", leaving off the min/max values, which will allow you to simply type "spawnRock" to execute the command ("exit" and "quit" commands are like this). Although, you will have to create a separate command for each object type.
I don't think it would be that hard to allow for strings, however, if you wanted to attempt to code it in.
Another thing I thought of, was the ability to add brief descriptions to the commands, so you can better describe to the user what the command does.
|
|
07-13-2011 05:40 AM |
|
Aniketos
Member
|
RE: EEDevTools (Developer's Console / Events System)
Yeah, Description would be cool. When I get home I'll try to implement str overload cause that's more handy IMO then seperate functions for every single object. With string overload you could in theory make a function with a switch that check's what input you get and spawn based on that a specific object. If i'm not mistaken thats how hl2 does it to a sertain extend.
|
|
07-13-2011 08:52 AM |
|
Driklyn
Member
|
RE: EEDevTools (Developer's Console / Events System / Project Creator)
--------------------
BRAND NEW TOOL! Check the first post for more information.
|
|
10-02-2011 08:17 AM |
|
Driklyn
Member
|
RE: EEDevTools (Developer's Console / Events System / Project Creator)
Haha, thanks!
The Project Creator tool was the easiest one to create so far, only took a couple hours. I used to just manually edit the VS project files in Notepad to change the name from 'Tutorials' to my project name, but I figured I could just write a program to do that for me.
P.S. If you want to include the Project Creator in the official toolset, feel free! It's all open source, so you can modify it however you like, if you see any changes you want to make.
|
|
10-02-2011 09:47 PM |
|
Esenthel
Administrator
|
RE: EEDevTools (Developer's Console / Events System / Project Creator)
few notes:
Vec2 &size = D.pixelToScreenSize(Vec2(360, 20));
reference is invalid
Str8 sdkPath = PathFix(sdk()).tailSlash(true);
don't use Str8 for any of the paths (will stop working on unicode paths)
Str8 contents = f.getStr();
File::getStr is meant for reading strings written only using putStr (in binary files), do not use it for text files, use FileText::fullLine or XmlData::load (if 'sln' file is xml, then you should use XmlData)
|
|
10-02-2011 09:57 PM |
|
Driklyn
Member
|
RE: EEDevTools (Developer's Console / Events System / Project Creator)
Good points.
I was wondering about the reference on 'size'. I didn't have it there initially, but I tried adding it to see what would happen and it didn't crash, so I kept it since I thought it would use less memory (though that's not even an issue for such a simple tool).
I tried using FileText::fullLine but I had trouble with it. If I remember correctly, I couldn't get it to output the file correctly, like it only wrote half the file or something. Maybe I was reading/writing it wrong?
Tried using FileXml for the 'sln' file but wasn't really sure how to use it or if it was even what I should be using. XmlData::load seems like it could work. I imagine this will fix the issue I was having with writing the 'sln' file using FileText. Some of the first few characters were missing, which is the purpose of the 'xmlFix' variable in the source.
I'll make these changes and try using XmlData::load for proper Xml reading. I knew Str8 contents = f.getStr(); didn't seem right. Was surprised to find that it even worked for the most part.
----------
Edit: Actually, it's the .vcxproj and .vcproj files that are Xml, not the .sln files.
(This post was last modified: 10-02-2011 11:04 PM by Driklyn.)
|
|
10-02-2011 10:19 PM |
|
Dandruff
Member
|
RE: EEDevTools (Developer's Console / Events System / Project Creator)
The project creator tool would be really handy for me, thanks
edit: i noticed that the sln is saved as a UNIX file and i had to convert it to Dos\Windows using notepad++ for it to open correctly.
(This post was last modified: 10-03-2011 03:55 AM by Dandruff.)
|
|
10-03-2011 03:53 AM |
|
Driklyn
Member
|
RE: EEDevTools (Developer's Console / Events System / Project Creator)
@Esenthel,
How do we loop line-by-line through a file using FileText::fullLine?
Also, is it really worth switching to FileText::fullLine and XmlData::load versus just f.getStr()? It seems like more trouble than it's worth since all I really need to do is load the entire file in and use Replace() once or twice to change some text. Using XmlData::load will load in each XmlNode individually meaning I would have to call Replace for every single node that needs it (over 200 of them), instead of just twice like it is now. And even though f.getStr() is not meant to be used this way, it appears to be working, right?
(10-03-2011 03:53 AM)Dandruff Wrote: i noticed that the sln is saved as a UNIX file and i had to convert it to Dos\Windows using notepad++ for it to open correctly.
Yeah, I'm not sure what the problem is on that. For me, I just have to right-click the .sln, Open with > Microsoft Visual Studio 2010 and it works just fine, but when I double-click it, nothing happens. The icon does not have a 9 or 10 on it, like the Tutorials .sln files do, to signify which version of VS they are. This must be a clue that something is wrong.
|
|
10-03-2011 07:42 AM |
|
Esenthel
Administrator
|
RE: EEDevTools (Developer's Console / Events System / Project Creator)
Maybe the issue is because of getStr usage
Read it:
For(;!f.end();)lines.add(f.fullLine());
You can read both sln and project files this way
|
|
10-03-2011 12:26 PM |
|
Driklyn
Member
|
RE: EEDevTools (Developer's Console / Events System / Project Creator)
Cool, .sln files are being written correctly now so that VS opens the projects when double-clicking on them. I have one problem though, .sln files uses tabs instead of spaces to indent, but f.fullLine() only keeps starting spaces, so all lines are written to column 0.
|
|
10-03-2011 08:26 PM |
|