Jump to content
DWP

Button not appearing and adding a second water cannon to the Fire boat

Recommended Posts

Hey guys.

 

I've been working on making it so that FF's can change into hazmat gear. I finally got that to work by copying the script for the "PCMDChangetoMask" and changing the children and vehicles, but I have it so that it uses a separate button than the "Change Clothes" commands. Unfortunately, even though I've moved the button to the Icons folder, it just shows up as a red X. The script works, but ideally, I'd like to change the Change clothes command so that if I hover over a HAZMAT vehicle, it changes the FF's to Hazmat, and if I hover over any other fire vehicle, they change to SCBA. I'm using the LAChangeClothes script:

object PcmdChangeToABCD : CommandScript{	PcmdChangeToABCD()	{		SetCursor("hazmat");		SetIcon("hazmat_install_over");		//SetGroupID(CGROUP_GETEQUIPMENT);		SetPossibleCallers(ACTOR_PERSON);		SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT);		SetRestrictions(RESTRICT_NOTDESTROYED | RESTRICT_NOTBURNING | RESTRICT_HASFIREAXE);		SetNeedsCarWithFlagSet(OF_HAS_FIREAXE);	}	/*bool CheckPossible(GameObject *Caller)	{		if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON)			return false;		Person p(Caller);		if (p.IsCarryingPerson() || p.IsLinkedWithPerson() || p.GetFirehoseID()!=0 || p.IsPulling())			return false;		if (p.IsCurrentAction("EActionTreatPerson"))			return false;		if (!Game::ExistsNormalObjectWithFlagSet(OF_HAS_FIREAXE))			return false;		return true;	}*/	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if(!Caller->IsValid() || !Target->IsValid() || Caller->GetType() != ACTOR_PERSON)			return false;		Person p(Caller);		if(p.IsValid() && (p.IsCarryingPerson() || p.IsInDLKBasket() || p.IsLinkedWithPerson() || p.GetFirehoseID()!=0 || p.IsPulling() || p.GetEnteredCarID() != -1))			return false;		if (p.IsCurrentAction("EActionTreatPerson"))			return false;		Vehicle v(Target);		if (v.IsValid() && !v.IsDestroyed() && v.GetVehicleType() == VT_FIREFIGHTERS_DEKONP)		{			return true;		}		return false;	}	void PushActions(GameObject *Caller, Actor *Target, int childID)	{		Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_PASSENGERDOOR);		Caller->PushActionTurnTo(ACTION_APPEND, Target);		Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_CHANGE, Target, 7, false);	}};object PcmdChangeToMask : CommandScript{	PcmdChangeToMask()	{		SetCursor("clothes");		SetIcon("clothes");		//SetGroupID(CGROUP_GETEQUIPMENT);		SetPossibleCallers(ACTOR_PERSON);		SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT);		SetRestrictions(RESTRICT_NOTDESTROYED | RESTRICT_NOTBURNING | RESTRICT_HASFIREAXE);		SetNeedsCarWithFlagSet(OF_HAS_FIREAXE);	}	/*bool CheckPossible(GameObject *Caller)	{		if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON)			return false;		Person p(Caller);		if (p.IsCarryingPerson() || p.IsLinkedWithPerson() || p.GetFirehoseID()!=0 || p.IsPulling())			return false;		if (p.IsCurrentAction("EActionTreatPerson"))			return false;		if (!Game::ExistsNormalObjectWithFlagSet(OF_HAS_FIREAXE))			return false;		return true;	}*/	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if(!Caller->IsValid() || !Target->IsValid() || Caller->GetType() != ACTOR_PERSON)			return false;		Person p(Caller);		if(p.IsValid() && (p.IsCarryingPerson() || p.IsInDLKBasket() || p.IsLinkedWithPerson() || p.GetFirehoseID()!=0 || p.IsPulling() || p.GetEnteredCarID() != -1))			return false;		if (p.IsCurrentAction("EActionTreatPerson"))			return false;		Vehicle v(Target);		if (v.IsValid() && !v.IsDestroyed() && v.GetVehicleType() == VT_FIREFIGHTERS_RW || v.GetVehicleType() == VT_FIREFIGHTERS_GTF || v.GetVehicleType() == VT_FIREFIGHTERS_DLK || v.GetVehicleType() == VT_FIREFIGHTERS_TLF || v.GetVehicleType() == VT_FIREFIGHTERS_LPF || v.GetVehicleType() == VT_AMBULANCE_ITW || v.GetVehicleType() == VT_AMBULANCE_RTW)		{			return true;		}		return false;	}	void PushActions(GameObject *Caller, Actor *Target, int childID)	{		Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_PASSENGERDOOR);		Caller->PushActionTurnTo(ACTION_APPEND, Target);		Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_CHANGE, Target, 2, false);	}};

Any help combining these two scripts into one would be greately appreciated.

 

SECOND ISSUE:

Every fireboat I've ever seen has more than 1 water cannon. I'd like to add a second water cannon to the rear of the boat, but it doesn't show up and doesn't want to work. Any suggestions?

Link to comment
Share on other sites

For the icon, I believe if you remove the "_over" from the end of the icon line, it will work. Those suffixes tell the game to use a specific looking icon at specific times, e.g. "over" when hovering the mouse over the icon.

 

As for making it automatically change to HAZMAT when choosing a HAZMAT vehicle, you could do something like this with the Mask script and not worry about the separate script.

void PushActions(GameObject *Caller, Actor *Target, int childID){    Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_PASSENGERDOOR);    Caller->PushActionTurnTo(ACTION_APPEND, Target);    Vehicle v(Target);    if (v.GetVehicleType() == VT_FIREFIGHTERS_DEKONP) //May also want to add Caller prototype checks to make sure only one type of person is able to do it, e.g. firefighters and not paramedics.        Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_CHANGE, Target, 7, false);    else        Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_CHANGE, Target, 2, false);}

Also, add the Dekonp vehicle type to the valid vehicles under CheckTarget.

 

About the fireboat, I think that cannons are hard-coded in the game, and you wouldn't be able to just another to the prototype. And idea would be to use the new cannon scripting in Hoppah's water supply mod, though it may present some difficulties.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...