User talk:MaXiMiUS

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Oblivion Discussion[edit source]

Please place new topics under their own header.

Scripted Travel Packages on Buying/Selling Merchants[edit source]

LRcrTravellerService is a "offer services" package, and setting Once to 6 will make the NPC return to their travelling packages. This doesn't work as intended, as adding LRcrTravellerService is supposed to make the NPC offer to buy/sell/etc, but it does not.

This is the code I have thus far:

	if GetIsClass Scout
		if Timer3 < 10 && GetDistance player < 192
			AddScriptPackage LRcrTravellerService
			EVP LRcrTravellerService
			Set Timer3 to Timer3 + GetSecondsPassed
		elseif Timer3 < 15 && GetDistance player < 192
			RemoveScriptPackage LRcrTravellerService
			Set Once to 6
			Set Timer3 to 20
		elseif Timer3 == 20 && GetDistance player > 192
			Set Timer3 to 0
		endif
	endif

--MaXiMiUS 19:13, 22 June 2006 (EDT)

For every frame for the first 10 seconds that the actor is within 192 units from the player the package is added and EVP takes place. I would insert a doOnce in that block so the actor isn't continually evp'ing. That could cause a problem. --Omzy 20:21, 22 June 2006 (EDT)
Already knew that, anyways: this is the new code I've tested, and it doesn't seem to work either. Do I need to force the NPC to choose the service package as well or what? Even after removing all their 'forced' AI, they still don't get it.
	if GetIsClass Scout
		if Timer3 < 10 && GetDistance player < 192
			if Timer3 == 0
				RemoveScriptPackage LRcrTravellerWander
				RemoveScriptPackage LRcrTravellertoLeft
				RemoveScriptPackage LRcrTravellertoLeftChorrol
				RemoveScriptPackage LRcrTravellertoNorth
				RemoveScriptPackage LRcrTravellertoRight
				RemoveScriptPackage LRcrTravellertoSouthLeft
				RemoveScriptPackage LRcrTravellertoSouthRight
				EVP
			endif
			Set Timer3 to Timer3 + GetSecondsPassed
		elseif Timer3 != 0 && Timer3 < 15
			Set Once to 6
			Set Package to Package + 100
			Set Timer3 to 20
		elseif Timer3 != 0 && GetDistance player > 192
			Set Timer3 to 0
		endif
	endif

--MaXiMiUS 02:48, 24 June 2006 (EDT)

Removing the AI packages with a script won't work. First of all, they aren't script packages, which is the only thing the RemoveScriptPackage function handles. Second of all, only the currently running package can be removed that way. Have you tried using quest stage result scripts for this kind of thing yet? Maybe when an NPC gets near the player, a repeatable stage is set and the npc's reference is sent to the global script which performs tasks, etc.. --Omzy 02:55, 24 June 2006 (EDT)
From experience, and other articles on this wiki, I was under the impression that was exactly what AddScriptPackage/RemoveScriptPackage does. What on earth are you talking about, and why would I need a global script? --MaXiMiUS 11:02, 24 June 2006 (EDT)
Notice that in the script provided in that link the author only adds or removes one package at a time? That is because only the currently running package can be removed. You can see this from the RemoveScriptPackage page. That means remove one at a time and evp after each removal, which could easily get tedious and probably not the best way to do it. Also, when I say AI packages, I mean packages that are part of the actor's default AI, not packages added by scripts. There is a difference. Yes, you can remove a package that was added by a script, but not one that is part of the default AI. The only way to remove one from the default AI is to simulate removal by overriding it with AddScriptPackage. RemoveScriptPackage just cleans up after yourself from using AddScriptPackage. --Omzy 14:15, 24 June 2006 (EDT)
Not sure why you're telling me this then, unless you want me to check what was the last added AI package. All of the packages being removed with RemoveScriptPackage, were added in the same script. I'm not even TRYING to remove the default AI, hell, I'm trying to GET IT TO RUN!
Here's something that would be useful: how would I go about REMOVING the override AI packages, then making the NPC choose LRcrTravellerServices, which is in their default list? --MaXiMiUS 14:23, 24 June 2006 (EDT)

Perhaps a better way to go about this is to give the NPC a bunch of schedules, and have it chosen governed by the script? The Imperial Dragon 14:21, 24 June 2006 (EDT)

If you know how to do that with several hundred NPCs, you let me know. Personally, I have no clue how to make a NPC choose a specific AI package from it's list based on variables inside a script. Using globals is out of the question. --MaXiMiUS 14:23, 24 June 2006 (EDT)

I'm still not clear on exactly what you're trying to do. I am guessing that you want to have 100's of npc's running their normal travel packages (which include selling) but whenever one comes near the player, they stop and offer to sell their goods to the player. I think i understand the use of so many lines of RemoveScriptPackage in your script. You're trying to get them to remove all packages that could've possibly been added by a script and return to their default AI, right? If you want to force an npc to choose a particular package over other packages, make a condition for all packages except the AI package you want them to switch to that is GetQuestVariable QuestName.var == 0 and set it to 1 when you remove the packages and then EVP. Then set it back to 0 right after evp. For that split second, it shouldn't have any effect on other npc's if they are all running the same script. Then they should return to normal AI, with the chosen package currently running. --Omzy 16:05, 24 June 2006 (EDT)

Didn't work, though I noticed something interesting. When they don't have any override packages to choose from, they choose nothing -- or at least, that's what I see in the console. I tried running up to a merchant, and manually trying to use EVP on them -- they chose to do absolutely nothing. No active AI package at all :-/ --MaXiMiUS 17:25, 24 June 2006 (EDT)

A good question would be; can somebody just show me some code that WILL shift the NPCs attention from a Travel type package, to a Offer Services one? --MaXiMiUS 01:59, 25 June 2006 (EDT)

Anybody? There has to be some way. --MaXiMiUS 15:05, 29 June 2006 (EDT)
The "Offer Services" one being the only package on the NPC's base-data and then RemoveScriptPackage + EvaluatePackage to reset to this package
Or much much easier: add all packages to the NPC and choose the active Package using a faction-rank instead of a local variable...
--JOG 15:29, 29 June 2006 (EDT)



Morrowind Discussion[edit source]

Please place new topics under their own header.

spell script help[edit source]

Hey! I'm planning on creating spells where i summon more than one NPC/Creature at once. And then i plan to reward these spells to the player upon reading a scroll. Do you have any tips or tutorial scripts for script effects on sumoning Multiple creatures/NPC's?

thanks, Luis