Jump to content

Help with creating a script for messagebox


Andyno

Recommended Posts

It's woking! Many thanks! :thumbsup:

 

Now I'd like to try something similar, but with more options. This will be for mod ending. Not sure if you played original STALKER game, but there was a Wish Granter that player could use. More info here:

https://stalker.fandom.com/wiki/S.T.A.L.K.E.R.:_Shadow_of_Chernobyl_endings

In the game it was handeled somehow differently (automatic / based on player gameplay), but I decided to give the player to actual really make a wish. I think this is the best way to reward a player for finishing my mod, and it also brings homage to the original title. Its messagebox should look like this:

 

wg.jpg

I'll probably add some more options, this is only for making a picture... After the player will choose one of the options, he will be teleported to TZEndWishGranterMarkerRef. The initial Wish Granter should be also an Activator.

 

What do you think?

Link to comment
Share on other sites

That's more complicated but basically in the same vein and doable. I have never added Specials to the player and am too lazy to look up how, so someone else might chime in.

 

The last thing (+20hp) would be done via a perk, that adds a constant health spell though.

 

Question is is it done via a button / triggerzone /Quest... etc

Link to comment
Share on other sites

This can all be done with script, not too complicated. Again, it depends on what you're going to attach the script to for what event you're going to use. If it's an activator again the script would look like this:

 

MiscObject Property Caps 001 
Message Property TZEndWishGranterMessage Auto 
Actor Property PlayerRef Auto
ActorValue Property Strength Auto 
ActorValue Property Endurance Auto 
ActorValue Property Agility Auto 
ActorValue Property Health Auto 

Event OnActivate(ObjectReference akActionRef)
    If (akActionRef as actor) == PlayerRef 
        Int Button = TZEndWishGranterMessage.Show()
        If Button == 0
            PlayerRef.AddItem(Caps001, 50000)
        Elseif Button == 1
            PlayerRef.ModValue(Strength, 1)
        Elseif Button == 2
            PlayerRef.ModValue(Endurance, 1)
        Elseif Button == 3
            PlayerRef.ModValue(Agility, 1)
        Elseif Button == 4
            PlayerRef.ModValue(Health, 20)
        Endif 
    Endif 
EndEvent
Edited by dylbill
Link to comment
Share on other sites

Looks pretty straightforward. :thumbsup:

But what about the teleportation? Would it suffice if I add a line to Property section, and also below every ModValue? So the final script should look like this...?

MiscObject Property Caps 001 
Message Property TZEndWishGranterMessage Auto 
ObjectReference Property TZEndWishGranterMarkerRef Auto
Actor Property PlayerRef Auto
ActorValue Property Strength Auto 
ActorValue Property Endurance Auto 
ActorValue Property Agility Auto 
ActorValue Property Health Auto 

Event OnActivate(ObjectReference akActionRef)
    If (akActionRef as actor) == PlayerRef 
        Int Button = TZEndWishGranterMessage.Show()
        If Button == 0
            PlayerRef.AddItem(Caps001, 50000)
            PlayerRef.MoveTo(TZEndWishGranterMarkerRef)
        Elseif Button == 1
            PlayerRef.ModValue(Strength, 1)
            PlayerRef.MoveTo(TZEndWishGranterMarkerRef)
        Elseif Button == 2
            PlayerRef.ModValue(Endurance, 1)
            PlayerRef.MoveTo(TZEndWishGranterMarkerRef)
        Elseif Button == 3
            PlayerRef.ModValue(Agility, 1)
            PlayerRef.MoveTo(TZEndWishGranterMarkerRef)
        Elseif Button == 4
            PlayerRef.ModValue(Health, 20)
            PlayerRef.MoveTo(TZEndWishGranterMarkerRef)
        Endif 
    Endif 
EndEvent

 

Edited by Andyno
Link to comment
Share on other sites

Yes that would work. An easier way to do it though for future reference is to just put that line at the bottom of the script so you don't have to copy it multiple times.

 

MiscObject Property Caps 001 
Message Property TZEndWishGranterMessage Auto 
ObjectReference Property TZEndWishGranterMarkerRef Auto
Actor Property PlayerRef Auto
ActorValue Property Strength Auto 
ActorValue Property Endurance Auto 
ActorValue Property Agility Auto 
ActorValue Property Health Auto 

Event OnActivate(ObjectReference akActionRef)
    If (akActionRef as actor) == PlayerRef 
        Int Button = TZEndWishGranterMessage.Show()
        If Button == 0
            PlayerRef.AddItem(Caps001, 50000)
        Elseif Button == 1
            PlayerRef.ModValue(Strength, 1)
        Elseif Button == 2
            PlayerRef.ModValue(Endurance, 1)
        Elseif Button == 3
            PlayerRef.ModValue(Agility, 1)
        Elseif Button == 4
            PlayerRef.ModValue(Health, 20)
        Endif 
        
        PlayerRef.MoveTo(TZEndWishGranterMarkerRef)
    Endif 
EndEvent
Link to comment
Share on other sites

  • 3 weeks later...

I tried to improve immersion of my 1st script by adding a sound effect, but it doesn't want to succeed in compiling the script.

I added the line "PlaySound (DRSVertibirdFlightLoadOpen)" above the "PlayerRef.MoveTo(TZStartVertibirdMarkerRef)" line, but it looks like it's missing something (possibly some Properties?)
Can someone help me out with this, please?

Link to comment
Share on other sites

Sorry, but I don't understand.

 

Where should I put those lines? Are actually both lines needed?

What does this mean: (PlayerRef) and (Self)? It looks like important but you suggest to replace it with (DRSVertibirdFlightLoadOpen)?

So it doesn't need to be something specified in the properties section?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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