Jump to content

How hard would this be to script?


TonyaSolovyov

Recommended Posts

I mostly use three (well four) weapons: the laser rifle, the tri-beam laser, the metal blaster, and the wazer wifle. I hate having to carry all of them with me though. What I want to make is a mod that when you push a key, it will show an options menu that lets you exchange your current laser rifle for one of the other three. I would prefer if you would need to collect all three first, but I can do without that for now. I've never scripted before, and I'm wondering if this is an easy script to tackle or if it's too difficult.

 

Another thing I want is a workbench that when I push a key, it brings up the workbench menu (but I need it to be compatible with WMK). I checked out the portable workbench mod, but it doesn't work with WMK. How hard would this be? Would it be possible to add this menu to the menu to change the laser rifles?

 

And last but not least, would anyone be willing to assist me? I would IMAGINE this to be fairly simple, but I've never scripted before in my life (I did a little Ruby in high school, but I never really got the jist of it).

 

Thanks,

Tonya Solovyov

Link to comment
Share on other sites

I can't seem to get the options menu to pop-up when I press the hotkey 'M'.

 

Here's the script:

 

ScriptName LaserRifle

short Button
float health
float timerc
ref equip


begin GameMode
if IsKeyPressed 50
	if player.getequipped WeapLaserRifle == 1 || player.getequipped DLC01UniqueWeapLaserRifle == 1 || player.getequipped DLC03LaserShotgun == 1 || player.getequipped WeapUniqueWazerWifle == 1 
		showMessage LaserRifleMessage
elseif player.getequipped DLC03LaserShotgun == 1 || player.getequipped WeapUniqueWazerWifle == 1  
		showMessage LaserRifleMessage
	endif
endif
end

begin GameMode

set Button to GetButtonPressed
set equip to player.GetEquippedObject 5
set health to player.GetEquippedCurrentHealth 5 / 100

if Button == 0
	; Laser Rifle
	if equip != WeapLaserRifle
		PlaySound UIRepairWeapon
		player.RemoveItem equip 1 1
		player.AddItemHealthPercent WeapLaserRifle 1 health 1
		player.EquipItem WeapLaserRifle 0 1
		showMessage LaserRifleChangeMessage
	endif
endif

elseif Button == 1
	; Metal Blaster
	if equip != DLC01UniqueWeapLaserRifle
		PlaySound UIRepairWeapon
		player.RemoveItem equip 1 1
		player.AddItemHealthPercent DLC01UniqueWeapLaserRifle 1 health 1
		player.EquipItem DLC01UniqueWeapLaserRifle 0 1
		showMessage LaserRifleChangeMessage
	endif
endif

elseif Button == 2
	; Tri-Beam Laser
	if equip != DLC03LaserShotgun
		PlaySound UIRepairWeapon
		player.RemoveItem equip 1 1
		player.AddItemHealthPercent DLC03LaserShotgun 1 health 1
		player.EquipItem DLC03LaserShotgun 0 1
		showMessage LaserRifleChangeMessage
	endif
endif

elseif Button == 3
	; Wazer Wifle
	if equip != WeapUniqueWazerWifle
		PlaySound UIRepairWeapon
		player.RemoveItem equip 1 1
		player.AddItemHealthPercent WeapUniqueWazerWifle 1 health 1
		player.EquipItem WeapUniqueWazerWifle 0 1
		showMessage LaserRifleChangeMessage
	endif
endif
end

 

I do have all the messages set up and I obviously have FOSE installed. I just can't seem to get the menu to show up. Can anyone give me any suggestions?

 

Thanks,

TonyaSolovyov

 

EDIT: Okay, I got the message to show up by attaching the script to the weapons. I didn't want to do this though; I wanted to attach the script to a quest but I'm having a problem. When I go to make the quest, it won't let me select a script (any script). What do I do?

 

EDIT2: I'm still working on adding the script to the quest, but I'm running into another problem. Every time I swap weapons, the new weapon comes back minimal condition (it can fire one shot before it breaks). Any suggestions?

 

EDIT3: I figured out how to attach the script to a quest (I feel like a moron that I couldn't do it before), but I still can't figure why the guns are swapping in minimal condition. I can delete the whole repair-transfer system, but then this mod becomes REALLY unbalanced. I also want to make a system where you have to collect each gun first, but I have NO idea how too. Any suggestions?

Link to comment
Share on other sites

try begin onadd instead of gamemode

 

Alright, I'll try that and let you know what happens.

 

Thanks,

TonyaSolovyov

 

EDIT: I can't attach it to a quest because the only way you can use OnAdd is if you make it an Object Script. I'll try attaching it to the object, but I still want to find an alternate solution.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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