Jump to content

How to define a player state? [Solved]


AGamer
 Share

Recommended Posts

I was adding my first faction to the game when I came across a process that I am unfamiliar with. An error stating: "g_CivData[playerState.civ] is undefined" : I do not understand how to "define" a "playerState". Anyone think that they can help me out?

 

Edit: I added a pic of all of the errors I am getting just to give extra details...

Error help.png

Edited by AGamer
Link to comment
Share on other sites

  • AGamer changed the title to How to define a player state?

There seems to be a bunch of errors before this one. These are about missing templates. Probably not too relevant, but doesn't harm fixing.

I suspect you did add the `simulation/data/civs/Adrestia.json` file? What is the value of `Code` you put in?

What is the value of `g_Players[g_ViewedPlayer].civ`? You can get that by adding a `warn(uneval(g_Players[g_ViewedPlayer].civ))' just prior to the codeline the error comes from.

Also there might be more errors too (which don't seem to fit in the screen). No worries: you can find all errors in the logs (see https://trac.wildfiregames.com/wiki/GameDataPaths where to find them).

Link to comment
Share on other sites

image.png.2710fe6588defcb96481f8fa34953296.png

Thank you so much for your response! I put the code as Adrestian and am using it as the "<civ></civ>" value for all of the unit/structure templates. (I have not created some of the templates and that is why I assume those Template errors are occurring.) On top of that, the UI is bugged and I am going down the list of errors until I fix the one causing it...

 image.thumb.png.27e83f0161a816754bc37ce23df29238.png

It also won't show the emblem I made but I suspect that once the error causing the UI to have issues has been fixed, the emblem will work as well.

 

PS: I will include the Adrestia.json here:Adrestia.json

 

Link to comment
Share on other sites

I just figured out what that error meant...

It was because I did not specify the music in the Adrestia.json...

image.png.88f9b5a3ea47a1903feb656536fe98c2.png

That's embarrassing...

 

I do have plenty of other issues though like the UI problem that I mentioned and the fact that when I select a unit, it throws a whole bunch of errors and will not show that unit's hud... 

Link to comment
Share on other sites

  • AGamer changed the title to How to define a player state? [Solved]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...