I want my flashlight to require batteries.

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

I want my flashlight to require batteries.

Post by Hidden Hands »

Ok, so in my game the flashlight is a very, very important item. Not only can it light up the dark enviroment you have to explore, but it is also the only effective weapon against shadow demons. But, as it is, the game is too easy because the flashlight is permanent. I've included my code below.

Code: Select all

// Decorate

// Constants
const int flashlightVert = 18;
const int flashlightHoriz = 0; // 36 for over-the-shoulder effect

// Actors
ACTOR FlashlightSpawner : CustomInventory
{
	States
	{
	Pickup:
		TNT1 A 0 A_CustomMissile("FlashLightBeam1", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam2", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam3", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam4", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam5", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam6", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam7", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam8", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam9", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam10", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam11", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam12", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam13", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam14", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam15", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam16", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam17", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam18", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		TNT1 A 0 A_CustomMissile("FlashLightBeam19", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
		Stop
	}
}

ACTOR FlashLightBeam
{
   +NOGRAVITY
   +RIPPER //Ripper functions similarly to noclip, but it still damages the monsters
   +NOBLOCKMAP
   +DONTSPLASH
   +BLOODLESSIMPACT
   Projectile
   Renderstyle None
   Damage 1 //The projectile is a ripper, so damage will be done really rapidly
   Radius 8 //Increase the radius and height too
   Height 16
   DamageType "Light"
   States
   {
   Spawn:
      TNT1 AABC 1
      Stop
   }
}

ACTOR FlashLightBeam1 : FlashLightBeam
{
	Speed  1
}

ACTOR FlashLightBeam2 : FlashLightBeam
{
	Speed  2
}

ACTOR FlashLightBeam3 : FlashLightBeam
{
	Speed  3
}

ACTOR FlashLightBeam4 : FlashLightBeam
{
	Speed  4
}

ACTOR FlashLightBeam5 : FlashLightBeam
{
	Speed  5
}

ACTOR FlashLightBeam6 : FlashLightBeam
{
	Speed  7
}

ACTOR FlashLightBeam7 : FlashLightBeam
{
	Speed  9
}

ACTOR FlashLightBeam8 : FlashLightBeam
{
	Speed  12
}

ACTOR FlashLightBeam9 : FlashLightBeam
{
	Speed  16
}

ACTOR FlashLightBeam10 : FlashLightBeam
{
	Speed  21
}

ACTOR FlashLightBeam11 : FlashLightBeam
{
	Speed  28
}

ACTOR FlashLightBeam12 : FlashLightBeam
{
	Speed  37
}

ACTOR FlashLightBeam13 : FlashLightBeam
{
	Speed  49
}

ACTOR FlashLightBeam14 : FlashLightBeam
{
	Speed  65
}

ACTOR FlashLightBeam15 : FlashLightBeam
{
	Speed  87
}

ACTOR FlashLightBeam16 : FlashLightBeam
{
	Speed  116
}

ACTOR FlashLightBeam17 : FlashLightBeam
{
	Speed  155
}

ACTOR FlashLightBeam18 : FlashLightBeam
{
	Speed  207
}

ACTOR FlashLightBeam19 : FlashLightBeam
{
	Speed  276
}
So I wrote up a code for a new ammo type. Batteries! Good batteries, and cheap batteries. Only problem is, I'm not sure how to get the flashlight to require them. How can I make the flashlight run out of battery power the longer its on, based on my code, and have it restored by the batteries? (The Battery code is here:)

Code: Select all

ACTOR Batteries : Ammo 13488
{
//$Category Ammunition
  	States
	{
		Spawn:
			BTRY A 1
			Loop    
	}

	Inventory.PickupMessage "Packet of Batteries."
	Inventory.Amount 100
	Inventory.MaxAmount 100
	Ammo.BackpackAmount 0
	Ammo.BackpackMaxAmount 100
	Inventory.Icon SGASA0
 	Scale 0.2
}

ACTOR CheapBatteries : Batteries 13489
{
//$Category Ammunition
	States
	{
		Spawn:
			CBTR A 1
			Loop    
	}

	Inventory.PickupMessage "Cheap knockoff batteries."
	Inventory.Amount 40
	Inventory.MaxAmount 40
	Ammo.BackpackAmount 0
	Ammo.BackpackMaxAmount 40
	Inventory.Icon SGASA0
 	Scale 0.2
}
Can somsone help me out with this please? Thanks in advance.
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: I want my flashlight to require batteries.

Post by Jarewill »

The method from this thread can be applied here:
Spoiler:
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: I want my flashlight to require batteries.

Post by Hidden Hands »

I'm still very confused with this. How can I adapt it to my ready made code|? Because my flashlight works as a weapon too, so I don't want to harm what I have for it already.
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: I want my flashlight to require batteries.

Post by Jarewill »

Well for one, I don't know how your code exactly gets executed.
An ACS script keeps giving the player FlashlightSpawner?

For the code I provided, you just need to paste the code I made without overwriting anything and change your activation method to activate this item instead.
If you are using KEYCONF to activate the flashlight with a custom bind, you can use this:

Code: Select all

AddKeySection "Test Keys" test_binds
AddMenuKey "Flashlight" "use CustomFlashlight"
DefaultBind F "use CustomFlashlight"
The flashlight should function exactly the same, as I really just copied the flashlight spawning into the LightOn state.
If you compare them you can see they are the same.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: I want my flashlight to require batteries.

Post by Hidden Hands »

I'm sorry I know I'm being a pest with this I just can't seem to get my head around it.

This is my flashlight code (DECORATE):

Code: Select all

// Decorate

// Constants
const int flashlightVert = 18;
const int flashlightHoriz = 0; // 36 for over-the-shoulder effect

// Actors
ACTOR FlashlightSpawner : CustomInventory
{
   States
   {
   Pickup:
      TNT1 A 0 A_CustomMissile("FlashLightBeam1", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam2", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam3", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam4", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam5", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam6", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam7", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam8", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam9", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam10", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam11", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam12", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam13", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam14", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam15", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam16", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam17", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam18", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      TNT1 A 0 A_CustomMissile("FlashLightBeam19", flashlightVert, flashlightHoriz, 0, 2, ACS_NamedExecuteWithResult("PointerPitch", 0))
      Stop
   }
}

ACTOR FlashLightBeam
{
   +NOGRAVITY
   +RIPPER //Ripper functions similarly to noclip, but it still damages the monsters
   +NOBLOCKMAP
   +DONTSPLASH
   +BLOODLESSIMPACT
   Projectile
   Renderstyle None
   Damage 1 //The projectile is a ripper, so damage will be done really rapidly
   Radius 8 //Increase the radius and height too
   Height 16
   DamageType "Light"
   States
   {
   Spawn:
      TNT1 AABC 1
      Stop
   }
}

ACTOR FlashLightBeam1 : FlashLightBeam
{
   Speed  1
}

ACTOR FlashLightBeam2 : FlashLightBeam
{
   Speed  2
}

ACTOR FlashLightBeam3 : FlashLightBeam
{
   Speed  3
}

ACTOR FlashLightBeam4 : FlashLightBeam
{
   Speed  4
}

ACTOR FlashLightBeam5 : FlashLightBeam
{
   Speed  5
}

ACTOR FlashLightBeam6 : FlashLightBeam
{
   Speed  7
}

ACTOR FlashLightBeam7 : FlashLightBeam
{
   Speed  9
}

ACTOR FlashLightBeam8 : FlashLightBeam
{
   Speed  12
}

ACTOR FlashLightBeam9 : FlashLightBeam
{
   Speed  16
}

ACTOR FlashLightBeam10 : FlashLightBeam
{
   Speed  21
}

ACTOR FlashLightBeam11 : FlashLightBeam
{
   Speed  28
}

ACTOR FlashLightBeam12 : FlashLightBeam
{
   Speed  37
}

ACTOR FlashLightBeam13 : FlashLightBeam
{
   Speed  49
}

ACTOR FlashLightBeam14 : FlashLightBeam
{
   Speed  65
}

ACTOR FlashLightBeam15 : FlashLightBeam
{
   Speed  87
}

ACTOR FlashLightBeam16 : FlashLightBeam
{
   Speed  116
}

ACTOR FlashLightBeam17 : FlashLightBeam
{
   Speed  155
}

ACTOR FlashLightBeam18 : FlashLightBeam
{
   Speed  207
}

ACTOR FlashLightBeam19 : FlashLightBeam
{
   Speed  276
}
And this is my "battery" ammo code (DECORATE):

Code: Select all

ACTOR Batteries : Ammo 13488
{
//$Category Ammunition
     States
   {
      Spawn:
         BTRY A 1
         Loop   
   }

   Inventory.PickupMessage "Packet of Batteries."
   Inventory.Amount 100
   Inventory.MaxAmount 100
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 100
   Inventory.Icon SGASA0
    Scale 0.2
}

ACTOR CheapBatteries : Batteries 13489
{
//$Category Ammunition
   States
   {
      Spawn:
         CBTR A 1
         Loop   
   }

   Inventory.PickupMessage "Cheap knockoff batteries."
   Inventory.Amount 40
   Inventory.MaxAmount 40
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 40
   Inventory.Icon SGASA0
    Scale 0.2
}
This is also my KEYCONF code:

Code: Select all

// Key Configuration
// Aliases
Alias "ToggleFlashlight" "PukeName ToggleFlashlight"

// Key Sections
AddKeySection "Flashlight" "flashlight"

// Menu Keys
AddMenuKey "Toggle" "ToggleFlashlight"

// Default Binds
DefaultBind "F" "ToggleFlashlight"
My flashlight also acts as a weapon against photosensitive monsters.

Based on what I've shared where exactly do I make changes and to what in order to make the batteries work with it? I'm sorry if you've already explained it I just cannot seem to understand.
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: I want my flashlight to require batteries.

Post by Jarewill »

Have you tried copying the code I provided in the first reply and seeing if it even works or not?
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: I want my flashlight to require batteries.

Post by Hidden Hands »

Jarewill wrote:The method from this thread can be applied here:
Spoiler:
Do you mean this one? Where do I put it? Sorry. My brain isn't getting it. :(
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: I want my flashlight to require batteries.

Post by Jarewill »

Hidden Hands wrote:Do you mean this one? Where do I put it? Sorry. My brain isn't getting it. :(
You put this into your DECORATE file.
Then use the KEYCONF I provided here:
Jarewill wrote:

Code: Select all

AddKeySection "Test Keys" test_binds
AddMenuKey "Flashlight" "use CustomFlashlight"
DefaultBind F "use CustomFlashlight" 
And give the player the CustomFlashlight item and that should be it.

Though retesting it, I noticed an issue with the flashlight being able to be activated without batteries.
Use this updated code instead:
Spoiler:
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: I want my flashlight to require batteries.

Post by ramon.dexter »

One small and quick advice for the slower:

When code starts with 'ACTOR', it is ALWAYS decorate, you put it in DECORATE lump.
When the code start with 'class', it is ALWAYS zscript, and goes into ZSCRIPT lump.
When the code start with 'script', it is ACS. You should know where to put ACS.

Also, after 4 years of trying to code, you should at least know how to distinguish these three types of code...
Last edited by ramon.dexter on Wed Jul 21, 2021 7:49 am, edited 1 time in total.
User avatar
Enjay
 
 
Posts: 27069
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: I want my flashlight to require batteries.

Post by Enjay »

Just to throw my £0.02 in here - I have never been convinced by the "you get a few seconds of flashlight then you need to find batteries" mechanic in games. The first one that really bugged me was in Half-life. Gordon Freeman is running around in this future-tech powered suit but his flashlight runs out every 30 seconds? Really?

I get that a dark spooky game is meant to be... well, dark and spooky and that always having a light can undo that but it always feels like a brute-forced way to do it and a very artificial game mechanic to impose a style of playing and unrealistic resource management in, to me, what is quite an unsatisfying way. I mean, I have an LED flashlight that I use every single day in real life. It runs on two AA batteries and I haven't had to change the batteries yet in four years! Even with older style flashlights, I would expect hours or a few days of useful light. Even an oil lamp lasts for hours.

Is there no other way to make the flashlight undesirable to have on all of the time instead of it just using up batteries? How about something like it attracts enemies/makes you more likely to be spotted - that kind of thing. Just *something* that makes the flashlight useful but also makes the player want to switch it off at times when it isn't needed.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: I want my flashlight to require batteries.

Post by wildweasel »

I did rather like how the flashlight battery worked in Metro 2033 - it's a dynamo flashlight, and technically does have unlimited battery, but you can at any time crank up the dynamo to charge it to make it brighter for a few minutes. Though the same battery also powers your NVGs, and those wear it down quite a lot faster and don't work at all if it's not regularly charged. Even that, though, largely only works because the game is very dark by nature (underground subway tunnels) and takes a horror/stealth bent to it.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: I want my flashlight to require batteries.

Post by Hidden Hands »

Thank you everyone. I'm gonna try this properly soon. I've been away a bit because life gets in the way. Thank you I'll try out these ideas.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: I want my flashlight to require batteries.

Post by Hidden Hands »

This is the error code we get when trying to apply the new flashlight?

Code: Select all

OS: Windows 8.1 (NT 6.3) Build 9600
    
M_LoadDefaults: Load system defaults.
Using program directory for storage
Script error, "IWADINFO" line 11:
Multiple IWAD records ignored
Script error, "IWADINFO" line 11:
Multiple IWAD records ignored
W_Init: Init WADfiles.
 adding C:/Users/Admin1/Documents/gzdoom 3 3/gzdoom.pk3, 684 lumps
 adding C:/Users/Admin1/Documents/gzdoom 3 3/zd_extra.pk3, 132 lumps
 adding ./DOOM2.WAD, 2956 lumps
 adding C:/Users/Admin1/Documents/Horrifying - ROTD/HorryefieingCircleMansion.ipk3, 6692 lumps
I_Init: Setting up machine state.
CPU speed: 998 MHz
CPU Vendor ID: AuthenticAMD
  Name: AMD C-70 APU with Radeon(tm) HD Graphics
  Family 20 (20), Model 2, Stepping 0
  Features: SSE2 SSE3 SSSE3 HyperThreading
I_InitSound: Initializing OpenAL
  Opened device OpenAL Soft on Speakers (2- High Definition Audio Device)
  EFX enabled
Renderer: OpenGL
V_Init: allocate screen.
S_Init: Setting up sound.
ST_Init: Init startup screen.
Checking cmd-line parameters...
S_InitData: Load sound definitions.
G_ParseMapInfo: Load map definitions.
Script error, "HorryefieingCircleMansion.ipk3:mapinfo" line 103:
Unknown property 'InstantReaction' found in skill definition

Texman.Init: Init texture manager.
ParseTeamInfo: Load team definitions.
LoadActors: Load actor definitions.
Script warning, "HorryefieingCircleMansion.ipk3:actors/weapons.txt" line 77:
Icon 'SGASA0' for 'Batteries' not found

Script warning, "HorryefieingCircleMansion.ipk3:actors/weapons.txt" line 96:
Icon 'SGASA0' for 'CheapBatteries' not found

Script warning, "HorryefieingCircleMansion.ipk3:actors/decoration.txt" line 3332:
Tried to define class 'Pottery1' more than once. Renaming class to 'Pottery1@HorryefieingCircleMansion.ipk3@actors/decoration.txt'
Script warning, "HorryefieingCircleMansion.ipk3:actors/decoration.txt" line 3349:
Tried to define class 'Pottery2' more than once. Renaming class to 'Pottery2@HorryefieingCircleMansion.ipk3@actors/decoration.txt'
Script warning, "HorryefieingCircleMansion.ipk3:actors/decoration.txt" line 3366:
Tried to define class 'Pottery3' more than once. Renaming class to 'Pottery3@HorryefieingCircleMansion.ipk3@actors/decoration.txt'
Script warning, "HorryefieingCircleMansion.ipk3:actors/decoration.txt" line 3743:
Tried to define class 'HangingCorpse' more than once. Renaming class to 'HangingCorpse@HorryefieingCircleMansion.ipk3@actors/decoration.txt'
Script warning, "HorryefieingCircleMansion.ipk3:actors/monsters.txt" line 981:
Unknown class name 'GreenFartCloud' of type 'Actor'
Script warning, "HorryefieingCircleMansion.ipk3:actors/monsters.txt" line 2205:
Unknown class name 'KipperSpitFX' of type 'Actor'
Script warning, "HorryefieingCircleMansion.ipk3:actors/monsters.txt" line 2209:
Unknown class name 'GreenFartCloud' of type 'Actor'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 43:
Unknown class name 'FlashLightBeam1' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 43:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 43:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 44:
Unknown class name 'FlashLightBeam2' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 44:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 44:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 45:
Unknown class name 'FlashLightBeam3' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 45:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 45:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 46:
Unknown class name 'FlashLightBeam4' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 46:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 46:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 47:
Unknown class name 'FlashLightBeam5' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 47:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 47:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 48:
Unknown class name 'FlashLightBeam6' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 48:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 48:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 49:
Unknown class name 'FlashLightBeam7' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 49:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 49:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 50:
Unknown class name 'FlashLightBeam8' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 50:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 50:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 51:
Unknown class name 'FlashLightBeam9' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 51:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 51:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 52:
Unknown class name 'FlashLightBeam10' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 52:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 52:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 53:
Unknown class name 'FlashLightBeam11' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 53:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 53:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 54:
Unknown class name 'FlashLightBeam12' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 54:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 54:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 55:
Unknown class name 'FlashLightBeam13' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 55:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 55:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 56:
Unknown class name 'FlashLightBeam14' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 56:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 56:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 57:
Unknown class name 'FlashLightBeam15' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 57:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 57:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 58:
Unknown class name 'FlashLightBeam16' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 58:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 58:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 59:
Unknown class name 'FlashLightBeam17' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 59:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 59:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 60:
Unknown class name 'FlashLightBeam18' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 60:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 60:
Unknown identifier 'flashlightHoriz'
Script warning, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 61:
Unknown class name 'FlashLightBeam19' of type 'Actor'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 61:
Unknown identifier 'flashlightVert'
Script error, "HorryefieingCircleMansion.ipk3:actors/flashlight.txt" line 61:
Unknown identifier 'flashlightHoriz'

Execution could not continue.

38 errors while parsing DECORATE scripts
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: I want my flashlight to require batteries.

Post by Jarewill »

I spot a lot of errors there, such as the batteries not having graphics, redefining existing classes and unknown actor classes.
Though by the errors that do actually abort the game, it looks like you removed all your flashlight actors and variables.

The code I provided used the same method your previous flashlight did, so you still need all those classes like FlashLightBeamXX and variables like flashlightVert and flashlightHoriz, alongside the script you called.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: I want my flashlight to require batteries.

Post by Hidden Hands »

Whoops! My mistake. I did replace my entire Flashlight with this new one. So I should instead ADD it to the original FLASHLIGHT DECORATE instead?
Post Reply

Return to “Scripting”