The forum has been set to read-only mode. For community discussion and questions, head over to our Discord: https://discord.taleoftwowastelands.com

I could use some scripting help.

General help and troubleshooting.
Post Reply
User avatar
XanthosGambit
Posts: 79
Joined: Sun Oct 30, 2016 1:46 pm
Contact:

I could use some scripting help.

Post by XanthosGambit » Sun Aug 07, 2022 12:16 pm

Basically, I'm trying to make an activator animate when the player activates it, but I'm not 100% sure on what exactly I need to do.

For reference, this is my current script. If there's anything I can do to make it "better" please let me know!

Code: Select all

scn COASpawnRoomSCRIPT

ref placedObject

Begin OnActivate
	if IsActionRef Player == 1
		SpawnSwitchREF.PlayGroup Forward 0 ;this is supposed to play the activation anim for the switch, but it doesn't seem to work
		set placedObject to SpawnMarkerREF.PlaceAtMe CrSuperMutant1GunADC 1
	endif

	if GetDeadCount CrSuperMutant1GunADC >= 10 ;this is supposed to clean up spawned enemies once it hits or exceeds 10. Currently stops you spawning more then 10.
		placedObject.Disable
		placedObject.MarkforDelete
	endif
End

User avatar
XanthosGambit
Posts: 79
Joined: Sun Oct 30, 2016 1:46 pm
Contact:

Re: I could use some scripting help.

Post by XanthosGambit » Mon Aug 08, 2022 9:21 am

Eh, I think I'll just change the switch model to something I know has working animations.

But if someone can help me figure out why the button stops spawning enemies once it hits 10, I'd be very grateful.

User avatar
RoyBatty
Gary
Posts: 7742
Joined: Sun Apr 27, 2014 10:26 am
Location: Vault 108

Re: I could use some scripting help.

Post by RoyBatty » Mon Aug 08, 2022 11:36 am

Look in the nif with nifskope, it may be left/right instead of forward/backward, or something else.
Image

User avatar
XanthosGambit
Posts: 79
Joined: Sun Oct 30, 2016 1:46 pm
Contact:

Re: I could use some scripting help.

Post by XanthosGambit » Mon Aug 08, 2022 11:59 am

RoyBatty wrote:
Mon Aug 08, 2022 11:36 am
Look in the nif with nifskope, it may be left/right instead of forward/backward, or something else.
Yeah, it says it's "Open/Close" which I swear is what I stated in the "PlayGroup" command originally, yet the GECK kept complaining that there wasn't an animation by that name.

Maybe it's case-sensitive and I put "open" or something. :/

I wonder if this is a bad way to learn GECK scripting, just throwing myself in with only the GECK Wiki to guide me...

User avatar
RoyBatty
Gary
Posts: 7742
Joined: Sun Apr 27, 2014 10:26 am
Location: Vault 108

Re: I could use some scripting help.

Post by RoyBatty » Mon Aug 08, 2022 11:03 pm

Open/Close is handled by the engine and is special. You can change the text strings in the nif header to Forward/Backward and it will work how you want.
Image

Post Reply