Skip to content

Can you remove spells from the spell selection screen at character creation?

BluePearBluePear Member Posts: 13
I am making a rework of the Identify spell, but because of engine limitations I have to make a new Identify spell instead of just altering SPWI110.spl. How do I remove SPWI110 from the spell selection at character creation, so I don't have two Identify spells showing up. Overwriting SPWI110.spl with an empty file works, but then the game crashes when you click the identify button of an item.

Comments

  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    There is a file named hidespl.2da Set the IS_HIDDEN column to 1 for SPWI110, if you want the spell excluded from spell selection.
  • The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,368
    I've had some success expanding it through the UI. So far it appears to be functional.

    If you would like to try it manually:
    Add this function, either in UI.MENU or a separate M_*.LUA file, replacing SPWI215 with any spellres you want, it just needs to be a wizard spell(for now):
    	function	identifyCustom(num)
    		for	spellLevel = 1, 9, 1 do
    			for k,v in pairs(characters[id].mageSpells[spellLevel]) do
    				if v.resref == 'SPWI215' then
    					if v.castableCount > 0 then
    						if num == 1 then
    							setMageBookLevel(spellLevel)
    							for	i = 1, 1 + v.memorizedCount - v.castableCount,1 do
    								mageScreen:UnmemorizeSpell( spellLevel - 1, v.memorizedIndex - 1 );
    							end
    							for	i = 1, 1 + v.memorizedCount - v.castableCount,1 do
    								mageScreen:MemorizeSpell( spellLevel - 1, v.index );
    							end
    							return
    						else
    							return true
    						end
    					end
    				end
    			end
    		end
    		return false
    	end

    Find and modify this fuction (UI.MENU, Search ~showItemDescriptionInventory~):
    function showItemDescriptionInventory(slotName)
    	if(characters[id].equipment[slotName].empty ~= 0) then
    		return
    	end
    	selectedSlot = slotName
    			e:GetActiveEngine():OnLeftPanelButtonClick(5)	--	Add this line
    			e:GetActiveEngine():OnLeftPanelButtonClick(3)	--	Add this line
    	Infinity_CheckItemIdentify(characters[id].equipment[slotName].id)
    	showItemDescription(characters[id].equipment[slotName].item, 0)
    end

    Find and modify this button (UI.MENU, Search ~Infinity_GetSpellIdentifyEnabled~):
    	button
    	{
    		area 440 170 200 44
    		bam GUIBUTNT
    		text style "button"
    		text "SPELL_BUTTON"
    		--	clickable lua "Infinity_GetSpellIdentifyEnabled(characters[id].equipment[selectedSlot].id)" Comment out this line (--).
    		clickable lua "identifyCustom(0)" -- Add this line
    		action 
    		"
    			Infinity_OnSpellIdentify(characters[id].equipment[selectedSlot].id); 
    			identifyCustom(1); -- Add this line
    			Infinity_PopMenu()
    			itemDesc.item = characters[id].equipment[selectedSlot].item --update itemDesc item
    		"
    	}

    It will still expend an instance of SPWI110 with each use. There probably isn't any way around this (at least none that wouldn't interfere with the scroll version), but it should be possible to prioritize using SPWI110 first, before checking/expending other possible identification spells.
Sign In or Register to comment.