Jump to content

Help understanding log, please ?


Recommended Posts

First, hi everyone !

 

So, I am really really new to modding and scripting. That's why I first looked into a lot of lua files from the game and from people mods, read some stuff about the lua language, lots of post and tutorials on this forum before begining with something VERY simple.

 

So yeah, to understand a bit how it works with simple stuff I decided to do something which would make spawn special rocks that loot carrots when you mine it (yup, that's stupid and useless but I just had to make some color swap of the rocks and could get a loooot of inspiration from the Gentleman's Mod which adds tungsten to the game). So I began with the awesome mod samples you guys gracely made and made my thing thanks to the Gentleman's mod modele (didn't want to dumbly copypaste it so I really wrote it by myself to understand step by step how it works, and I think I mainly got how it works), had some problem with XML files but fixed it and I now have some screen error after the world generation. So I was not surprised, didn't expect it would work so easely. So I checked the lines mentionned in the error screen hoping it would just point to my problem(s) but I really see no problem with those lines u.u

 

I didn't want to post a noob question here yet so I decided to take the gentleman's mod which I know was working and change it to what I wanted in order to then compare it with the version I wrote and find what was wrong with mine. So I got rid of the additive stuff only to keep the prefab that defines the new kind of minable rock and all that is related to it (anim, world gen script, stuff in modmain and modinfo and so on) then I changed the images and I now have a working version of what I wanted to do, orange rocks that loot carrots.

But I'm not satisfied because it's juste copypasted and then replaced/renamed things, and also because I just don't understand. There's just no difference between my first not working version and the second, I've been reading my scripts again and again to search for difference with the working ones, but found nothing.

 

So now I'm back to trying to figure out with the error screen and the log what is wrong with my mod and I am asking you help only for this (I mean, I don't want you to look into my lua files and other stuff and fix them yet, I'm not that desperate, I just hope that if someone could explain me one line of the log I could fixe it by myself haha ^^" I mean only if it is possible for you to explain it to me without looking at all the rest)

Here it is, when I look in the log I got these line repeating again and again after the "SCRIPT ERROR ! Showing error screen" :

 

"SpawnSaveRecord [nil, carrock] FAILED"

 

So what is that SpawnSaveRecord function (is it kinf of a function ?) ? How does it work ? What is it for ? What is the nil value refering to ? ("carrock" is the name of my prefab and basically everything else, the zip file, the tex file for the minimap icon, but I suppose it refers to the lua file right ?)

 

So I hope it wasn't to long to read and my question is not to stupid, I just would like to understand what I am doing before going further in all that modding things and I also would really like to understand why it doesn't work ^^"

 

Thank you for reading, hope someone would have the answers ^^

Link to comment
Share on other sites

@DragonDePlatino : Wait . . . isn't this place the International Lumberjack Community Forum ? Damn it ! *shakes her axe in a disappointed/frustrated way* I was wearing my canadian woodsman shirt for the occasion . . .

 

Concerning my problem . . . I feel really dumb because I actually just inverted a point and a double point when I added a component and absolutly didn't notice it the 4 first times I re-read my script so yeah :

 

Wrong code :

inst.AddComponent("lootdropper")

Right code :

inst:AddComponent("lootdropper")

I now understand that the game just failed to spawn my prefab because it wasn't correct because of my stupid point (sneaky one è^é) So I understand it would've been quite difficult to help me considering my request and the lack of informations in my post (in spite of its length ^^"). Next time I'll need help, I promise to be really careful about considering all the solutions before begging to you all without giving you a clue to help me haha ! xD I will learn from this experience !

So to other beginners like me : beware from the sneaky points ! bouhouhou *spookily waves her arms*

 

All have a nice day !

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...