• Fantastic news Terrarians! All platforms have officially been submitted! Barring any issues our tentative release date is September 28th!

tAPI Need help plz

ZanderMeister

Skeletron Prime
How can I check for generating Crimson/Corruption and choose, what ore I need to generate?
4 example, if I have a Crimson in my world, ore 1 will be generated, but if I have a Corruption, will be generated ore 2.

help plz
 

Shika

Empress of Light
During world generation, if it says "Making world evil..." that's Corruption. Similarly, "Making world bloody..." means you'll have a Crimson world. There is no way to check for the presence of other alternate ores aside from finding them (or not) or by using an external world editor, such as tEdit.
 

Drok

Spazmatism
How can I check for generating Crimson/Corruption and choose, what ore I need to generate?
4 example, if I have a Crimson in my world, ore 1 will be generated, but if I have a Corruption, will be generated ore 2.

help plz
If i understand this correctly the ores don't have any relation to the Corruption you have but to the seed which is generated randomly at world creation.
[DOUBLEPOST=1416843494][/DOUBLEPOST]
During world generation, if it says "Making world evil..." that's Corruption. Similarly, "Making world bloody..." means you'll have a Crimson world. There is no way to check for the presence of other alternate ores aside from finding them (or not) or by using an external world editor, such as tEdit.
Ah ninja'd
 

Shockah

Grandson of The Wizard
The thread is tagged with [tAPI], so I guess the OP needs the code-wise way.
I hope you already know how WorldGenTasks work. If you do, you can check the WorldGen.corruption and WorldGen.crimson fields. If they're true, the biome will be / was generated (depending on the task order, it might have not generated yet).
 
Last edited:

ZanderMeister

Skeletron Prime
The thread is tagged with [tAPI], so I guess the OP needs the code-wise way.
I hope you already know how WorldGenTasks work. If you do, you can check the WorldGen.corruption and WorldGen.crimson fields. If they're the true, the biome will be / was generated (depending on the task order, it might have not generated yet).
Thanks man, will try this!

UPD: When I try to generate a world, it crashing with this message:
System.NullReferenceException: Object reference not set to an instance of an object.
at TAPI.TileDef.GetCodeHandler(System.Int32 type)
at TAPI.TileDef.GetCodeHandler(System.Int32 x, System.Int32 y, System.Boolean wallCode = False)
at Terraria.WorldGen.KillTile(System.Int32 i, System.Int32 j, System.Boolean fail = False, System.Boolean effectOnly = False, System.Boolean noItem = False)
at Terraria.WorldGen.JungleRunner(System.Int32 i, System.Int32 j)
at Terraria.WorldGen+<>c__DisplayClass8c.<generateWorld>b__d()
at TAPI.WorldGenTask+Action.Generate()
at Terraria.WorldGen.generateWorld(System.Int32 seed = -1)
at Terraria.WorldGen.worldGenCallBack(System.Object threadContext)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object state)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
I think, that its not because of my mod, but there's something with jungle gen

UPD2: OH MY ITS WORKS THANKS BIIIIG THANKS
 
Last edited:
Top Bottom