Welcome to
Mod The Sims
Online: 2573
News:
Have an account? Sign in:
pass:
If you don't have an account, why not sign up now? It's free!
Other sites: SimsWiki
Reply  Replies: 37 (Who?), Viewed: 2786 times.
Search this Thread
Old 26th Mar 2013, 03:07 AM DefaultProblem: The game won't load my scripting mod? #1
DeeDawg
Original Poster

Test Subject

Join Date: Oct 2010
Posts: 39


To be clear, my game is properly set up to support mods, as I've got several mods running already like Grim's Medieval Core.

So I've been playing a bit around with scripting for the Sims Medieval, following the wise guides from here and SimsWiki. I've started out with a simple and basic mod, that implements Buzzler's Pausinator mod and pauses the game through an interaction. With Grim's help, I got past my initial problems with Visual Studio complaining about crap not existing, as he led my attention to the thread by Rick where I've downloaded his .NET profile and compiled my library against it. I also created a quick console application to strip the compiled library of the TargetframeworkAttribute, as I read that it would cause a game crash.

So far so good.

Now as far as I understand, if there was a problem with the code it would cause a game crash. As my game doesn't crash when I try to play with my own mod installed, I assume the game never loads my package. I just don't know why?

Yet I'm sure it's just me being retarded, and don't be afraid to point that out.

Any help would be much appreciated.
Download - please read all instructions before downloading any files!
File Type: zip DeeDawgModsPausinator.zip (3.9 KB, 5 downloads) - View custom content
Description: Package and source file
Last edited by DeeDawg : 28th Mar 2013 at 09:13 PM.
Old 26th Mar 2013, 04:22 AM #2
grimreefer24601
Instructor

Join Date: Aug 2009
Posts: 564
Thanks: 954 in 1 Posts
4 Achievements


First thing I see with your DLL is that it ImageRuntimeVersion: v2.0.50727. To work with TSM is should be ImageRuntimeVersion: v4.0.30319. Basically, you still haven't gotten your compilier set to Dot Net 4. Which are you trying with 2010 or 2012? I've only used 2010, but give me a minute.
Old 26th Mar 2013, 04:27 AM #3
grimreefer24601
Instructor

Join Date: Aug 2009
Posts: 564
Thanks: 954 in 1 Posts
4 Achievements


Yep, Looked again, your code should work, you've just not got the right compile yet. This looks like a straight TS3 compile to me have you given the right file?
Old 26th Mar 2013, 05:02 AM #4
grimreefer24601
Instructor

Join Date: Aug 2009
Posts: 564
Thanks: 954 in 1 Posts
4 Achievements


Alright, even compiled correctly your code breaks the game. Need to look at it more, for this instance, but the main problem is not a correct compile. You would not make any compile for TSM work this way, but this dll has more issues. The other issues probably lie in the TS3 to TSM translation. However, it needs to be v4.0.30319 or TSM will not load it.
Old 26th Mar 2013, 07:24 AM #5
DeeDawg
Original Poster

Test Subject

Join Date: Oct 2010
Posts: 39


Quote:
Originally Posted by grimreefer24601
Alright, even compiled correctly your code breaks the game. Need to look at it more, for this instance, but the main problem is not a correct compile. You would not make any compile for TSM work this way, but this dll has more issues. The other issues probably lie in the TS3 to TSM translation. However, it needs to be v4.0.30319 or TSM will not load it.
Of course.
Unfortunately I've got to get to work right now, but I'll look into it when I get home. Thanks, Grim.
Old 27th Mar 2013, 08:01 PM #6
DeeDawg
Original Poster

Test Subject

Join Date: Oct 2010
Posts: 39


It would seem that the problem lies with Rick's modified mscorlib.dll. While S3PE displays the CLR Runtime version as v4, Reflector displays it as v2. That alone made me suspicious, so I modified my project to reference the mscorlib.dll of the game, and supplied the TargetFrameworkAttribute class myself to shut up Visual Studio.

Now it compiles fine, and targets the right runtime. I'm far from an expert on this matter, but I guess VS2012 read the same thing Reflector did and therefore it was apparently incapable of targeting the right runtime even though the targeted framework was indeed v4.

Quote:
Originally Posted by grimreefer24601
Alright, even compiled correctly your code breaks the game.
What do you mean exactly by "breaks the game"? I packaged the newly compiled library, changing none of the code, but the game didn't crash? Does that mean that the game still won't load my mod?
Download - please read all instructions before downloading any files!
File Type: zip DeeDawgModsPausinator.zip (3.4 KB, 3 downloads) - View custom content
Description: Package
Old 27th Mar 2013, 10:27 PM #7
grimreefer24601
Instructor

Join Date: Aug 2009
Posts: 564
Thanks: 954 in 1 Posts
4 Achievements


Breaks my game means I get a 90% load then stall, first screen. That's with my compile that works with all my other code. I haven't looked more into it yet. That's a good TSM compile. I might have messed something up, but the code I've seen doesn't work for my game.
Old 28th Mar 2013, 12:58 AM #8
DeeDawg
Original Poster

Test Subject

Join Date: Oct 2010
Posts: 39


Ah, ok. My game boots fine, but I did notice it lagging more than usual, but I haven't got a clue whether or not it was related to the mod.
Old 28th Mar 2013, 03:09 PM #9
Daeva65
Test Subject

Join Date: Mar 2013
Posts: 1


I'm having the same problem with a single specific package file not loading. I had trouble getting the unlocker mods to unlock everything.
I downloaded S3PE and modded Shimrod's Easy Achievement mod to change all achievements to require 5 poems recited. However, the game refuses to load the changed mod, but accepts Shimrod's original version without problems.

What do I do to get the game to load the file?
Old 28th Mar 2013, 09:10 PM #10
DeeDawg
Original Poster

Test Subject

Join Date: Oct 2010
Posts: 39


Quote:
Originally Posted by Daeva65
I'm having the same problem with a single specific package file not loading. I had trouble getting the unlocker mods to unlock everything.
I downloaded S3PE and modded Shimrod's Easy Achievement mod to change all achievements to require 5 poems recited. However, the game refuses to load the changed mod, but accepts Shimrod's original version without problems.

What do I do to get the game to load the file?
Perhaps, you should create your own thread instead of hijacking this one, as it's not really the same problem. You're creating a XML tuning mod, while I'm trying to get the game to recognize my scripting mod and get the mod working.
Old 30th Mar 2013, 12:33 AM #11
grimreefer24601
Instructor

Join Date: Aug 2009
Posts: 564
Thanks: 954 in 1 Posts
4 Achievements


People are mistaking what you're asking. It doesn't serve you to be rude however. It doesn't help anyone for you to criticize without any offer of where they should look. I'm trying to figure out something for you, qand I suggested you to make a thread, but not to dis people for asking questions. So that other people who have your problem may one day find it on Google. We at TSM will asnswer antthing we can, to anybody. I don't mind his extra question. You shouldn't either. Trust me if you want only script modders to reply we should have kept this as a PM. Otherwise, if you're following what I suggested, this is a thread for everyone. I get how you may be frustrated by someone asking a completely different question on this thread, but that's what happens.

As is DeeDawg, I haven't been able to mess with this since last weekend. So nothing now. I don't know there are many script modders left here on TSM, so I'm the one who will answer you. I don't have an answer yet. I asked you to ask these questions here, so when someone Google's it they don't end up with nothing like you have. We could work this out in PM, but no future modders will get any benefit from it.

We need to expect, and be courteous to more mainsteam questions. You see how Advanced Modding has become a forgotten thread even though it has the best information. So yes his question is out of place, but on TSM it may get your question viewed. (It does bump it)

@Daeva65: If the game doesn't load your xml there is either an error in the xml or a conflict with another file. Sounds like an error. If TSM is unable to read a file correctly it disrergards the file. Never gets loaded. No crash, just doesn't work.
Old 30th Mar 2013, 12:43 AM #12
ChickieTeeta
Inventor

Join Date: Nov 2004
Posts: 929


XML's do weird things to the game if you convert it to xml and then forget to convert it back to dttb again. I've done this a few times, and the problem can be different depending which xml it's been.

DeeDawg, I get the impression Daeva didn't realize there was a huge difference between the 2 types of mod or the 2 problems.

KHaveYourScriptingThreadBackBye lol

What do you mean, 'get a life'! I'm a gamer, I have many lives.
Old 30th Mar 2013, 03:26 AM #13
grimreefer24601
Instructor

Join Date: Aug 2009
Posts: 564
Thanks: 954 in 1 Posts
4 Achievements


Ok Chickie, thanks for the sarcasm.

Like I'm not sarcastic enough for the both of us.

DeeDawg and I are discussing script mods. We have been in a few PMs, but I told him to post public so other could benefit. As a script modder I find very few threads to help me figure stuff out.

I asked him to make this public, so we could help other people learn.

Please, let's keep it to script modding here. There's not really any other script mod threads here.

We need some script modding threads. You couldn't imagine how much this would have helped me back in the day.

I'm not gonna go thread Nazi on anyone, but this topic is "Script Mods", so if others ask different questions, please direct them to an appropriate thread.

Truely, I'm trying to be diplomatic, but unless you're making script mods, this is not a thread for you. We will be discussing things you no have control over.

Chickie, I love you, but unless you're compiling scripts, you don't belong here. (I hate to say this because script mods cover all game parts, but XML is a need to use thing in this thread)

Really, this thread is for DeeDawg and I, and any other future script modders.

I will only talk code here, I have enough speaking about other thing in other threads. If you mention other topics I'll try to direct you to another thread.

Yes I know it will only be DeeDawg and I, but someonelse out there is looking for exactly what he and I are discussing.
Old 30th Mar 2013, 03:34 AM #14
grimreefer24601
Instructor

Join Date: Aug 2009
Posts: 564
Thanks: 954 in 1 Posts
4 Achievements


Rant over, I want you, Chickie, and other to add to the thread, but we need your info on what you've found in XMLs. Our code works with you XMLs. DeeDawg and I are trying to make it so I'm not the only script modder for TSM. I have alsways worked with the TSM XML modders wheteher they knew they were helping me or not.

I'm not trying to discourage any comments, I'm trying to instruct people to give helpful comments.

But, this is a "Scripting Tread". When you Google TSM Script Mods, I want this thread. There's no other place, and I'd love to teach other scripters. So, if you ask other questions here, please to all responders, post a link to an appropriate thread.
Old 30th Mar 2013, 04:33 AM #15
ChickieTeeta
Inventor

Join Date: Nov 2004
Posts: 929


It wasn't intended as sarcasm, it was me agreeing that a scripting thread should remain a scripting thread since it's pretty much the only one we have, and the end line was my attempt at apologizing in a humorous way for stepping into it.
The reason I hadn't replied to Daeva before then was because I agree the thread should stay unique from all the others, but I saw little harm in responding briefly when you mentioned it yourself in the post above mine.

*EDIT*
Quote:
Originally Posted by Grimreefer24601
You last line was what I was refering to as sarcasm. Your humourous apology. That's sarcasm, is it not?

I know what you were referencing, but like I already said it wasn't sarcasm, and wasn't intended as such, it's how you read it, but I don't speak with your voice.
To cover up my embarrassment at stepping into a thread that had nothing to do with the question posed in it I strung all the words together like I'm saying, very quickly, goodbye.
Not sarcasm, but leaving quickly in an apologetic and highly embarrassed way because I knew I shouldn't have been there (that's my voice btw).
Like popping one's head round the door to a room, and then very quickly saying sorrybye, what you did was haul me right into that room and reprimand me in front of everyone............So being here has been so much less embarrassing now, thank you ....and that's sarcasm.

If Deedawg saw it as sarcasm then I apologize.....(<=== not sarcastic) (although pointing out that it's not sarcastic is sarcastic, Not to Deedawg though, and my apology to Deedawg is sincere.)
I'm leaving again now, I won't say goodbye this time so as to avoid any confusion....(<=== sarcasm)
(sarcasm is so much more than removing the spaces between words, don't you think...it's actually using words. So now you've seen me actually be sarcastic you should hopefully recognize it in future)

What do you mean, 'get a life'! I'm a gamer, I have many lives.
Last edited by ChickieTeeta : 30th Mar 2013 at 05:31 PM.
Old 30th Mar 2013, 08:13 AM #16
grimreefer24601
Instructor

Join Date: Aug 2009
Posts: 564
Thanks: 954 in 1 Posts
4 Achievements


First off this thread is based off of using Advanced Modding You last line was what I was refering to as sarcasm. Your humourous apology. That's sarcasm, is it not?

Anyway I love having you respond. And you may have answred Daeva65 (You sure its not Daema, as in Great Hemp) question.

I'm sorry if I layed it on too hard Chickie. You know why this thread is important to me and to the OP. I want to keep this thread clean of "all" the other answers that can be found elswhere.

As far as I know, I'm the only core modder. But I think I the only script modder left here a TSM.

This thread will hopefully help other script modders learn how this game works.

That all said, give me a chance to look at the problem this weeked.
Old 30th Mar 2013, 12:51 PM #17
DeeDawg
Original Poster

Test Subject

Join Date: Oct 2010
Posts: 39


Actually, I wasn't trying to be rude or mean to Daeva65. I know he/she thought it was the same problem, but as that's not really the case here, I suggested that he/she should create his/her own thread to get the proper help he/she needs. I've done alot of XML tuning myself, especially modifying Shimrod's mods to my liking, so I would love to help him/her out wherever I can. I'm sorry if it came out looking like something else. Right after writing that answer to him/her, I also changed the title of the thread to avoid any future confusions.

I really appreciate the time you've spent helping me out, Grim. I really do. And I'm not the impatient type, so don't worry - well, not that you should if I was. Anyway thanks.

edit:
Reading my answer now, I see why you thought I was a little harsh on Daeva65. As said, that wasn't my intention at all, but I am a bit too "direct" (so to speak) sometimes.
Last edited by DeeDawg : 30th Mar 2013 at 04:45 PM.
Old 31st Mar 2013, 06:52 AM #18
grimreefer24601
Instructor

Join Date: Aug 2009
Posts: 564
Thanks: 954 in 1 Posts
4 Achievements


"removing the spaces between words" if that's what you think I meant, I guess you don't even understand what I thought. As an XML modder I assumed you understood the naming conventions on tunable variables.

I took it as:
kHaveYourScriptingThreadBackBye (notice I changed the caps on the k).

Like:
kInstantiator,
kMinimumRadialDistanceFromSim,
kMinTimeSinceLastVisitForActiveLot,
kNumPlayerNeighborHouseholds,
kSimRadius,
etc....

So, I see you weren't being sarcastic. Hopefully this helps you understand why I thought you were.
Old 31st Mar 2013, 02:00 PM #19
ChickieTeeta
Inventor

Join Date: Nov 2004
Posts: 929


But there isn't a value that can be added to kHaveYourScriptingThreadBackBye :P
(Reading it that way shouldn't have shown sarcasm anyway just outright humor.)
You shut up and I'll shut up (((hugs)))

Deedawg, just make a new thread, it's really lovely to see new people on the forum and especially people who are interested in modding the game, and I agree there's a need for a thread that is solely about scripting and nothing else. The only other one I recall on the forum is nearly 2 years old and long abandoned.
Hope you can get your mod to work.

What do you mean, 'get a life'! I'm a gamer, I have many lives.
Last edited by ChickieTeeta : 31st Mar 2013 at 02:46 PM.
Old 31st Mar 2013, 03:02 PM #20
DeeDawg
Original Poster

Test Subject

Join Date: Oct 2010
Posts: 39


I don't see a reason why we should create a new thread, even though I know it's been "contaminated" with all this unrelated flirting back and forth.
As you said, EVERYONE SHUT UP NOW unless it's related and on-topic. We might need another general scripting thread, I don't know, but to create another thread about my problem in question is not needed. Not for me anyways.

And Chickie, don't answer.
Old 31st Mar 2013, 06:25 PM #21
grimreefer24601
Instructor

Join Date: Aug 2009
Posts: 564
Thanks: 954 in 1 Posts
4 Achievements


On topic DeeDawg, It seems I've completely broken my game, and I'll have to reinstall. However, the problem still seems to lie in your compile. Your DLL still has the TargetFrameworkAttribute, sorry I missed that and have been trying other things. TSM wont work with that. You need to strip that by adding this to your project

<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetCompactFramework>true</TargetCompactFramework>
<TargetingClr2Framework>true</TargetingClr2Framework>

Open your project in notepad and add this to your property group. I'll mess with it more when I've reinstalled, but I have a feeling this is the issue.

Edit: I guess you said you added it, but it shouldn't be there at all. Maybe it's VS 2012 that giving you problems. I use 2010, but really it shouldn't matter.
Last edited by grimreefer24601 : 31st Mar 2013 at 06:42 PM.
Old 1st Apr 2013, 03:37 AM #22
DeeDawg
Original Poster

Test Subject

Join Date: Oct 2010
Posts: 39


Hm, as said in #1 I created a quick console application to strip the assembly of the TargetFrameworkAttribute, as I had already tried adding the configuration options you mention without luck.
As far as I can tell, the application did it's job, but maybe not. However, adding those options now works fine for whatever reason.

I've changed a bit of the code. First, I've moved the GoPause type out of the Instantiator type, to avoid any potential problems with the interaction being literally sealed inside the parent. Secondly, I've stolen your SimInit type as it adds a bit more structure to the code.

My game still boots fine without crashing or stalling, and it's not because it's working unfortunately. I take it the game is still refusing to load my mod?
I tried creating a new project from scratch in VS2010 and of course just copy/pasting the code and compile, but no luck there either. I've attached the package as well as the project folder (2010), if you want to take a look around for yourself.
Download - please read all instructions before downloading any files!
File Type: zip DeeDawgModsPausinator.zip (29.4 KB, 2 downloads) - View custom content
Description: Package and project folder
Old 1st Apr 2013, 09:34 PM #23
grimreefer24601
Instructor

Join Date: Aug 2009
Posts: 564
Thanks: 954 in 1 Posts
4 Achievements


Alright, I finally got it. Been so long since I made a totally new script I'd forgotten that S3PE makes it's S3SAs a little different so you have to change a flag. Click on your DLL in S3PE and click the grid button at the botton. Change Unknown2 to 0xE3E5B716. Click commit, save, and your package should work like a charm.

Also, just FYI, you don't need the tuning xml to get TSM to load your mod. Just a tunable variable in the script.
Last edited by grimreefer24601 : 1st Apr 2013 at 09:49 PM.
Old 2nd Apr 2013, 03:08 AM #24
DeeDawg
Original Poster

Test Subject

Join Date: Oct 2010
Posts: 39


Oh my god, YES! Thanks, Grim! :D
We made it.





Would you mind that I create the new general scripting thread we talked about, and perhaps start it out with a basic tutorial on how to create scripting mods for TSM? I'd say it's heavily needed for beginners like myself.
If you want to do this yourself, I've got no problem with that, I just want it there to help others.
Old 2nd Apr 2013, 09:17 AM #25
ChickieTeeta
Inventor

Join Date: Nov 2004
Posts: 929


Well done =D Really happy for you that you got it working.
I'd like to see that thread you mentioned.

Since this thread is complete now, I'd like to ask something....it is on topic :P

The way I understand it from your first post....the purpose of this is to pause the whole game by clicking on a sim?
Is it possible that this could be made so it pauses just the sim that's clicked on in the position they're currently in?
I asked over a year ago if something similar to pose player could be made for TSM, but being able to pause, individually, any sims you wanted and move them in buy mode would be excellent, and a great substitute for pose player.
Also un-pausing them too would be great lol.
I tried the stop function a couple of months ago, but that seems to stand sims up straight and 'stick' them there forever (I never tried reset on any of them though) I was hoping when I tried it that it was going to stop them in the process of doing whatever they were doing.

What do you mean, 'get a life'! I'm a gamer, I have many lives.
Reply


Section jump:


Powered by MariaDB Some icons by http://dryicons.com.