Jump to content

Recommended Posts

Posted (edited)
  On 3/28/2019 at 12:34 AM, TobiaszPL said:

2. you can always stop loop when player leave cell

Sure, you could always do something like:

Event OnCellAttach()

	Actor playerRef = Game.GetPlayer()
	Cell playerCell = playerRef.GetParentCell()
	float halfHealth = GetBaseActorValue("Health") * 0.5
	
	Cell myCell = GetParentCell()
	
	while (GetActorValue("Health") > halfHealth && IsDead() == false && myCell == playerCell)
		Utility.Wait(1.0)
	endWhile

	if ((GetActorValue("Health") <= halfHealth || IsDead() == true) && myCell == playerCell)
		YourContainer.Enable()
	endif
	
endEvent
  On 3/28/2019 at 12:34 AM, TobiaszPL said:

3. for what you need function if you can use math ?

I called it a "convenience function" for a reason.

 

  On 3/28/2019 at 12:41 AM, ReDragon2013 said:

Dear Reneer,

 

you posted:

if (GetActorValuePercentage("Health") <= 50 || IsDead() == true)
I believe it should be as follow

if (GetActorValuePercentage("Health") <= 0.5 || IsDead() == true)
you give answer:

3. GetActorValuePercentage isn't "useless" it is simply a convenience function.
GetActorValuePercentage is native function, GetAVPercentage is the convenience function

 

I have rewritten your sample code as follow:

EnableTrigger50pActorScript

  Reveal hidden contents

 

 

EnableTrigger50pScript

  Reveal hidden contents

 

GetActorValuePercentage is a Native function, true, but I meant "convenience function" in the sense that you use the function instead of doing all the math yourself. And yes, there were some errors in the code I wrote. I hashed out the code in a few minutes. It was meant as a quick example for maxarturo to build upon. But thank you for pointing out the mistake.

Edited by Reneer
Posted

I'm not from england / america / canada so my english is potato...

i dont event know what "convenience " mean... :x

 

Actor playerRef = Game.GetPlayer()

 

better version is

 

Actor Property PlayerRef Auto

cause u dont waste time for function xD

 

but ok idc, not gonna read this topic any more :x...

 

my language is Polish and little Russian and English :)

and well some German French and Japan cause i have few friends from this countries so they teach me sometimes xD

 

last time Shaurows teach me that canada is not only English but French too in few places :P lel

 

 

GL with this Script and bye !...

Posted
Thanks a lot guys for all of your suggestions !!.


I'll check them all & test them all in a few days, right now i can't because i think i'm coming down with something... i'm not feeling too good... and i think fever is knocking at my door...


Again thank you all for taking the time to look at this !.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...