| Search this Thread |
|
|
#26 | |
|
Buzzler
1978 gallons of pancake batter
|
Quote:
It seems like Visual Studio still compiles against the original libraries. The altered libraries are located in the exact directory where the VS references point to, yes? | |
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
||
|
|
|
|
|
#27 |
| dim4sim |
All the libraries that are being referenced, should be the unprotected ones. I may have reverted some common libraries like System and System.Xml. I am also using the standard mscorlib. I will try to unlink the refs and link them again. I somehow doubt that it will help though. Thanks. |
|
|
|
|
|
#28 | |
|
Consort
|
Quote:
put using Sims3.SimIFace; in assemblyinfo.cs |
|
|
|
|
|
|
#29 |
| dim4sim |
That should already be there. I will double check when I get home. Also, not being a C# developer by profession, I am trying to understand why using Sims3.SimIFace is put into AssemblyInfo.cs but nothing else. What libraries belong in there, and what is the difference? Thanks. |
|
|
|
|
|
#30 |
|
misukisu
|
The [assembly: Tuning] you added to your AssemblyInfo can be found in Sims3.SimIFace namespace. If you had not modified AssemblyInfo, then you would not have needed to add the using reference either. The relation is similar than with the classes that you use in your code. Whenever you use a class, there must be a "using" reference to used namespace/class. |
|
|
|
|
|
#31 | |
| dim4sim |
Ah. That makes sense. In my VS2010 project, the assembly:Tuning actually throws errors. It still recognizes it inside of the class if I remove that line though. *Edit: I was able to compile, although uncertain of actual success. I didn't get any of my alerts to show up, but I also noticed that my lib was not registering in ErrorTrap's list
Code:
Am I missing something in terms of packaging? I also tried adding in an _XML file with a kInstantiator, and referenced it in my code. Is there anything else that I need? Thanks. |
|
|
|
Last edited by dim4sim : 27th Apr 2012 at 06:11 AM.
|
|
|
#32 |
| dim4sim |
Any insight? |
|
|
|
|
|
#33 |
|
Consort
|
The kInstatiator XML needs a fnv-hashed namespace.class instance set in the .package, referencing your dll. Re-read the pure scripting mod tutorial on that. Is your tuning working now? Without tuning your dll is not loaded |
|
|
|
|
|
#34 | |
|
Buzzler
1978 gallons of pancake batter
|
Quote:
| |
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
||
|
|
|
|
|
#35 | |
| dim4sim |
I am 90% sure that I am setting everything up correctly, but I can't seem to get even the simplest piece of code from firing off in the game. Here's my test case:
Code:
Tuning hashed to "Dima.Test". If you see anything missing here, please let me know. Also, if there is a different/better alerting method that I can use, please let me know as well. I was trying to go through twallan's code to find out how to make the event tooltip, but I got a bit lost. I'll keep looking through it though. I will most likely need it eventually. As for the inability to bind event before: I realized why it was coming back undefined--I was referencing an unprotected version of Sim3.SimIFace, which apparently breaks thing. Another thing that I realized: the Unprotect script compiles for .NET 4.0, not 2.0. I don't know if this has much of an effect on things, but I changed it to recompile using 2.0. Thanks for all the help guys. |
|
|
|
|
|
|
#36 |
|
Buzzler
1978 gallons of pancake batter
|
Hmm, the using System.Linq; part confuzzles me. LINQ is a .NET 3.0 feature (or 3.5?), so that should give you a compile error if you actually set your project to .NET 2.0. Please attach your package and maybe your project folder, please. |
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
|
|
|
|
|
|
#37 |
| dim4sim |
@Buzzler: you were right--I forgot to switch over to .NET 2.0. I've set up the projects so many times already, I can barely keep track of which one I am working on. I have tried every iteration that I can think of, of how to put things together. I am still not able to see the message box show. Is it possible that I am trying to create a message box before one exists? Attached in the Project and the package that I am testing with. |
|
|
|
|
|
#38 | |
|
Buzzler
1978 gallons of pancake batter
|
Ok, works fine for me. Works fine as in "crashes the game". That project is still compiled against the .NET libraries. I'd change that. Try that instead of directly showing the dialog:
Code:
| |
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
||
|
|
|
|
|
#39 |
|
Consort
|
@dim4sim If you want to test your VS setup, here's a mod as a vs2008 project http://www.modthesims.info/showpost...506&postcount=9, here's a vs2010 project http://www.modthesims.info/showthread.php?t=473623. I think you just have to do the references by hand. Might be of help if you want to see something you compile appear in the game. The learning curve of achieving that can be quite brutal
|
|
|
|
|
|
#40 |
| dim4sim |
Thanks for the project links Consort. I tried compiling your code (just the part that is binding and showing the Notice), and still nothing. Absolutely nothing happens in my game. Is it possible that something is not compiling right because I am on a Win7 64bit? All other mods work for me, but not ones that have been compiled on my own machine. Also, I noticed something that happens only to my dlls: when you look at the S3SA, after the refs, it says "Type: Dima.Test", which is the Namespace.Class. I checked at least 4 other mods and none of them have that. Thanks. Edit: I got something to work! Finally! I started clearing the scriptCache on every update. I'm surprised that I hadn't thought of it before. Perhaps I can finally make some progress. Also, it may have had to do with the fact that I was keeping S3PE open between runs. |
|
|
Last edited by dim4sim : 10th May 2012 at 04:39 PM.
|
|
|
#41 |
| dim4sim |
Hey Buzzler, I've been studying your Chuck Norris mod, and I was wondering if I you would mind me borrowing your event delegation setup. Also, I have a few questions as to why certain things are done the way they are, such as defining something as null, then checking to see if that thing is null, and setting it, as opposed to just setting something right away. My first guess would be to eliminate room for error so that everything could be caught in the try block. I would imagine that the Sims3 codebase isn't the most stable of things, so expect the unexpected, right? Also, is there any way to share the base library between several libraries? Maybe compile into a DLL and import in another script mod? The only thing that I would expect in that scenario is that, if I change the base library from one mod to another, and they have the same hash value, they will replace each other unpredictably. Thanks. |
|
|
|
|
|
#42 | |||
|
Buzzler
1978 gallons of pancake batter
|
Quote:
Quote:
Quote:
| |||
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
||||
|
|
|
|
|
#43 | |||
| dim4sim |
Aside: Forgot to mention: I'm back now. I took a bit of time of to gather my thoughts, play some games, sleep, and relax. If someone were to create a shared library, such as the one that you have, would it need to have different hash values, to prevent overriding? I think that it would be great to have a MTS.Common.dll that could be supported by various volunteers--I sure would. Quote:
Yea, I'll do this for now, and expand on it later, once I have a better grasp on things. Quote:
In TwoBTech.Roundhouse.Interactions.KickScum, inside the InRabbitHole method, there is the following:
Code:
Why not just assign it straight away? I was also going to ask you about that delegate line, but after some reading today, I now know that it's an anonymous function. Finally, something I can relate to. Thanks again for all the help. |
|||
|
|
|
|
|
#44 | ||||
|
Buzzler
1978 gallons of pancake batter
|
Quote:
Quote:
Code:
(That should be the related line anyway.)
And the original is this
Code:
The () => ... part is a lambda expression and means the same as the delegate{...} part.
| ||||
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
|||||
|
|
|
|
|
#45 |
| dim4sim |
That's weird--I'm using Reflector as well. I will try to open it up with ILSpy to see what I get. On a tangent, I wanted to ask some questions about Alarms (feel free to point me to a Wiki): -AlarmTypes: does NeverPersisted run once, and an AlwaysPersisted run a poller? Better yet, what are the differences between the different AlarmTypes? -If a Sim Minute == a regular second, does a Sim Second (TimeUnit.Seconds) == 1/60 second, or 16.667 milliseconds? Thanks |
|
|
|
|
|
#46 |
|
twallan
|
"AlwaysPersisted" means the alarm is saved to the save-file and restored the next time you load the game. "NeverPersisted" means the alarm is never saved to the save-file, and requires that you restart it via code when the game loads up. To run a repeating alarm you need to use AddAlarmRepeating or AddAlarmDay. ---- As for times smaller than a sim-minute : I'm not certain how they are handled by the game. Perhaps another user can elaborate on them.
|
|
NRaas Industries: Sims 3 Mods for the Discerning Player, hosted by The Wikispaces. |
|
|
|
|
|
|
#47 | |
| dim4sim |
Hey Buzzler, I have a question: in your framework, when you go to bind the interactions, why do you need to execute the command on all GameObjects?
Code:
Actually, the questions is two-fold: -do you have to attach the interaction to every single instance of the GameObject that you are working with? -why do you need to try to attach to EVERY GameObject, regardless of its type? I was just looking at this in greater detail because I am trying to understand how to correctly implement the ReplaceInteractions method. Right now, it is very similar in code to the AddInteractions, which will need to change in order to accomodate for the additional steps needed in a replacement. Thanks |
|
|
|
|
|
|
#48 | |
|
Buzzler
1978 gallons of pancake batter
|
Quote:
The ApplyInteractions() method gets called for each GameObject and will in turn call RemoveInteractions() and AddInteractions(). - RemoveInteractions checks if a matching key is found in the mRemoveInteractions dictionary and if so, will remove interactions (by type) for each type in the value. - AddInteractions checks if a matching key is found in the mAddInteractions dictionary and if so, will add all interactions in the value unless the respective interaction is already there. It will not add the interaction if the types don't match (and the target object isn't of a sub type of the given type). I just iterate over every GameObject and then determine the action to take. That action may be to do nothing. The reason why I do that for all GameObjects is that I assume it'd take longer to iterate over each dictionary's keys and only query the given types. Right now I have _one_ loop that iterates over a pretty large collection. The alternative would be to have quite a lot of loops that iterate over collections that may or may not be smaller. | |
|
Robot Armed With Down Comforter Levels Apartment Building, Holds Mayor Hostage. |
||
|
|
|
![]() |



Twitter
del.icio.us
StumbleUpon
Google