Deleted81892User Posted December 11, 2009 Share Posted December 11, 2009 Does anyone know how to make a script reduce a float value in another script by a specific amount, is it possible/easy?scripting it the same way as to change a 'short' does not work. these are the relevant parts of my scripts (which work in place): --------------------------------------------------;this is for a potion effect scn VTWEAKvampirefeedscript ref vampirefeedREF Begin ScriptEffectFinishset vampirefeedREF to GetSelf If ( PCVampire >= 1 && vampirefeedREF.GetIsReference Player == 1 ) set VTWEAKhungry.hungry -50 ;##this line not work## MessageBox "That hits the spot!!" endifend --------------------------------------------------;part of vampirescript If ( PCVampire >= 1 ) if ( Player.HasVampireFed == 1 ) set VTWEAKhungry.hungry -100 ;##this line not work## MessageBox "Your hunger for blood has been satisfied... for now." endifendif --------------------------------------------------;hungry timer script excerpt scn VTWEAKhungryscript float hungryfloat fQuestDelayTime begin gameMode set fQuestDelayTime to 0.001 if (pcvampire <=0 ) returnendif if (pcvampire >= 1 ) if ( hungry < 180 ) ;this is a plceholder time until i get things running smoothly set hungry to hungry + getsecondsPassed else Message "you are hungry" endifendif---------------------------------------------------- any suggestions will be appreciated Link to comment Share on other sites More sharing options...
David Brasher Posted December 12, 2009 Share Posted December 12, 2009 In Oblivion scripting language, variables do not seem to readily carry over from one script to another unless they are global variables. Have you tried it with global variables yet? Link to comment Share on other sites More sharing options...
QQuix Posted December 12, 2009 Share Posted December 12, 2009 Rules are the same for shorts, floats, refs, etc In your case, you forgot the "to". Should be "set VTWEAKhungry.hungry TO -100 " Link to comment Share on other sites More sharing options...
Deleted81892User Posted December 12, 2009 Author Share Posted December 12, 2009 Qquix- i tried that, it does not recognise the 'hungry' variable :( David - i had not tried a global.... but just tried your suggestion and it works, thanks!! ......but... i would like to be able to REDUCE the amount rather than SET it to something if possible, any ideas? Link to comment Share on other sites More sharing options...
DavidBudreck Posted December 12, 2009 Share Posted December 12, 2009 Set someting to whatever it currently is - whatever you want to reduce SET variable TO variable - value Link to comment Share on other sites More sharing options...
Deleted81892User Posted December 12, 2009 Author Share Posted December 12, 2009 that sorts it, thanks! Link to comment Share on other sites More sharing options...
Recommended Posts