View Single Post
  #18  
Old 12-08-2010, 06:31 AM
Goblin Wizard Goblin Wizard is offline
Approved Member
 
Join Date: Oct 2008
Posts: 508
Default

Quote:
Originally Posted by Goumindong View Post
thatWhat would be interesting is if i could create a sub extension off of poisondetonator or distance detonator in order to do what I want. Or if i could add another parameter to the schema of impactdetonator and have the game actually use it.
You can't. All detonators' parameters are hardcoded. I've never found out what the xml schema is really for.

Below you have an example how the ShipPoisoning script may look.
Code:
function ShipCanBePoisoned(ship)
	pilot = ship:GetPilot();
  
  if not (GetCurrentLocation() == "x220") or not (GetCurrentLocation() == "Precursors") or not (GetCurrentLocation() == "DisonSphere") then
    if (pilot == nil) then
  		return FALSE;
  	else
      if (GetQuestLabel("warhead_type") == "depol") then
        ship:SetShield(0);
        ship:PlayFX("Depol.bfx");
        return FALSE;
      elseif (GetQuestLabel("warhead_type") == "blast") then
        return FALSE;
      else
        return TRUE;
      end;
    end;
  else
  	if (pilot == nil) then
  		return FALSE;
  	else
  		if (pilot:HavePerk("Alien")) then
  	    return FALSE;
  		else
  	    return TRUE;
  		end;
  	end;
  end;
end;

--function ShipCanBePoisoned(ship)
--	pilot = ship:GetPilot();
----  flight = pilot:GetFlight();
--  
--  if not (GetCurrentLocation() == "x220") or not (GetCurrentLocation() == "Precursors") or not (GetCurrentLocation() == "DisonSphere") then
--    if (pilot == nil) then
--  		return FALSE;
--  	else 
----  	(GetQuestLabel("warhead_type") == blast) then
--      ship:SetShield(0);
----      flight:Stop();
----      ship:ApplyImpulse(100, Vector3(0, 1, 0));
----      myfunction();
--      return FALSE;
----    else
----      return FALSE;
--    end;
--  else
--  	if (pilot == nil) then
--  		return FALSE;
--  	else
--  		if (pilot:HavePerk("Alien")) then
--  	    return FALSE;
--  		else
--  	    return TRUE;
--  		end;
--  	end;
--  end;
--end;
It's just an example what I've been working on (it's far from what I've expected). GetQuestLabel thing was conncted with special "swich" skill . Every use of that skill changes the missile "warhead" type so without changing missile type you can change the way it works.

The main problem is that this script is connected with every poison detonator you make. It's hard to find good ifs to make it works differently for each type of missile. To make it work like normal missile you have to set poisoning effect damage to 0 and time to something like 1s or even 0.1s.
Reply With Quote