Jump to content

Quick Question - Quick Answer


Cipscis

Recommended Posts

Quick Question - Quick Answer

 

This thread is for all those small modding questions that need asking, but might not feel big enough for a thread of their own. If you have a modding question that you think could be answered in just one or two posts, this thread is a good place to ask it. Of course, different people will be able to answer questions on different topics, so anyone and everyone is encouraged to join in and answer questions.

 

Here are some do's and don't's about posting in this thread. Don't take them too seriously though - they're just meant as guidelines and their intention is to help, not to hinder:

 

Do...

  • keep the forum rules in mind when posting, especially when it comes to trolls and flaming - just use the "report" button and don't respond to them
  • make your question clear - you'll be able to receive an answer more quickly if no one has to ask you to clarify yourself or provide more information
  • ask for clarification of a question or answer if you think it's required
  • answer questions - if you see a question that you think you can help with, go ahead and answer it. After all, that's what this thread is for!
  • be civil and polite - no one will want to help you if you're rude
  • scan the last few questions before you ask your own - you might find an answer to your question before you even ask it
  • use good spelling and punctuation - no one is likely to answer your question if they have to decode it first, so no "txt" language or "1337-5p34k" here please
  • "bump" a question if it appears to have been missed - probably wait until it's at least a page or two deep until you bump it though
  • let us know if you figure out the answer on your own. That way, if someone is searching for the answer to your problem, they'll be able to find your solution posted here

Don't...

  • ask questions that are likely to require a lot of troubleshooting - if a question will probably take more than one or two posts to answer then you should start a new thread for it
  • ask questions about using mods - this thread is for answering questions about creating mods
  • make a new thread about your question and ask it here - if a question is asked in multiple places then it can be much more difficult to answer as the information is not consolidated in one place
  • be afraid to ask a question - as cheesy as it may sound, there really is no such thing as a stupid question

Useful resources:

GECK Wiki

cipscis.com

If there's anything that you'd like me to add to this post, particularly in the "Useful resources" section, just send me a PM.

If my inbox is full or I don't reply for a while, you can email me at [email protected]

 

Cipscis

Link to comment
Share on other sites

  • Replies 804
  • Created
  • Last Reply

Top Posters In This Topic

Can you tell me whats wrong with my Script, I made a thread, but no ones responding and I REALLY need help with it.

 

It needs to be able to give me different weapons depending on what button I push in the message box.

 

Thanks.

 

SCN PhaserScript

Short ButtonPressed

Begin ScriptEffectStart

ShowMessage PhaserMessage

END

Begin ScriptEffectUpdate

Set ButtonPressed to GetButtonPressed

If ButtonPressed == 0

Player.Additem WeapPhaserStun 1 1
Player.EquipItem WeapPhaserStun 1
Player.RemoveItem WeapPhaser 1 1

ElseIf ButtonPressed == 1

Player.Additem WeapPhaser 1 1
Player.EquipItem WeapPhaser 1
Player.RemoveItem WeapPhaserStun 1 1
Else
EndIf

END

Begin ScriptEffectFinish
Player.Additem PhaserChange 1 1
END

Link to comment
Share on other sites

Please don't centre-align your scripts, as it makes them rather difficult to read.

 

I think the problem is that you're using a ScriptEffectUpdate block to detect the press of a button. Although GameMode blocks will run while a menu is open, the game is paused so I would assume that effects will not be updating themselves every frame, so ScriptEffectUpdate blocks won't be running.

 

I would recommend that you use a token (an unplayable, therefore invisible piece of armour) to display your message instead. Instead of applying a scripted effect to the player, you should use AddItem to add a single instance of a scripted token with a script like this:

ScriptName PhaserScript

short ButtonPressed

Begin OnAdd
ShowMessage PhaserMessage
End

Begin GameMode
set ButtonPressed to GetButtonPressed

if ButtonPressed == -1; If no button has been pressed
	Return; Don't run any more code
elseif ButtonPressed; If ButtonPressed is true, i.e. 1
	player.AddItem WeapPhaser 1 1
	player.EquipItem WeapPhaser 1
	player.RemoveItem WeapPhaserStun 1 1
else; If ButtonPressed is false, i.e. 0
	player.AddItem WeapPhaserStun 1 1
	player.EquipItem WeapPhaserStun 1
	player.RemoveItem WeapPhaser 1 1
endif

player.AddItem PhaserChange 1 1
RemoveMe
End

Hope that helps,

 

Cipscis

Link to comment
Share on other sites

No, that didn't work.

 

The message didn't appear when I used the token.

 

Infact it didn't even add the token at the end

 

Anyother ideas?

 

Ohh BTW, I'm using an ingestible as my token and the script itself is an effect script which goes through a base effect and then to the token.

 

Does that help?

Link to comment
Share on other sites

I got it working now, however, when I use it, it equips the weapon, but it doesn't let me unequip or drop the weapon, whats wrong with it?

 

I had to put the ScrptEffectStart and Update back on to get it working.

 

EDIT:

 

WHOO IT WORKS NOW!!!!!!!!!!!

 

Heres the final Script:

 

SCN PhaserScript

short ButtonPressed

Begin ScriptEffectStart
ShowMessage PhaserMessage
player.AddItem PhaserChange 1 1
End

Begin ScriptEffectUpdate
set ButtonPressed to GetButtonPressed

if ButtonPressed == -1; If no button has been pressed
	Return; Don't run any more code
elseif ButtonPressed; If ButtonPressed is true, i.e. 1
	player.AddItem WeapPhaser 1 1
	player.EquipItem WeapPhaser
	player.RemoveItem WeapPhaserStun 1 1
else; If ButtonPressed is false, i.e. 0
	player.AddItem WeapPhaserStun 1 1
	player.EquipItem WeapPhaserStun
	player.RemoveItem WeapPhaser 1 1
endif
End

Link to comment
Share on other sites

Ohh BTW, I'm using an ingestible as my token and the script itself is an effect script which goes through a base effect and then to the token.
You should be using a piece of armour as your token (with the "playable" checkbox unticked so that it isn't visible in the player's inventory), and the script should be an object script that is attached directly to it.

 

When you want to show the message, you should use AddItem to add the token to the player's inventory. When this is done, the script attached to the token (which I posted above) should cause the messagebox to display, and detect which button the player presses.

 

@TGBlank:

As far as I know, script halts only occur when using invalid "ref" variables. For example, trying to call a reference function on an uninitialised "ref" variable.

 

Cipscis

Link to comment
Share on other sites

I don't know how to make this a general question, so I'll detail what I want to do specifically.

 

I want pyromaniac to modify the duration a subject burns for. This has been racking my mind for the past few days and I can't figure out an elegant solution in which only an actor with the pyromaniac perk gets the benefit. All of my "solutions" end up with the problem of having all flame weapons, including non-player flame weapons, gaining the benefit of the pyromaniac perk when the player chooses the perk.

Link to comment
Share on other sites

You could probably edit the burning enchantment, and make it have two effects, 1 short, 1 long.

 

The long one will have 2 conditions if the 'user' is the player AND if the player haves piromaniac

 

The short one will ask if the user is not the player OR the player doesn't have piromaniac

 

Should work.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...