Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

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.

    BluePear
  • subtledoctorsubtledoctor Member Posts: 11,460
    BluePear said:

    I am making a rework of the Identify spell,

    Ha! That spell is super duper hard-coded. Gave me tons of trouble. Doesn't work as an innate or priest spell, doesn't work as a clone of itself with a new RES, doesn't work at any level except 1st... extremely annoyingly limited in its moddability.

    I ended up making a completely different spell, ADD_SPELLing the new one to make it available at CharGen, keeping the old one in place but adding it to hidespl.2da, and then changing all Identify scrolls to let you learn the new one instead of the old one.

    Very interested to hear what your plan for it is.

  • kjeronkjeron Member Posts: 2,130
    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.