Trying to make an explodable RC Car...

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!)
Post Reply
User avatar
Scape
Posts: 1
Joined: Mon Jan 17, 2022 1:38 pm
Contact:

Trying to make an explodable RC Car...

Post by Scape »

Ok... so, for a few days i've been quite literally drilling thru the wiki and the forums to find a way to make this work...

I wanted to make a controllable RC Car that , when the player pressed Fire , it would explode the car. The way i did this in the first place is that i made a quite litteral seperate PlayerPawn and Powermorph'd the player as that... there's only 2 problems tho

1. The Player dies when the car explodes (which kind of defeats the purpose of having it remote controlled)

2. I found a post yesterday viewtopic.php?f=122&t=64935 and i've downloaded the player_example.wad someone posted there. It works the way i wanted it to work , problem is that it somehow Nullifies the inventory? (dunno how to explain it)

In the same post , i've tried to wrap my head around what Graf said about the morph code , but yet again , i have no idea how to use it...

This is the code i have so far...

Code: Select all

ACTOR RC_Car_Remote : PowerupGiver 666
{
	Inventory.PickupMessage "This is gonna have an explosive end! (Claymore RC Car)"
	Inventory.PickupSound "misc/p_pkup"
	Inventory.MaxAmount 0
	+COUNTITEM
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Powerup.Type ClaymoreRC
	Powerup.Duration -60
	
	Scale 0.04
	
	States
	{
		Spawn:
			DUMM Y -1
			Stop
	}
}

ACTOR PowerClaymoreRC : PowerMorph
{
	 PowerMorph.PlayerClass "RemoteControlledCar"
}

Actor DeadmanSwitch : Weapon  {
	Weapon.AmmoUse 0
	Weapon.SelectionOrder 900000
	Inventory.PickupSound "misc/w_pkup"
	AttackSound "weapons/rocklx"
	
	States
	{
		Spawn:
			TNT1 A -1
			Loop
			
		Ready:
			TNT1 A 1 A_WeaponReady
			Loop
			
		Select:
			TNT1 A 0 A_Raise
			Loop
			
		Deselect:
			TNT1 A 0 A_Lower
			Loop
		
		Fire:
			CLRC A 0 A_SpawnItem ("EnemyClaymoreBoom", 8)
			CLRC A -1 A_SpawnItem ("EnemyClaymore", 8)
			goto Ready
	}
		
}

Actor RemoteControlledCar : PlayerPawn {

	Radius 8
	Height 8
	Health 25
	Scale 0.8
		
	PainChance 0
	
	Player.ForwardMove 1.5
	Player.SideMove 1.5
		
	Player.ViewHeight 16
	Player.AttackZOffset 16
	Player.JumpZ 16
	Player.MorphWeapon "DeadmanSwitch"
	PainSound "baron/pain"
	DeathSound "baron/death"
	Player.Face ""
		
	Monster
		
	+FRIENDLY
	+NOSKIN
	+PICKUP
	-DONTTRANSLATE
	-PLAYERPAWN.CROUCHABLEMORPH
	Species "Marines"
	Speed 0.6
		
	States 
	{
		Spawn:
			CLRC A 1 A_GiveInventory("DeadmanSwitch")
			CLRC A 1 A_SelectWeapon("DeadmanSwitch")
			CLRC A -1 
			Loop
		Death:
			CLRC A 0 A_SpawnItem ("EnemyClaymoreBoom", 8)
			CLRC A -1 A_SpawnItem ("EnemyClaymore", 8) 
			Loop
		
	}
}
If anyone knows a way to make this work , please help me...
I am quite literally out of ideas
Post Reply

Return to “Scripting”