script request from a hopeless scripter

Post » Fri May 13, 2011 8:39 am

so, im making a mod based around an episode of Doctor Who i saw a few years back, its called Tooth and claw, with a werewolf and the Koh-I-Noor diamond. i could use a hand with a script that causes the werewolf to die in one hit when the player has the Koh-I-Noor in his/her inventory.

if you could help me out with this i would be very grateful!

thanks!
User avatar
Nicole Coucopoulos
 
Posts: 3484
Joined: Fri Feb 23, 2007 4:09 am

Post » Fri May 13, 2011 11:42 am

so, im making a mod based around an episode of Doctor Who i saw a few years back, its called Tooth and claw, with a werewolf and the Koh-I-Noor diamond. i could use a hand with a script that causes the werewolf to die in one hit when the player has the Koh-I-Noor in his/her inventory.

if you could help me out with this i would be very grateful!

thanks!


I'm no expert, but I think something like this should work. It would be an object script attached to the werewolf.

scn KillWerewolfOSBegin OnHit player	if player.GetItemCount ( editor name for KohINoor )		Kill (editor name for Werewolf )	endifend


Edit:
Changed code snippet.
The Greatness post below is correct, you can specify the OnHit block with player to prevent anyone else with the diamond from killing the werewolf.
User avatar
Jason Rice
 
Posts: 3445
Joined: Thu Aug 16, 2007 3:42 pm

Post » Fri May 13, 2011 6:05 pm

I'm no expert, but I think something like this should work. It would be an object script attached to the werewolf.

scn KillWerewolfOSBegin OnHit	if player.GetItemCount refKohINoor		Kill refWerewolf	endifend


Problem: if the player has the diamond anyone who hits the werewolf will kill it. I think you can attach a 'player' flag to the begin onhit, I'm not entirely sure. I would look it up if I wasn't on a different, very slow computer.
User avatar
Wayne Cole
 
Posts: 3369
Joined: Sat May 26, 2007 5:22 am

Post » Fri May 13, 2011 6:29 am

well the player is the only person who will survive the werewolf when it first attacks and therefore the only one who can attack it.

thanks! i owe you!
User avatar
Jordan Moreno
 
Posts: 3462
Joined: Thu May 10, 2007 4:47 pm

Post » Fri May 13, 2011 1:51 pm

ok, im back again and i didnt want to make a new thread so im using this one. how would i go about changing the script below to teleport the player to a different cell after reaching the last rank in the faction?

scn TARDISTimeLordQuestSCRIPT

float playerHealth
float timer
short doOnce

begin GameMode

if doOnce == 0
if player.getFactionRank TARDISFaction < 12
if player.getFactionRank TARDISFaction >= 0
set playerHealth to player.getAV Health
if ( playerHealth < 500 )
if ( player.getAV Health < 0 )
player.resurrect
endif
set doOnce to 1
set TARDISRegenerateQuest.doOnce to 1
if player.getFactionRank TARDISFaction == 0
player.setFactionRank TARDISFaction, 1
elseif player.getFactionRank TARDISFaction == 1
player.setFactionRank TARDISFaction, 2
elseif player.getFactionRank TARDISFaction == 2
player.setFactionRank TARDISFaction, 3
elseif player.getFactionRank TARDISFaction == 3
player.setFactionRank TARDISFaction, 4
elseif player.getFactionRank TARDISFaction == 4
player.setFactionRank TARDISFaction, 5
elseif player.getFactionRank TARDISFaction == 5
player.setFactionRank TARDISFaction, 6
elseif player.getFactionRank TARDISFaction == 6
player.setFactionRank TARDISFaction, 7
elseif player.getFactionRank TARDISFaction == 7
player.setFactionRank TARDISFaction, 8
elseif player.getFactionRank TARDISFaction == 8
player.setFactionRank TARDISFaction, 9
elseif player.getFactionRank TARDISFaction == 9
player.setFactionRank TARDISFaction, 10
elseif player.getFactionRank TARDISFaction == 10
player.setFactionRank TARDISFaction, 11
elseif player.getFactionRank TARDISFaction == 11
player.setFactionRank TARDISFaction, 12
endif
set TARDISComeToMeRegenQuest.doOnce to 1
endif
endif
endif
endif
end
User avatar
Tammie Flint
 
Posts: 3336
Joined: Mon Aug 14, 2006 12:12 am

Post » Fri May 13, 2011 6:51 pm

ok, im back again and i didnt want to make a new thread so im using this one. how would i go about changing the script below to teleport the player to a different cell after reaching the last rank in the faction?

scn TARDISTimeLordQuestSCRIPT

float playerHealth
float timer
short doOnce

begin GameMode

if doOnce == 0
if player.getFactionRank TARDISFaction < 12
if player.getFactionRank TARDISFaction >= 0
set playerHealth to player.getAV Health
if ( playerHealth < 500 )
if ( player.getAV Health < 0 )
player.resurrect
endif
set doOnce to 1
set TARDISRegenerateQuest.doOnce to 1
if player.getFactionRank TARDISFaction == 0
player.setFactionRank TARDISFaction, 1
elseif player.getFactionRank TARDISFaction == 1
player.setFactionRank TARDISFaction, 2
elseif player.getFactionRank TARDISFaction == 2
player.setFactionRank TARDISFaction, 3
elseif player.getFactionRank TARDISFaction == 3
player.setFactionRank TARDISFaction, 4
elseif player.getFactionRank TARDISFaction == 4
player.setFactionRank TARDISFaction, 5
elseif player.getFactionRank TARDISFaction == 5
player.setFactionRank TARDISFaction, 6
elseif player.getFactionRank TARDISFaction == 6
player.setFactionRank TARDISFaction, 7
elseif player.getFactionRank TARDISFaction == 7
player.setFactionRank TARDISFaction, 8
elseif player.getFactionRank TARDISFaction == 8
player.setFactionRank TARDISFaction, 9
elseif player.getFactionRank TARDISFaction == 9
player.setFactionRank TARDISFaction, 10
elseif player.getFactionRank TARDISFaction == 10
player.setFactionRank TARDISFaction, 11
elseif player.getFactionRank TARDISFaction == 11
player.setFactionRank TARDISFaction, 12
endif
set TARDISComeToMeRegenQuest.doOnce to 1
endif
endif
endif
endif
end


That is one confusing script. I see a problem at the top already.

Problem: Using the resurrect command on the player makes them limp and umovable. Unless you do it twice, but typicall when you do that, the player flys into space or something and oblivion freezes on loading screen O.o
Problem 2(might not be one): Won't it keep raising the players rank in the faction? Because elseif Player.GetFactionRank Faction == ## then it will keep raising because of the commands following. At least I think so.

Instead of Resurrect you could use If (Player.GetAV Health == 1) *nextline* Player.ResetHealth Message "The power of whatever flows into you." Idk, a suggestion.

To address your question,

Player.MoveTo MarkerREFName

you have to place a XMarkerHeading to where you want the player.
User avatar
Micah Judaeah
 
Posts: 3443
Joined: Tue Oct 24, 2006 6:22 pm

Post » Fri May 13, 2011 8:27 am

the script works fine its from another mod that someone made, i have permission to make a storyline out of it but i just need a way to get the player to teleport to the cell i want him to after getting the last rank in the faction.

the mod is found here: http://www.tesnexus.com/downloads/file.php?id=20867 its very good you should check it out. so any help would be appriciated.
User avatar
Lakyn Ellery
 
Posts: 3447
Joined: Sat Jan 27, 2007 1:02 pm

Post » Fri May 13, 2011 11:18 am

scn TARDISTimeLordQuestSCRIPT

float playerHealth
float timer
short doOnce

begin GameMode

if doOnce == 0
if player.getFactionRank TARDISFaction < 12
if player.getFactionRank TARDISFaction >= 0
set playerHealth to player.getAV Health
if ( playerHealth < 500 )
if ( player.getAV Health < 0 )
player.resurrect
endif
set doOnce to 1
set TARDISRegenerateQuest.doOnce to 1
if player.getFactionRank TARDISFaction == 0
player.setFactionRank TARDISFaction, 1
elseif player.getFactionRank TARDISFaction == 1
player.setFactionRank TARDISFaction, 2
elseif player.getFactionRank TARDISFaction == 2
player.setFactionRank TARDISFaction, 3
elseif player.getFactionRank TARDISFaction == 3
player.setFactionRank TARDISFaction, 4
elseif player.getFactionRank TARDISFaction == 4
player.setFactionRank TARDISFaction, 5
elseif player.getFactionRank TARDISFaction == 5
player.setFactionRank TARDISFaction, 6
elseif player.getFactionRank TARDISFaction == 6
player.setFactionRank TARDISFaction, 7
elseif player.getFactionRank TARDISFaction == 7
player.setFactionRank TARDISFaction, 8
elseif player.getFactionRank TARDISFaction == 8
player.setFactionRank TARDISFaction, 9
elseif player.getFactionRank TARDISFaction == 9
player.setFactionRank TARDISFaction, 10
elseif player.getFactionRank TARDISFaction == 10
player.setFactionRank TARDISFaction, 11
elseif player.getFactionRank TARDISFaction == 11
player.setFactionRank TARDISFaction, 12
player.moveto MarkerREFXMarkerTARDISdead
endif
set TARDISComeToMeRegenQuest.doOnce to 1
endif
endif
endif
endif

ive changed the script but it doesnt work, what did i do wrong?
User avatar
Andrew
 
Posts: 3521
Joined: Tue May 08, 2007 1:44 am

Post » Fri May 13, 2011 2:22 pm

You might want to use Code Tags, as they make things a little easier to understand :)

Now, not knowing all the details, I can't be sure I understand the concept perfectly, but I'll give it a go :)

As I understand it, you want to :
1.Check if the Player's Health is less than 500
2. If So, increase their Faction Rank in the "TARDISFaction" by one Rank
3. When they reach Rank 12, Teleport them somewhere else

So, my suggestion would be something like this :

float playerHealthfloat timershort doOnceShort TeleportDone begin GameModeif doOnce == 0 	if player.getFactionRank TARDISFaction < 12 		if player.getFactionRank TARDISFaction >= 0 			set playerHealth to player.getAV Health 			if ( playerHealth < 500 )				if ( player.getAV Health < 0 )					player.resurrect				endif				set doOnce to 1				set TARDISRegenerateQuest.doOnce to 1				if player.getFactionRank TARDISFaction == 0					player.setFactionRank TARDISFaction, 1				elseif player.getFactionRank TARDISFaction == 1					player.setFactionRank TARDISFaction, 2				elseif player.getFactionRank TARDISFaction == 2					player.setFactionRank TARDISFaction, 3				elseif player.getFactionRank TARDISFaction == 3					player.setFactionRank TARDISFaction, 4				elseif player.getFactionRank TARDISFaction == 4					player.setFactionRank TARDISFaction, 5				elseif player.getFactionRank TARDISFaction == 5					player.setFactionRank TARDISFaction, 6				elseif player.getFactionRank TARDISFaction == 6					player.setFactionRank TARDISFaction, 7				elseif player.getFactionRank TARDISFaction == 7					player.setFactionRank TARDISFaction, 8				elseif player.getFactionRank TARDISFaction == 8					player.setFactionRank TARDISFaction, 9				elseif player.getFactionRank TARDISFaction == 9					player.setFactionRank TARDISFaction, 10				elseif player.getFactionRank TARDISFaction == 10					player.setFactionRank TARDISFaction, 11				elseif player.getFactionRank TARDISFaction == 11					player.setFactionRank TARDISFaction, 12				endif			endif		endif	endifendif;This last bit checks the FactionRank, and if it is right ,moves you to an X-Marker Heading item-- a Static you will need to place in World and give a Unique ID to.If ( Player.GetFactionRank TARDISFaction == 12 )	If ( TeleportDone == 0 )		Set TeleportDone to 1		Player.MoveTo [X-Marker Heading ID]	EndIfEndIf


What I wonder about is the "DoOnce" up the top-- it will stop everything else running after the first iteration where the Player's health is less than 500, meaning you'll only ever get one Rank Increase... Do you have something else that will undo that later, or is it not important?
User avatar
Life long Observer
 
Posts: 3476
Joined: Fri Sep 08, 2006 7:07 pm

Post » Fri May 13, 2011 12:59 pm

it isnt important it doesnt change a thing about ranking up. the scrip just allows you to cheat death and change your appearance. thanks ill try it out!
User avatar
Helen Quill
 
Posts: 3334
Joined: Fri Oct 13, 2006 1:12 pm


Return to IV - Oblivion