Page 1 of 1

scBorer & amazing adventure in Ores

Posted: Fri Dec 09, 2011 9:20 pm
by shanejfilomena

Code: Select all

Loaded game file version: 1000701
12/09/2011 00:50:02	OnCreate [Borer II-class gunship]: Unknown item type [Nil] ### (itmCreate (sysGetRandomOreType) 1) ###
12/09/2011 00:50:07	Created new game
this is caused by the code :

Code: Select all

<Events>
			<OnCreate>
				(block (baseOre maxLootValue)
					; There is a chance that we have some small amount of ore
					
					(setq maxLootValue (random 50 200))
					(switch
						; 50% chance of fuel rods instead of ore.
						(leq (random 1 100) 50)
							(objAddItem gSource (itmCreate &itHelium3FuelRod; (random 1 6)))
							
						; If we have a base and it has ore then we have some of
						; that in our cargo.
						(and aBaseObj (setq baseOre (random (objGetItems aBaseObj "t +Ore"))))
							(objAddItemByValue gSource baseOre maxLootValue 'credit)

						; Otherwise we ore appropriate to the system
						(objAddItemByValue gSource (itmCreate (sysGetRandomOreType) 1) maxLootValue 'credit)
						)
					)
			</OnCreate>
		</Events>
I have used

Code: Select all

<Items>
             <Table>
				<Lookup chance="40" count="1" table="&tbFrostAsteroidOre;"/>
				<Lookup chance="30" count="1" table="&tbMetallicAsteroidOre;"/>
				<Lookup chance="20" count="1" table="&tbStoneAsteroidOre;"/>
				<Lookup chance="10" count="1" table="&tbVolcanicAsteroidOre;"/>
			</Table>
			
			<Item count="1d6" item="&itHelium3FuelRod;"/>
		</Items>
and found it works fine........no errors.
EDIT*****

since I am not helpful You can just delete this and Rock On.

Re: scBorer & amazing adventure in Ores

Posted: Fri Dec 09, 2011 9:52 pm
by Atarlost
Your method doesn't match actual ores available. Since the purpose is aesthetic this is unhelpful.

Re: scBorer & amazing adventure in Ores

Posted: Sat Dec 10, 2011 2:45 am
by alterecco
shane, can you please describe some details about when you were getting this error?

Re: scBorer & amazing adventure in Ores

Posted: Sat Dec 10, 2011 4:12 am
by Drako Slyith
I've been getting the same error. I've gotten it before and after the save file is loaded, sometimes both.

Re: scBorer & amazing adventure in Ores

Posted: Sat Dec 10, 2011 6:23 pm
by sdw195
shanejfilomena wrote:
EDIT*****

since I am not helpful You can just delete this and Rock On.
no pun intended right? i will leave it open a few days in case anyone else comments on it :)

Re: scBorer & amazing adventure in Ores

Posted: Sun Dec 11, 2011 5:51 am
by shanejfilomena
sdw195 wrote:
shanejfilomena wrote:
EDIT*****

since I am not helpful You can just delete this and Rock On.
no pun intended right? i will leave it open a few days in case anyone else comments on it :)
I was trying to be clever: but I obviously failed:) :
TRUE I do not have an alternative complicated code to draw a particular ore into the ship on destroy: your Awesome Minds are " into" code : I can barely HTML my way out of a webpage.....
My tactic is using the old and tested method of letting the hard work done on the ore frequency tables do the work for the ship.
(( killed several ships in testing: no errors.....added stuff, no errors........so it is working. ))

**EDIT: I THINK I understand Now : I had to Nerf the Ore frequency tables for 1.07a in relation to what I am working on, it was putting far too much ore on the ship : not the Borer, I have yet to find them going nuts, but another ship that uses the same table.

I had to cut the amount of Ores available "in a single shot" so they are realistically carried by the ships as well as the player.

Re: scBorer & amazing adventure in Ores

Posted: Mon Dec 12, 2011 4:56 pm
by george moromisato
The error in the log file is (I'm pretty sure) a bug in vanilla. It is probably because the call to sysGetRandomOreType does not properly check for Nil. For example, if there are no asteroids with ore in the system, sysGetRandomOreType returns Nil.

I've fixed a bug for it: http://wiki.neurohack.com/transcendence/trac/ticket/719

Thank you!

p.s.: It is true that having a fixed table for ore is cleaner and more robust, but I wanted to have something more dynamic. sysGetRandomOreType looks through every asteroid with ore in the system and generates a probability table proportional to the amount of ore that it found.

Re: scBorer & amazing adventure in Ores

Posted: Thu Jan 05, 2012 6:42 am
by shanejfilomena
george moromisato wrote:The error in the log file is (I'm pretty sure) a bug in vanilla. It is probably because the call to sysGetRandomOreType does not properly check for Nil. For example, if there are no asteroids with ore in the system, sysGetRandomOreType returns Nil.

I've fixed a bug for it: http://wiki.neurohack.com/transcendence/trac/ticket/719

Thank you!

p.s.: It is true that having a fixed table for ore is cleaner and more robust, but I wanted to have something more dynamic. sysGetRandomOreType looks through every asteroid with ore in the system and generates a probability table proportional to the amount of ore that it found.
THANK YOU! ( vindication at last :) ) LOL

Re: scBorer & amazing adventure in Ores

Posted: Fri Jun 08, 2012 7:00 am
by Star Weaver
Fixed in 1.08 per george's ticket, close this thread.