scBorer & amazing adventure in Ores

These are old bug reports that have been closed.
Locked
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1533
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska
Contact:

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.
Last edited by shanejfilomena on Sat Dec 10, 2011 9:21 am, edited 6 times in total.
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

Your method doesn't match actual ores available. Since the purpose is aesthetic this is unhelpful.
Literally is the new Figuratively
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

shane, can you please describe some details about when you were getting this error?
Get your own Galactic Omni Device
Get it now. It's free!!
Image
Drako Slyith
Fleet Officer
Fleet Officer
Posts: 1036
Joined: Wed Feb 03, 2010 4:28 am
Location: Researching how to make St. Kats star go supernova.
Contact:

I've been getting the same error. I've gotten it before and after the save file is loaded, sometimes both.
Image
Image
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

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 :)
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1533
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska
Contact:

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.
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

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.
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1533
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska
Contact:

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
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
User avatar
Star Weaver
Militia Commander
Militia Commander
Posts: 311
Joined: Sun Nov 07, 2010 10:20 pm
Location: . . . between the stars and the warm black sky . . .

Fixed in 1.08 per george's ticket, close this thread.
Image
Image
Image
Locked