| Mirage Source http://web.miragesource.net/forums/ |
|
| NPC Movement Frequency http://web.miragesource.net/forums/viewtopic.php?f=210&t=3489 |
Page 1 of 1 |
| Author: | Jacob [ Sat Mar 15, 2008 12:19 am ] |
| Post subject: | NPC Movement Frequency |
This will add a scroll bar to control the frequency of npc movement. This was only tested on MSE1. Difficulty: 1/5 ::Server Side:: modGeneral Sub GameAi Search for Code: i = Int(Rnd * 5) Replace with Code: i = Int(Rnd * Npc(NpcNum).Movement) + 1 modTypes NpcRec add: Code: Movement As Byte modDatabase Sub LoadNpcs add: Code: Npc(i).Movement = Val(GetVar(FileName, "NPC" & i, "Movement")) Sub SaveNpc add: Code: Call PutVar(FileName, "NPC" & NpcNum, "Movement", Trim$(Npc(NpcNum).Movement)) modServerTcp sub SendEditNpcTo add and the end of the packet Code: Npc(NpcNum).Movement modHandleData find "savenpc" add Code: Npc(N).Movement = Val(Parse$(15)) ::Client Side:: modHandleData find "updatenpc" add Code: Npc(n).Movement = 0 find "editnpc" add Code: Npc(n).Movement = Val(Parse$(15)) modTypes find NpcRec add Code: Movement as Byte modGameLogic Sub NpcEditorInit add Code: frmNpcEditor.scrlMovement.Value = Npc(EditorIndex).Movement sub NpcEditorOk add Code: Npc(EditorIndex).Movement = frmNpcEditor.scrlMovement.Value modClientTCP sub sendsavenpc Add to the end of the packet Code: .Movement Add a scroll bar in frmNpcEditor for the movement Add a label for displaying the movement number Add Code: Private Sub scrlMovement_Change() lblMovement.Caption = (scrlMovement.Value) End Sub If there any errors please let me know. |
|
| Author: | Becoming [ Sat Mar 15, 2008 2:45 am ] |
| Post subject: | Re: NPC Movement Frequency |
any max for the scroll bar ? and can you define frequency ? |
|
| Author: | Matt [ Sat Mar 15, 2008 2:46 am ] |
| Post subject: | Re: NPC Movement Frequency |
I would assume how often they move. |
|
| Author: | Jacob [ Sat Mar 15, 2008 2:58 am ] |
| Post subject: | Re: NPC Movement Frequency |
I put a max of 254 on my scroll bar. Perfekt is right about frequency. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|