Mooper 99 Posted July 9, 2011 Share Posted July 9, 2011 Im trying to make a couch co-op MP mod. It is almost like GTA: SA. Well anyway, it started when I decided to make it. I used the Master of Puppets mod as my base. So then, I tinked with the script and I almost have it! I can only get the NPC to move Forward and Backwards. I request that someone will help me because I am a very bad scripter. I just need it so you can make the NPC to cast a spell and turn. Here is the code: scn PMControlQuestSCRIPT ref me ; the controlled creature float xfactme ; position in X float yfactme ; position in Y float zfactme ; position in Z float xfact ; position in X float yfact ; position in Y float zfact ; position in Z float height ; position in Z added depending on Xangle float speedmod ; how far the player is placed from the creature float direc ; angle in Z float angle ; used to set the angle of the fof to the players float Xangle ; angle player is looking - upp and + down short attackactivated ; is the creature attacking 1 short transformback ; used to transfor back to normal 1 Short attackingcreature ; is 1 if the creature can attack need to be 1 for attacks short started ; has the quest started float fQuestDelayTime float movemod float distance float distanceZ float distance5 float distanceZ5 float distance6 float distanceZ6 float distance7 float distanceZ7 float health short runtoggle ref source float MORPHcrime short moving float dist2 float dist ref source1 ref source2 short activatecounter Begin Gamemode ; when quest starts if started == 0 player.addspell PMControlSpell set distance to -2 set distance5 to -2 set distance6 to -2 set distance7 to -2 set started to 1 set fQuestDelayTime to 0.001 StopQuest PMControllQuest endif if transformback == 1 && me != 0 player.SetActorAlpha 1 player.setghost 0 player.UnequipItem torch02 EnablePlayerControls player.addspell PMcontrolAB set fQuestDelayTime to 0.001 set transformback to 2 me.SetUnconscious 0 elseif transformback == 2 set fQuestDelayTime to 0.001 if moving >= 1 && moving <= 9 set moving to moving + 1 me.RemoveScriptPackage me.AddScriptPackage PMControldummyPac elseif moving == 10 set moving to 1 me.RemoveScriptPackage endif if player.Getdistance me > 1500 set moving to 1 me.moveto player endif if activatecounter >= 1 && activatecounter < 10 set activatecounter to activatecounter + 1 elseif activatecounter == 10 set activatecounter to 0 endif if iskeyPressed 32 == 1 && activatecounter == 0 set dist2 to 70 ; changing distance from player set source1 to me.PlaceAtMe PMControlActivator, 1, dist2, 0 set zfact to me.GetPos z set zfact to zfact + 100 source1.SetPos z, zfact set zfact to zfact - dist if dist < 0 set dist to 0 - dist endif set dist to 89 + dist2 - dist set source2 to me.PlaceAtMe PMControlActivator, 1, dist, 0 source2.SetPos z, zfact source1.Cast PMControlActivateSpell source2 source1.disable source2.disable set activatecounter to 1 endif set xfactme to me.GetPos x set yfactme to me.GetPos y set zfactme to me.GetPos z set direc to me.GetAngle z set angle to player.getangle z if health > me.GetAV health triggerHitShader 2 endif set health to me.GetAV health if IsKeyPressed 13 == 1 ; enter set transformback to 3 endif ; distance from player to morph--------------------------------- if IsKeyPressed 49 == 1 ;1 key set distance to distance + 0.05 elseif IsKeyPressed 50 == 1 ;2 key set distance to distance - 0.05 elseif IsKeyPressed 51 == 1 ;3 key set distanceZ to distanceZ + 1 elseif IsKeyPressed 52 == 1 ;4 key set distanceZ to distanceZ - 1 endif if distance > 9999 set distance to 3 elseif distance < -9999 set distance to -5 endif if distanceZ > 300 set distanceZ to 300 elseif distanceZ < -200 set distanceZ to -200 endif ;save settings for position 5 6 7 on 8 9 0 and return on backspace--------------------- if IsKeyPressed 56 == 1 ;8 key set distance5 to distance set distanceZ5 to distanceZ endif if IsKeyPressed 57 == 1 ;9 key set distance6 to distance set distanceZ6 to distanceZ endif if IsKeyPressed 48 == 1 ;0 key set distance7 to distance set distanceZ7 to distanceZ endif if IsKeyPressed 53 == 1 ;5 key set distance to distance5 set distanceZ to distanceZ5 endif if IsKeyPressed 54 == 1 ;6 key set distance to distance6 set distanceZ to distanceZ6 endif if IsKeyPressed 55 == 1 ;7 key set distance to distance7 set distanceZ to distanceZ7 endif if IsKeyPressed 8 == 1 ;backspace set distance to -2 set distanceZ to 0 endif ;movement animation control for the CREATURE------------------------------------------- ; standard run or walk if IsKeyPressed 20 == 1 ; caps lock set runtoggle to 1 elseif IsKeyPressed 9 == 1 ; tab set runtoggle to 0 endif if IsKeyPressed 65 == 1 ;A key me.PlayGroup turnleft, 1 elseif IsKeyPressed 68 == 1 ;D key me.PlayGroup turnright, 1 elseif IsKeyPressed 87 == 1 && IsKeyPressed 16 == 1 ;W and shift if runtoggle == 0 me.PlayGroup fastforward, 1 else me.PlayGroup forward, 1 endif elseif IsKeyPressed 87 ;W only if runtoggle == 0 me.PlayGroup forward, 1 else me.PlayGroup fastforward, 1 endif elseif IsKeyPressed 83 == 1 ; S key me.PlayGroup backward, 1 else if me.IsAnimPlaying == 1 me.PlayGroup idle, 1 else me.pickidle endif endif if direc < 0 set angle to 360 - angle elseif direc > 360 set angle to angle - 360 endif player.SetScale 1.0 if me.getdead == 1 set transformback to 3 endif elseif transformback == 3 me.PlayGroup idle, 1 player.SetScale 1.0 player.setghost 0 EnablePlayerControls player.SetActorAlpha 1.0 set transformback to 4 elseif transformback == 4 player.removespell PMcontrolAB set fQuestDelayTime to 1 player.PlayMagicShaderVisuals effectSummonMythicDawn 1 set transformback to 5 me.SetUnconscious 0 elseif transformback == 5 set fQuestDelayTime to 0.001 set MORPHcrime to 0 set me to 0 StopQuest PMControllQuest set transformback to 0 me.pickidle endif end Link to comment Share on other sites More sharing options...
David Brasher Posted July 11, 2011 Share Posted July 11, 2011 What are "couch co-op MP" and "GTA: SA?" Link to comment Share on other sites More sharing options...
Recommended Posts