Need Script for Ridable Creature in Leveled Lists

Post » Fri Aug 21, 2009 10:01 am

I want to make a Chocobo mod where the chocobos only appear in leveled lists. I want the chocobo to run away if you don't have the greens in your inventory. But stay if you do have greens and then you can click on it to ride it.
They will already have a riding script on them though.
User avatar
Rachel Eloise Getoutofmyface
 
Posts: 3445
Joined: Mon Oct 09, 2006 5:20 pm

Post » Fri Aug 21, 2009 5:52 am

Could you not make it to where you would have a misc item (that looks like greens) to where you could take it out of your inventory and activate it, and if you stayed within 10 feet of it, the chocobos would willingly come to you? And if you put it up, the chocobos would run away again. If you see what I mean....
User avatar
мistrєss
 
Posts: 3168
Joined: Thu Dec 14, 2006 3:13 am

Post » Fri Aug 21, 2009 2:12 am

Do you have the riding script already working for the chocobo mesh? if so, can you post it so we can try and add the missing parts?
User avatar
Claudia Cook
 
Posts: 3450
Joined: Mon Oct 30, 2006 10:22 am

Post » Thu Aug 20, 2009 10:29 pm

I like the idea of feeding the greens, though I still want the chocobo to be a flighty as in FF7 when trying to catch one for a ride. :)
In FF7, you had to have a chocobo lure in your inventory for the chocobo to appear in your battles, and then you fed it greens during the turnbased battle.

Lingarn's main riding script

;=============================================================================; Horse Riding Script by Madmax ( 2004 );=============================================================================Begin _Chocobo_normal_ridefloat tempfloat anglefloat zanglefloat zzanglefloat xmulfloat ymulshort OnlyOnceshort quadrantshort clockwiseshort ridingmodeshort walkrunmodeshort companionmodeshort pressedshort pressed2short doOnceshort pheightshort dismountshort horsespeedshort buttonshort runningshort frontbackpositionfloat xxfloat yyfloat zzfloat timerfloat timer2short companionif ( Menumode == 1 )	returnendif;=============================================================================; Randomize horse speed;=============================================================================if ( OnlyOnce == 0 )	setscale 1.0;	set companion to 1	;Uncomment for pack animals	set horsespeed to 30				; a variable speed	set frontbackposition to 30					; position the player either front or back of the creature	set OnlyOnce to 1endif;=============================================================================; Menu option for companion mode;=============================================================================if ( companionmode == 1 )	set button to GetButtonPressed	if ( button < 0 )		return	else		if ( button == 0 )			AiFollow "player" 0 0 0 0		elseif ( button == 1 )			messagebox "The horse stands firm"			AiWander 0 0 0 0			playgroup idle 1		elseif ( button == 2 )			messagebox "The horse is delighted with the food"		elseif ( button == 3 )			messagebox "Horse Speed = %.0f", horsespeed		endif		set companionmode to 0	endifendif;=============================================================================; Activate Horse Riding;=============================================================================if ( ridingmode == 0 )	if ( OnActivate == 1 )		if ( GetHealth <= 0 ) ; if creature is dead, disable riding and access inventory only			Activate			return		endif		if ( getpos, z < -70 )	; this automatically gets the horse to follow you out of the water			AiFollow "player" 0 0 0 0			messagebox "The chocobo seems lost in the water. It seems to be following you......"			return		endif		if ( GetPCSneaking == 1 )	; this opens up the command menu			Activate			return		endif		set ridingmode to 1		AiWander, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0		"player"->DisableLevitation		"player"->addspell, "ridingspell"		playsound "choco_call"		set doOnce to 1		;------------------------------------------------------------------------------------------------------------------------------		; Setting player sitting height ( You can also add the riding pants script here )		;------------------------------------------------------------------------------------------------------------------------------		if ( "player"->GetRace, "Argonian" == 1 )			set pheight to 16		elseif ( "player"->GetRace, "Breton" == 1 )			set pheight to 28		elseif ( "player"->GetRace, "Dark Elf" == 1 )			set pheight to 29		elseif ( "player"->GetRace, "High Elf" == 1 )			set pheight to 21		elseif ( "player"->GetRace, "Imperial" == 1 )			set pheight to 28		elseif ( "player"->GetRace, "Khajiit" == 1 )			set pheight to 19		elseif ( "player"->GetRace, "Nord" == 1 )			set pheight to 26		elseif ( "player"->GetRace, "Orc" == 1 )			set pheight to 26		elseif ( "player"->GetRace, "Redguard" == 1 )			set pheight to 26		elseif ( "player"->GetRace, "Wood Elf" == 1 )			set pheight to 36																																																																																											else			set pheight to 29		endif	endif	returnendifif ( CellChanged == 1 )	AiWander 0 0 0 0 0 0 0 0 0 0 0endif;=============================================================================; Calculate x and y forward direction *DO NOT TOUCH THIS PORTION*;=============================================================================set zangle to "player"->getangle, zif ( zangle >= 0 )	set clockwise to 1	set zzangle to zangleelse	set clockwise to 0	set zzangle to ( -1 * zangle )endifif ( zzangle <= 45 )	set angle to zzangle	set quadrant to 1elseif ( zzangle <= 90 )	set angle to ( 90 - zzangle )	set quadrant to 2elseif ( zzangle <= 135 )	set angle to ( zzangle - 90 )	set quadrant to 3elseif ( zzangle <= 180 )	set angle to ( 180 - zzangle )	set quadrant to 4endif	if ( angle <= 0.5 )	set xmul to 0	set ymul to 1elseif ( angle <= 1.5 )	set xmul to 0.01745	set ymul to 0.99985elseif ( angle <= 2.5 )	set xmul to 0.03490	set ymul to 0.99939elseif ( angle <= 3.5 )	set xmul to 0.05234	set ymul to 0.99863elseif ( angle <= 4.5 )	set xmul to 0.06976	set ymul to 0.99756elseif ( angle <= 5.5 )	set xmul to 0.08716	set ymul to 0.99619elseif ( angle <= 6.5 )	set xmul to 0.10453	set ymul to 0.99452elseif ( angle <= 7.5 )	set xmul to 0.12187	set ymul to 0.99255elseif ( angle <= 8.5 )	set xmul to 0.13917	set ymul to 0.99027elseif ( angle <= 9.5 )	set xmul to 0.15643	set ymul to 0.98769elseif ( angle <= 10.5 )	set xmul to 0.17365	set ymul to 0.98481elseif ( angle <= 11.5 )	set xmul to 0.19081	set ymul to 0.98163elseif ( angle <= 12.5 )	set xmul to 0.20791	set ymul to 0.97815elseif ( angle <= 13.5 )	set xmul to 0.22495	set ymul to 0.97437elseif ( angle <= 14.5 )	set xmul to 0.24192	set ymul to 0.97030elseif ( angle <= 15.5 )	set xmul to 0.25882	set ymul to 0.96593elseif ( angle <= 16.5 )	set xmul to 0.27564	set ymul to 0.96126elseif ( angle <= 17.5 )	set xmul to 0.29237	set ymul to 0.95630elseif ( angle <= 18.5 )	set xmul to 0.30902	set ymul to 0.95106elseif ( angle <= 19.5 )	set xmul to 0.32557	set ymul to 0.94552elseif ( angle <= 20.5 )	set xmul to 0.34202	set ymul to 0.93969elseif ( angle <= 21.5 )	set xmul to 0.35837	set ymul to 0.93358elseif ( angle <= 22.5 )	set xmul to 0.37461	set ymul to 0.92718elseif ( angle <= 23.5 )	set xmul to 0.39073	set ymul to 0.92050elseif ( angle <= 24.5 )	set xmul to 0.40674	set ymul to 0.91355elseif ( angle <= 25.5 )	set xmul to 0.42262	set ymul to 0.90631elseif ( angle <= 26.5 )	set xmul to 0.43837	set ymul to 0.89879elseif ( angle <= 27.5 )	set xmul to 0.45399	set ymul to 0.89101elseif ( angle <= 28.5 )	set xmul to 0.46947	set ymul to 0.88295elseif ( angle <= 29.5 )	set xmul to 0.48481	set ymul to 0.87462elseif ( angle <= 30.5 )	set xmul to 0.50000	set ymul to 0.86603elseif ( angle <= 31.5 )	set xmul to 0.51504	set ymul to 0.85717elseif ( angle <= 32.5 )	set xmul to 0.52992	set ymul to 0.84805elseif ( angle <= 33.5 )	set xmul to 0.54464	set ymul to 0.83867elseif ( angle <= 34.5 )	set xmul to 0.55919	set ymul to 0.82904elseif ( angle <= 35.5 )	set xmul to 0.57358	set ymul to 0.81915elseif ( angle <= 36.5 )	set xmul to 0.58779	set ymul to 0.80902elseif ( angle <= 37.5 )	set xmul to 0.60182	set ymul to 0.79864elseif ( angle <= 38.5 )	set xmul to 0.61566	set ymul to 0.78801elseif ( angle <= 39.5 )	set xmul to 0.62932	set ymul to 0.77715elseif ( angle <= 40.5 )	set xmul to 0.64279	set ymul to 0.76604elseif ( angle <= 41.5 )	set xmul to 0.65606	set ymul to 0.75471elseif ( angle <= 42.5 )	set xmul to 0.66913	set ymul to 0.74314elseif ( angle <= 43.5 )	set xmul to 0.68200	set ymul to 0.73135elseif ( angle <= 44.5 )	set xmul to 0.69466	set ymul to 0.71934else	set xmul to 0.70711	set ymul to 0.70711endifif ( quadrant > 1 )	if ( quadrant < 4 )		set temp to xmul		set xmul to ymul		set ymul to temp	endifendifif ( clockwise == 1 )	if ( quadrant > 2 )		set ymul to ( -1 * ymul )	endifelse	if ( quadrant <= 2 )		set xmul to ( -1 * xmul )	else		set xmul to ( -1 * xmul )		set ymul to ( -1 * ymul )	endifendif;=============================================================================; Calculate and position/rotate horse direction *DO NOT TOUCH THIS PORTION*;=============================================================================set timer to ( timer + GetSecondsPassed )if ( timer > 0.1 )	set timer to 0	if ( clockwise == 1 )		if ( zzangle <= 0.5 )			face 0, 100000000		elseif ( zzangle <= 10.5 )			face 17364810, 98480770		elseif ( zzangle <= 20.5 )			face 34202010, 93969260		elseif ( zzangle <= 30.5 )			face 50000000, 86602540		elseif ( zzangle <= 40.5 )			face 64278760, 76604440		elseif ( zzangle <= 50.5 )			face 76604440, 64278760		elseif ( zzangle <= 60.5 )			face 86602540, 50000000		elseif ( zzangle <= 70.5 )			face 93969260, 34202010		elseif ( zzangle <= 80.5 )			face 98480770, 17364810		elseif ( zzangle <= 90.5 )			face 100000000, 0		elseif ( zzangle <= 100.5 )			face 98480770, -17364810		elseif ( zzangle <= 110.5 )			face 93969260, -34202010		elseif ( zzangle <= 120.5 )			face 86602540, -50000000		elseif ( zzangle <= 130.5 )			face 76604440, -64278760		elseif ( zzangle <= 140.5 )			face 64278760, -76604440		elseif ( zzangle <= 150.5 )			face 50000000, -86602540		elseif ( zzangle <= 160.5 )			face 34202010, -93969260		elseif ( zzangle <= 170.5 )			face 17364810, -98480770		else			face 0, -100000000		endif	else		if ( zzangle <= 0.5 )			face 0, 100000000		elseif ( zzangle <= 10.5 )			face -17364810, 98480770		elseif ( zzangle <= 20.5 )			face -34202010, 93969260		elseif ( zzangle <= 30.5 )			face -50000000, 86602540		elseif ( zzangle <= 40.5 )			face -64278760, 76604440		elseif ( zzangle <= 50.5 )			face -76604440, 64278760		elseif ( zzangle <= 60.5 )			face -86602540, 50000000		elseif ( zzangle <= 70.5 )			face -93969260, 34202010		elseif ( zzangle <= 80.5 )			face -98480770, 17364810		elseif ( zzangle <= 90.5 )			face -100000000, 0		elseif ( zzangle <= 100.5 )			face -98480770, -17364810		elseif ( zzangle <= 110.5 )			face -93969260, -34202010		elseif ( zzangle <= 120.5 )			face -86602540, -50000000		elseif ( zzangle <= 130.5 )			face -76604440, -64278760		elseif ( zzangle <= 140.5 )			face -64278760, -76604440		elseif ( zzangle <= 150.5 )			face -50000000, -86602540		elseif ( zzangle <= 160.5 )			face -34202010, -93969260		elseif ( zzangle <= 170.5 )			face -17364810, -98480770		else			face 0, -100000000		endif	endifendif;=============================================================================; Horse movement;=============================================================================if ( pressed2 == 0 )	if ( GetPCRunning == 1 )		set pressed2 to 1	endifelse	if ( GetPCRunning == 0 )		if ( running == 0 )			set running to 1		else			set running to 0		endif		set pressed2 to 0	endifendifif ( running == 1 )	if ( pressed == 3 )		set pressed to 0		stopsound "choco_call"		; disable this if you do not need this	elseif ( pressed == -1 )		if ( GetPCSneaking == 0 )			set pressed to 0		endif	endif	if ( walkrunmode == 0 )		playgroup walkforward 2		set xx to ( getpos, x + ( 10 * xmul ) )	;	trot speed can be adjusted here		set yy to ( getpos, y + ( 10 * ymul ) )	;	trot speed can be adjusted here		if ( GetSoundPlaying, "_trot" == 0 )			playloopsound3D "_trot"		; disable this if you do not need this		endif	elseif ( walkrunmode == 1 )		if ( pressed <= 3 )			playgroup runforward 2			set xx to ( getpos, x + ( horsespeed * xmul ) )			set yy to ( getpos, y + ( horsespeed * ymul ) )			if ( GetSoundPlaying, "_run" == 0 )				playloopsound3D "_run"		; disable this if you do not need this			endif		endif	endif	setpos, x, xx	setpos, y, yy	setAngle, z, zangle	set zz to ( getpos, z + pheight )	set xx to ( xx + ( frontbackposition * xmul ) )	set yy to ( yy + ( frontbackposition * ymul ) )	"player"->setpos, x, xx	"player"->setpos, y, yy	"player"->setpos, z, zz	player -> fall	if ( zz < ( pheight - 70 ) )	; set allowable water height		set dismount to 2	endif	set doOnce to 2else	if ( doOnce == 0 )		if ( walkrunmode == 1 )			playsound "choco_call"		; disable this if you do not need this		endif		set doOnce to 1	elseif ( doOnce == 2 )		set doOnce to 0		endif	if ( pressed <= 1 )		playgroup idle 1		stopsound "_run"		; disable this if you do not need this		stopsound "_trot"				; disable this if you do not need this		set xx to getpos, x		set yy to getpos, y		setAngle, z, zangle		set zz to ( getpos, z + pheight )		set xx to ( xx + ( frontbackposition * xmul ) )		set yy to ( yy + ( frontbackposition * ymul ) )		"player"->setpos, x, xx		"player"->setpos, y, yy		"player"->setpos, z, zz		player -> fall	endifendif;=============================================================================; Using SNEAK key to change horse movement mode;=============================================================================if ( pressed == 0 )	if ( GetPCSneaking == 1 )		set timer2 to 0		set pressed to 1	endifelseif ( pressed == 1 )	set timer2 to ( timer2 + GetSecondsPassed )	if ( GetPCSneaking == 0 )		if ( walkrunmode == 0 )			set walkrunmode to 1			messagebox "RUN MODE"		else			set walkrunmode to 0			messagebox "TROT MODE"		endif		stopsound "_run"		; disable this if you do not need this		stopsound "_trot"				; disable this if you do not need this		set pressed to 0	else		if ( timer2 > 1 )			stopsound "_run"		; disable this if you do not need this			stopsound "_trot"				; disable this if you do not need this			set timer2 to 0			if ( walkrunmode == 0 )				set running to 0				set pressed to 2;				playgroup idle7 1		; this is the special move function. Just put in the animation group that you want to show here or disable it			else				if ( running == 0 )					set pressed to 0				else					player->EnableLevitation					set timer2 to 0					set pressed to 4;					playsound "choco_call"				; disable this if you do not need this				endif			endif		endif	endifelseif ( pressed == 2 )	if ( GetPCSneaking == 0 )		set pressed to 0	else		set timer2 to ( timer2 + GetSecondsPassed )		if ( timer2 < 1.5 );			set xx to ( getpos, x - ( 55 * xmul ) )		; disable this if special move is not required;			set yy to ( getpos, y - ( 55 * ymul ) )		; disable this if special move is not required;			set zz to ( getpos, z  + pheight + 25 )		; disable this if special move is not required			"player"->setpos, x, xx			"player"->setpos, y, yy			"player"->setpos, z, zz			player -> fall		else			set pressed to 3			playgroup idle 1		endif	endifelseif ( pressed == 3 )	if ( GetPCSneaking == 0 )		set pressed to 0	endif	set xx to ( getpos, x )	set yy to ( getpos, y )	set zz to ( getpos, z  + pheight )	set xx to ( xx + ( frontbackposition * xmul ) )	set yy to ( yy + ( frontbackposition * ymul ) )	"player"->setpos, x, xx	"player"->setpos, y, yy	"player"->setpos, z, zz	player -> fallelseif ( pressed == 4 )	stopsound "_run"	addspell, "ridingspell2"	set zz to ( getpos, z + 30 )	setpos, z, zz	set zz to ( zz  + pheight )	"player"->setpos, z, zz	set pressed to 5	addspell, ridingspell3elseif ( pressed == 5 )	set timer2 to ( timer2 + GetSecondsPassed )	if ( timer2 < 0.5 )		set zz to ( getpos, z + 10 )		setpos, z, zz	elseif ( timer2 > 1.8 )		removespell, "ridingspell3"		set pressed to -1		set timer2 to 0		player->DisableLevitation	else		removespell, ridingspell2	endif	set xx to ( getpos, x + ( ( horsespeed - 10 ) * xmul ) )	set yy to ( getpos, y + ( ( horsespeed - 10 ) * ymul ) )	setpos, x, xx	setpos, y, yy	set zz to ( getpos, z  + pheight + 20 )	set xx to ( xx + ( frontbackposition * xmul ) )	set yy to ( yy + ( frontbackposition * ymul ) )	"player"->setpos, x, xx	"player"->setpos, y, yy	"player"->setpos, z, zz	player -> fallendif;=============================================================================; Detect creature death and stop riding;=============================================================================if ( GetHealth <= 0 )	set dismount to 1endif;=============================================================================; Dismount horse;=============================================================================if ( OnActivate == 1 )	set dismount to 1endifif ( dismount > 0 )	stopsound "_run"		; disable this if you do not need this	stopsound "_trot"				; disable this if you do not need this	playsound "choco_call"				; disable this if you do not need this	playgroup idle 1	set ridingmode to 0	set running to 0	"player"->removespell, "ridingspell"	"player"->EnableLevitation	if ( dismount == 1 )		messagebox "Dismount"	else		messagebox "You cannot ride a chocobo underwater"	endif	AiWander, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0	set walkrunmode to 0	set dismount to 0	fixmeendif

User avatar
N Only WhiTe girl
 
Posts: 3353
Joined: Mon Oct 30, 2006 2:30 pm

Post » Fri Aug 21, 2009 2:34 am

And his flying chocobo riding script
(Yes this is exactly as in his esp, no indents)

;=============================================================================; Horse Riding Script by Madmax ( 2004 );=============================================================================Begin _Chocobo_fly_ridefloat tempfloat anglefloat zanglefloat zzanglefloat xmulfloat ymulshort OnlyOnceshort quadrantshort clockwiseshort ridingmodeshort walkrunmodeshort companionmodeshort pressedshort pressed2short doOnceshort pheightshort dismountshort horsespeedshort buttonshort runningshort frontbackpositionfloat xxfloat yyfloat zzfloat timerfloat timer2float zflyshort companionif ( Menumode == 1 )returnendif;=============================================================================; Randomize horse speed;=============================================================================if ( OnlyOnce == 0 ); set companion to 1;Uncomment for pack animalsset zfly to getpos zset horsespeed to 30 ; a variable speedset frontbackposition to 30 ; position the player either front or back of the creatureset OnlyOnce to 1endif;=============================================================================; Menu option for companion mode;=============================================================================if ( companionmode == 1 )set button to GetButtonPressedif ( button < 0 )returnelseif ( button == 0 )AiFollow "player" 0 0 0 0elseif ( button == 1 )messagebox "The horse stands firm"AiWander 0 0 0 0playgroup idle 1; playsound "max_horse_idle3"elseif ( button == 2 )messagebox "The horse is delighted with the food"; playsound "max_horse_idle2"elseif ( button == 3 )messagebox "Horse Speed = %.0f", horsespeedendifset companionmode to 0endifendif;=============================================================================; Activate Horse Riding;=============================================================================if ( ridingmode == 0 )if ( OnActivate == 1 )if ( GetHealth <= 0 ); if creature is dead, disable riding and access inventory onlyActivatereturnendifif ( getpos, z < -70 ); this automatically gets the horse to follow you out of the waterAiFollow "player" 0 0 0 0messagebox "The chocobo seems lost in the water. It seems to be following you......"returnendifif ( GetPCSneaking == 1 ); this opens up the command menuActivatereturnendifset ridingmode to 1AiWander, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0"player"->DisableLevitation"player"->addspell, "ridingspell"playsound "choco_call"set doOnce to 1;------------------------------------------------------------------------------------------------------------------------------; Setting player sitting height ( You can also add the riding pants script here );------------------------------------------------------------------------------------------------------------------------------if ( "player"->GetRace, "Argonian" == 1 )set pheight to 16elseif ( "player"->GetRace, "Breton" == 1 )set pheight to 28elseif ( "player"->GetRace, "Dark Elf" == 1 )set pheight to 29elseif ( "player"->GetRace, "High Elf" == 1 )set pheight to 21elseif ( "player"->GetRace, "Imperial" == 1 )set pheight to 28elseif ( "player"->GetRace, "Khajiit" == 1 )set pheight to 19elseif ( "player"->GetRace, "Nord" == 1 )set pheight to 26elseif ( "player"->GetRace, "Orc" == 1 )set pheight to 26elseif ( "player"->GetRace, "Redguard" == 1 )set pheight to 26elseif ( "player"->GetRace, "Wood Elf" == 1 )set pheight to 36 elseset pheight to 29endifendifreturnendifif ( CellChanged == 1 )AiWander 0 0 0 0 0 0 0 0 0 0 0endif;=============================================================================; Calculate x and y forward direction *DO NOT TOUCH THIS PORTION*;=============================================================================set zangle to "player"->getangle, zif ( zangle >= 0 )set clockwise to 1set zzangle to zangleelseset clockwise to 0set zzangle to ( -1 * zangle )endifif ( zzangle <= 45 )set angle to zzangleset quadrant to 1elseif ( zzangle <= 90 )set angle to ( 90 - zzangle )set quadrant to 2elseif ( zzangle <= 135 )set angle to ( zzangle - 90 )set quadrant to 3elseif ( zzangle <= 180 )set angle to ( 180 - zzangle )set quadrant to 4endifif ( angle <= 0.5 )set xmul to 0set ymul to 1elseif ( angle <= 1.5 )set xmul to 0.01745set ymul to 0.99985elseif ( angle <= 2.5 )set xmul to 0.03490set ymul to 0.99939elseif ( angle <= 3.5 )set xmul to 0.05234set ymul to 0.99863elseif ( angle <= 4.5 )set xmul to 0.06976set ymul to 0.99756elseif ( angle <= 5.5 )set xmul to 0.08716set ymul to 0.99619elseif ( angle <= 6.5 )set xmul to 0.10453set ymul to 0.99452elseif ( angle <= 7.5 )set xmul to 0.12187set ymul to 0.99255elseif ( angle <= 8.5 )set xmul to 0.13917set ymul to 0.99027elseif ( angle <= 9.5 )set xmul to 0.15643set ymul to 0.98769elseif ( angle <= 10.5 )set xmul to 0.17365set ymul to 0.98481elseif ( angle <= 11.5 )set xmul to 0.19081set ymul to 0.98163elseif ( angle <= 12.5 )set xmul to 0.20791set ymul to 0.97815elseif ( angle <= 13.5 )set xmul to 0.22495set ymul to 0.97437elseif ( angle <= 14.5 )set xmul to 0.24192set ymul to 0.97030elseif ( angle <= 15.5 )set xmul to 0.25882set ymul to 0.96593elseif ( angle <= 16.5 )set xmul to 0.27564set ymul to 0.96126elseif ( angle <= 17.5 )set xmul to 0.29237set ymul to 0.95630elseif ( angle <= 18.5 )set xmul to 0.30902set ymul to 0.95106elseif ( angle <= 19.5 )set xmul to 0.32557set ymul to 0.94552elseif ( angle <= 20.5 )set xmul to 0.34202set ymul to 0.93969elseif ( angle <= 21.5 )set xmul to 0.35837set ymul to 0.93358elseif ( angle <= 22.5 )set xmul to 0.37461set ymul to 0.92718elseif ( angle <= 23.5 )set xmul to 0.39073set ymul to 0.92050elseif ( angle <= 24.5 )set xmul to 0.40674set ymul to 0.91355elseif ( angle <= 25.5 )set xmul to 0.42262set ymul to 0.90631elseif ( angle <= 26.5 )set xmul to 0.43837set ymul to 0.89879elseif ( angle <= 27.5 )set xmul to 0.45399set ymul to 0.89101elseif ( angle <= 28.5 )set xmul to 0.46947set ymul to 0.88295elseif ( angle <= 29.5 )set xmul to 0.48481set ymul to 0.87462elseif ( angle <= 30.5 )set xmul to 0.50000set ymul to 0.86603elseif ( angle <= 31.5 )set xmul to 0.51504set ymul to 0.85717elseif ( angle <= 32.5 )set xmul to 0.52992set ymul to 0.84805elseif ( angle <= 33.5 )set xmul to 0.54464set ymul to 0.83867elseif ( angle <= 34.5 )set xmul to 0.55919set ymul to 0.82904elseif ( angle <= 35.5 )set xmul to 0.57358set ymul to 0.81915elseif ( angle <= 36.5 )set xmul to 0.58779set ymul to 0.80902elseif ( angle <= 37.5 )set xmul to 0.60182set ymul to 0.79864elseif ( angle <= 38.5 )set xmul to 0.61566set ymul to 0.78801elseif ( angle <= 39.5 )set xmul to 0.62932set ymul to 0.77715elseif ( angle <= 40.5 )set xmul to 0.64279set ymul to 0.76604elseif ( angle <= 41.5 )set xmul to 0.65606set ymul to 0.75471elseif ( angle <= 42.5 )set xmul to 0.66913set ymul to 0.74314elseif ( angle <= 43.5 )set xmul to 0.68200set ymul to 0.73135elseif ( angle <= 44.5 )set xmul to 0.69466set ymul to 0.71934elseset xmul to 0.70711set ymul to 0.70711endifif ( quadrant > 1 )if ( quadrant < 4 )set temp to xmulset xmul to ymulset ymul to tempendifendifif ( clockwise == 1 )if ( quadrant > 2 )set ymul to ( -1 * ymul )endifelseif ( quadrant <= 2 )set xmul to ( -1 * xmul )elseset xmul to ( -1 * xmul )set ymul to ( -1 * ymul )endifendif;=============================================================================; Calculate and position/rotate horse direction *DO NOT TOUCH THIS PORTION*;=============================================================================set timer to ( timer + GetSecondsPassed )if ( timer > 0.1 )set timer to 0if ( clockwise == 1 )if ( zzangle <= 0.5 )face 0, 100000000elseif ( zzangle <= 10.5 )face 17364810, 98480770elseif ( zzangle <= 20.5 )face 34202010, 93969260elseif ( zzangle <= 30.5 )face 50000000, 86602540elseif ( zzangle <= 40.5 )face 64278760, 76604440elseif ( zzangle <= 50.5 )face 76604440, 64278760elseif ( zzangle <= 60.5 )face 86602540, 50000000elseif ( zzangle <= 70.5 )face 93969260, 34202010elseif ( zzangle <= 80.5 )face 98480770, 17364810elseif ( zzangle <= 90.5 )face 100000000, 0elseif ( zzangle <= 100.5 )face 98480770, -17364810elseif ( zzangle <= 110.5 )face 93969260, -34202010elseif ( zzangle <= 120.5 )face 86602540, -50000000elseif ( zzangle <= 130.5 )face 76604440, -64278760elseif ( zzangle <= 140.5 )face 64278760, -76604440elseif ( zzangle <= 150.5 )face 50000000, -86602540elseif ( zzangle <= 160.5 )face 34202010, -93969260elseif ( zzangle <= 170.5 )face 17364810, -98480770elseface 0, -100000000endifelseif ( zzangle <= 0.5 )face 0, 100000000elseif ( zzangle <= 10.5 )face -17364810, 98480770elseif ( zzangle <= 20.5 )face -34202010, 93969260elseif ( zzangle <= 30.5 )face -50000000, 86602540elseif ( zzangle <= 40.5 )face -64278760, 76604440elseif ( zzangle <= 50.5 )face -76604440, 64278760elseif ( zzangle <= 60.5 )face -86602540, 50000000elseif ( zzangle <= 70.5 )face -93969260, 34202010elseif ( zzangle <= 80.5 )face -98480770, 17364810elseif ( zzangle <= 90.5 )face -100000000, 0elseif ( zzangle <= 100.5 )face -98480770, -17364810elseif ( zzangle <= 110.5 )face -93969260, -34202010elseif ( zzangle <= 120.5 )face -86602540, -50000000elseif ( zzangle <= 130.5 )face -76604440, -64278760elseif ( zzangle <= 140.5 )face -64278760, -76604440elseif ( zzangle <= 150.5 )face -50000000, -86602540elseif ( zzangle <= 160.5 )face -34202010, -93969260elseif ( zzangle <= 170.5 )face -17364810, -98480770elseface 0, -100000000endifendifendif;=============================================================================; Horse movement;=============================================================================if ( pressed2 == 0 )if ( GetPCRunning == 1 )set pressed2 to 1endifelseif ( GetPCRunning == 0 )if ( running == 0 )set running to 1elseset running to 0endifset pressed2 to 0endifendifif ( player -> GetSpellReadied == 1 )set zfly to zfly + 10setpos z zflyelseif ( player -> GetWeaponDrawn == 1 )set zfly to getpos zif ( getspell "_flying" == 0 )addspell _flyingremovespell _fallingendifelseif ( player -> GetWeaponDrawn == 0 )if ( player -> GetSpellReadied == 0 )set zfly to getpos zif ( getspell "_falling" == 0 )addspell _fallingremovespell _flyingendifendifendifif ( running == 1 )if ( pressed == 3 )set pressed to 0stopsound "choco_call" ; disable this if you do not need thiselseif ( pressed == -1 )if ( GetPCSneaking == 0 )set pressed to 0endifendifif ( walkrunmode == 0 )playgroup walkforward 2set xx to ( getpos, x + ( 10 * xmul ) ); trot speed can be adjusted hereset yy to ( getpos, y + ( 10 * ymul ) ); trot speed can be adjusted hereif ( GetSoundPlaying, "_trot" == 0 )playloopsound3D "_trot" ; disable this if you do not need thisendifelseif ( walkrunmode == 1 )if ( pressed <= 3 )playgroup runforward 2set xx to ( getpos, x + ( horsespeed * xmul ) )set yy to ( getpos, y + ( horsespeed * ymul ) )if ( GetSoundPlaying, "_run" == 0 )playloopsound3D "_run" ; disable this if you do not need thisendifendifendifsetpos, x, xxsetpos, y, yysetAngle, z, zangleset zz to ( getpos, z + pheight )set xx to ( xx + ( frontbackposition * xmul ) )set yy to ( yy + ( frontbackposition * ymul ) )"player"->setpos, x, xx"player"->setpos, y, yy"player"->setpos, z, zzplayer -> fallif ( zz < ( pheight - 70 ) ); set allowable water heightset dismount to 2endifset doOnce to 2elseif ( doOnce == 0 )if ( walkrunmode == 1 )playsound "choco_call" ; disable this if you do not need thisendifset doOnce to 1elseif ( doOnce == 2 )set doOnce to 0 endifif ( pressed <= 1 )playgroup idle 1stopsound "_run" ; disable this if you do not need thisstopsound "_trot" ; disable this if you do not need thisset xx to getpos, xset yy to getpos, ysetAngle, z, zangleset zz to ( getpos, z + pheight )set xx to ( xx + ( frontbackposition * xmul ) )set yy to ( yy + ( frontbackposition * ymul ) )"player"->setpos, x, xx"player"->setpos, y, yy"player"->setpos, z, zzplayer -> fallendifendif;=============================================================================; Using SNEAK key to change horse movement mode;=============================================================================if ( pressed == 0 )if ( GetPCSneaking == 1 )set timer2 to 0set pressed to 1endifelseif ( pressed == 1 )set timer2 to ( timer2 + GetSecondsPassed )if ( GetPCSneaking == 0 )if ( walkrunmode == 0 )set walkrunmode to 1messagebox "RUN MODE"elseset walkrunmode to 0messagebox "TROT MODE"endifstopsound "_run" ; disable this if you do not need thisstopsound "_trot" ; disable this if you do not need thisset pressed to 0elseif ( timer2 > 1 )stopsound "_run" ; disable this if you do not need thisstopsound "_trot" ; disable this if you do not need thisset timer2 to 0if ( walkrunmode == 0 )set running to 0set pressed to 2; playgroup idle7 1 ; this is the special move function. Just put in the animation group that you want to show here or disable itelseif ( running == 0 )set pressed to 0elseplayer->EnableLevitationset timer2 to 0set pressed to 4; playsound "choco_call" ; disable this if you do not need thisendifendifendifendifelseif ( pressed == 2 )if ( GetPCSneaking == 0 )set pressed to 0elseset timer2 to ( timer2 + GetSecondsPassed )if ( timer2 < 1.5 ); set xx to ( getpos, x - ( 55 * xmul ) ) ; disable this if special move is not required; set yy to ( getpos, y - ( 55 * ymul ) ) ; disable this if special move is not required; set zz to ( getpos, z + pheight + 25 ) ; disable this if special move is not required"player"->setpos, x, xx"player"->setpos, y, yy"player"->setpos, z, zzplayer -> fallelseset pressed to 3playgroup idle 1endifendifelseif ( pressed == 3 )if ( GetPCSneaking == 0 )set pressed to 0endifset xx to ( getpos, x )set yy to ( getpos, y )set zz to ( getpos, z + pheight )set xx to ( xx + ( frontbackposition * xmul ) )set yy to ( yy + ( frontbackposition * ymul ) )"player"->setpos, x, xx"player"->setpos, y, yy"player"->setpos, z, zzplayer -> fallelseif ( pressed == 4 )stopsound "_run"addspell, "ridingspell2"set zz to ( getpos, z + 30 )setpos, z, zzset zz to ( zz + pheight )"player"->setpos, z, zzset pressed to 5addspell, ridingspell3elseif ( pressed == 5 )set timer2 to ( timer2 + GetSecondsPassed )if ( timer2 < 0.5 )set zz to ( getpos, z + 10 )setpos, z, zzelseif ( timer2 > 1.8 )removespell, "ridingspell3"set pressed to -1set timer2 to 0player->DisableLevitationelseremovespell, ridingspell2endifset xx to ( getpos, x + ( ( horsespeed - 10 ) * xmul ) )set yy to ( getpos, y + ( ( horsespeed - 10 ) * ymul ) )setpos, x, xxsetpos, y, yyset zz to ( getpos, z + pheight + 20 )set xx to ( xx + ( frontbackposition * xmul ) )set yy to ( yy + ( frontbackposition * ymul ) )"player"->setpos, x, xx"player"->setpos, y, yy"player"->setpos, z, zzplayer -> fallendif;=============================================================================; Detect creature death and stop riding;=============================================================================if ( GetHealth <= 0 )set dismount to 1endif;=============================================================================; Dismount horse;=============================================================================if ( OnActivate == 1 )set dismount to 1endifif ( dismount > 0 )stopsound "_run" ; disable this if you do not need thisstopsound "_trot" ; disable this if you do not need thisplaysound "choco_call" ; disable this if you do not need thisplaygroup idle 1set ridingmode to 0set running to 0"player"->removespell, "ridingspell""player"->EnableLevitationif ( getspell "_falling" == 0 )addspell _fallingremovespell _flyingendifif ( dismount == 1 )messagebox "Dismount"elsemessagebox "You cannot ride a chocobo underwater"endifAiWander, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0set walkrunmode to 0set dismount to 0fixmeendifEnd _Chocobo_fly_ride

User avatar
trisha punch
 
Posts: 3410
Joined: Thu Jul 13, 2006 5:38 am

Post » Thu Aug 20, 2009 9:15 pm

Ok, both scripts require player sneaking to ride, assuming your greens have for instance rwchGreens as ID, we could try changing
if ( GetPCSneaking == 1 )	; this opens up the command menu	Activate	returnendif
to
if ( GetPCSneaking )	 ; activate + sneak opens up the command menu	if ( player->GetItemCount "rwchGreens" > 0 )    ;  if greens player has greens...		setflee 20  ; reset normal flee		Activate  ; normal activation	else		setflee 1000  ; increase flee		messagebox "The chocobo seems scared of you......"	endif	returnendif

You could probably also make it run away from a distance if player has no greens changing the lines
if ( CellChanged )	AiWander 0 0 0 0 0 0 0 0 0 0 0endif
to
if ( CellChanged )	AiWander 0 0 0 0 0 0 0 0 0 0 0	if ( ridingmode == 0 )		if ( player->GetItemCount "rwchGreens" > 0 )			setflee 20		else			setflee 1000		endif	endifendif
[EDIT]added second code
User avatar
Jon O
 
Posts: 3270
Joined: Wed Nov 28, 2007 9:48 pm

Post » Fri Aug 21, 2009 7:00 am

Wait, where was the flying script in his mod?
User avatar
jasminε
 
Posts: 3511
Joined: Mon Jan 29, 2007 4:12 am

Post » Thu Aug 20, 2009 9:57 pm

Wait, where was the flying script in his mod?


You are seeing Lingarn's work in the flying modification. For his flying chocobo. :)
User avatar
Marnesia Steele
 
Posts: 3398
Joined: Thu Aug 09, 2007 10:11 pm

Post » Thu Aug 20, 2009 6:36 pm

You are seeing Lingarn's work in the flying modification. For his flying chocobo. :)


Though to be fair, the most I did was modify an existing script, likely with help. MadMax deserves the real credit, which thankfully is included in the code.
User avatar
M!KkI
 
Posts: 3401
Joined: Sun Jul 16, 2006 7:50 am


Return to III - Morrowind