steve40 Posted September 28, 2012 Share Posted September 28, 2012 There's a bug in the script. The first entry# in an array is array[0], so the last entry# is always array[length - 1], not array[length] :) What does that mean? keep in mind that i am in no way a scripter. i only know enough to slightly understand what these scripts do at a glance. Compare the change that I made to the script: Old: int randomMarker = utility.RandomInt(0, teleportMarkers.length) New: int randomMarker = utility.RandomInt(0, teleportMarkers.length - 1) If an array has 10 elements but the first one is number 0, then the last one is number 9, not number 10. Understand? Also, the OnHit() part of the script can be simplified and made more efficient like this: event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) float fHealthPercent = getAVPercentage("health") if stage == 0 && fHealthPercent <= 0.75 stage += 1 MistPhase() elseif stage == 1 && fHealthPercent <= 0.25 stage += 1 MistPhase() endif endEvent Link to comment Share on other sites More sharing options...
steve40 Posted September 28, 2012 Share Posted September 28, 2012 I have another Request if you guys dont mind. This one should be simple (i think). I would like a script that will do the following: on combat start with a specific enemy actor make a static object appear. that static object would then only be able to be deactivated by an activator (such as a lever). the goal of this is to lock the player in a certain area for a boss fight then have the boss drop the key to open the door where the lever is located I dont know if its proper to have multiple posts for multiple script requests or just have them in one post? You could probably set this up in the CK without scripts. You could use a trigger primitive to bar the exits when the player enters the room, and have the key set as a "death item" on the boss. Link to comment Share on other sites More sharing options...
Vandrath Posted September 28, 2012 Author Share Posted September 28, 2012 (edited) I tested the boss with the int random marker=utility part of the script changed but the boss is still not reappearing on the Xmarker heading. Do i need to be using another type of marker? I am testing the boss in a single room cell with the teleport x markers in one of each of the 4 corners of the room. Do i have to fill my arrays with 10 markers for that part of the script to run? Edited September 28, 2012 by Vandrath Link to comment Share on other sites More sharing options...
Vandrath Posted September 28, 2012 Author Share Posted September 28, 2012 You could probably set this up in the CK without scripts. You could use a trigger primitive to bar the exits when the player enters the room, and have the key set as a "death item" on the boss. I know. The reason i asked for that script is because i wanted to use one of the Soul cairns purple shields as a block to give the final part of the dungeon a bit more flare. Link to comment Share on other sites More sharing options...
steve40 Posted September 28, 2012 Share Posted September 28, 2012 I tested the boss with the int random marker=utility part of the script changed but the boss is still not reappearing on the Xmarker heading. Do i need to be using another type of marker? I am testing the boss in a single room cell with the teleport x markers in one of each of the 4 corners of the room. Do i have to fill my arrays with 10 markers for that part of the script to run? No, you can set as many markers as you want (up to 128 if using an array). So if you add 4 markers, they will be assigned as teleportMarkers[0], teleportMarkers[1], teleportMarkers[2] and teleportMarkers[3]I don't know why the moveto isn't working, unless the array property isn't being set correctly. You are assigning the four individual marker refs that you placed in the render window, right? And you are assigning them to the first 4 entries in the teleportMarkers array property (# 0 to 3)? Link to comment Share on other sites More sharing options...
Vandrath Posted September 28, 2012 Author Share Posted September 28, 2012 (edited) Yes, 0 to 3 and its still not working. the testing room is small (i took 4 dlc castle large room corner pieces and stuck them together) could it be that the markers have to be placed at a greater distance in order for the game to actually place the actor at the x marker. I would like the mist to be set as initially disabled (the mist will start invisible and then be triggered at the first vanish) currently the mist is always there until the script is run (this is just optional but it would help with the realism of the fight and the lore surrounding it).Also i would like to add a visual effect if thats possible. the effect would play when the boss disappears and re appears. I recall seeing something about a line of script that will allow you too define in the properties of the script which visual you would like. I dont know if its that cut and dry mechanically. edit: a thought just occured. can i just check the initially disabled button on the mistfx itself or will that break the script in some way? Edited September 28, 2012 by Vandrath Link to comment Share on other sites More sharing options...
Sjogga Posted September 28, 2012 Share Posted September 28, 2012 Visual effects are implemented like this VisualEffect Property fx Event someEvent() ;some code Fx.play(myRef, 2.0) ;rest of code EndEvent In your case, myRef should be "self" Link to comment Share on other sites More sharing options...
Vandrath Posted September 28, 2012 Author Share Posted September 28, 2012 for Fx.play will that allow me to select the effect i want in the script properties? I would like the FX to play around the enemy actor. Will it still play around the actor if i set myref to "self"? Link to comment Share on other sites More sharing options...
Sjogga Posted September 29, 2012 Share Posted September 29, 2012 Yes, you can select you effect from the properties window.Yes, "self" refers to the owner of the script, in this case your boss. Just remember to remove the quotes. Link to comment Share on other sites More sharing options...
Vandrath Posted September 29, 2012 Author Share Posted September 29, 2012 (edited) This is the current script i have so far. Where would i place the visual effect property and the fx.play? Scriptname BossFight extends Actor ObjectReference Property Mist auto ; set to the mist ObjectReference[] Property teleportMarkers auto ; fill the array with teleport markers int stage = 0 event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) float fHealthPercent = getAVPercentage("health") if stage == 0 && fHealthPercent <= 0.75 stage += 1 MistPhase() elseif stage == 1 && fHealthPercent <= 0.25 stage += 1 MistPhase() endif endEvent function MistPhase() disableNoWait(True) ; fades-out the actor without pausing the script. mist.enable(True) ; fades-in the mist. The script pauses until the fade-in has completed. utility.wait(10.0) int randomMarker = utility.RandomInt(0, teleportMarkers.length - 1) ; don't forget that the first item# in the array is ZERO, so the last item# is "length - 1" moveTo(teleportMarkers[randomMarker]) mist.disableNoWait(True) ; fade-out the mist without pausing the script enableNoWait(True) ; fade-in the actor without pausing the script I would also like to add a sound effect that plays along with the visual effect. Once again i dont have the slightest clue how to do that. Edited September 29, 2012 by Vandrath Link to comment Share on other sites More sharing options...
Recommended Posts