Seite 5 von 5 ErsteErste 12345
Ergebnis 41 bis 43 von 43

Thema: SENT Gravitationsdämpfer

  1. #41

    Standard AW: SENT Gravitationsdämpfer

    Zitat Zitat von Andrey Beitrag anzeigen
    Der Advanced Duplicator, hatte mal eine Funktion, die alles Rangeweldete/Geropete u.s.w. mit genohmen hatte.
    Hatte?
    Mal schaun.
    Ich hab übrigens rausgefunden wie man ne airbrake macht

    ReEdit:

    Jetzt geht alles, (wireinputs, schwerelos) nur will die airbrake funktion nicht funktionieren.
    Und irgendwie überblicke ich den advdupe code nicht.

    Lua Code:
    1. AddCSLuaFile("cl_init.lua");
    2. AddCSLuaFile("shared.lua");
    3. include('entities/base_wire_entity/init.lua'); 
    4. include("shared.lua");
    5.  
    6. function ENT:SpawnFunction( ply, tr )
    7.     if ( !tr.Hit ) then return end    
    8.     local SpawnPos = tr.HitPos + tr.HitNormal * 16 
    9.     local ent = ents.Create( "gravtogglecontroller" )
    10.         ent:SetPos( SpawnPos )
    11.         ent:Spawn()
    12.         ent:Activate()   
    13.     return ent   
    14. end
    15.  
    16. function ENT:Initialize()
    17.  
    18. 	self.Entity:SetModel( "models/Combine_Helicopter/helicopter_bomb01.mdl" );
    19.  
    20.     self.Entity:PhysicsInit( SOLID_VPHYSICS ) // Make us work with physics,
    21.     self.Entity:SetMoveType( MOVETYPE_VPHYSICS ) // after all, gmod is a physics
    22.     self.Entity:SetSolid( SOLID_VPHYSICS ) // Toolbox
    23.  
    24.     local phys = self.Entity:GetPhysicsObject()
    25.     if (phys:IsValid()) then
    26.     phys:Wake()
    27.     end
    28. 	self.Inputs = Wire_CreateInputs( self.Entity, { "Activate" , "Airbrake" } )
    29. end
    30.  
    31. function ENT:UpdateTransmitState() return TRANSMIT_ALWAYS end;
    32.  
    33. function ENT:TriggerInput(iname, value)
    34. 	local ent = self.Entity
    35. 	if(iname == "Activate") then
    36. 		if((value or 0) >= 1) then
    37.             ent:GetPhysicsObject():EnableGravity(false)
    38. 		else
    39.             ent:GetPhysicsObject():EnableGravity(true)
    40. 		end
    41. 	end
    42. 	if(iname == "Airbrake") then
    43. 		self.passive = value
    44. 	end
    45. end
    46.  
    47. function ENT:PhysicsUpdate( physobj )
    48. 	local vel = physobj:GetVelocity()
    49. 	if self.passive and self.passive > 0 then
    50. 		if self.passive > 100 then self.passive = 100 end
    51.  
    52. 		vel = vel * ((100.0 - self.passive)/100.0)
    53. end
    54.  
    55. 	physobj:SetVelocity(vel)
    56. end
    57.  
    58. function ENT:OnRemove()
    59. 	local ent = self.Entity
    60. 	ent:GetPhysicsObject():EnableGravity(true)
    61. end
    Keks:
    BLARGH
    includes/modules/constraint.lua:1625: attempt to index local 'ent' (a function value)
    Lua Code:
    1. AddCSLuaFile("cl_init.lua");
    2. AddCSLuaFile("shared.lua");
    3. include('entities/base_wire_entity/init.lua'); 
    4. include("shared.lua");
    5.  
    6. function ENT:SpawnFunction( ply, tr )
    7.     if ( !tr.Hit ) then return end    
    8.     local SpawnPos = tr.HitPos + tr.HitNormal * 16 
    9.     local ent = ents.Create( "gravtogglecontroller" )
    10.         ent:SetPos( SpawnPos )
    11.         ent:Spawn()
    12.         ent:Activate()   
    13.     return ent   
    14. end
    15.  
    16. function ENT:Initialize()
    17.  
    18. 	self.Entity:SetModel( "models/Combine_Helicopter/helicopter_bomb01.mdl" );
    19.     self.Entity:PhysicsInit( SOLID_VPHYSICS ) // Make us work with physics,
    20.     self.Entity:SetMoveType( MOVETYPE_VPHYSICS ) // after all, gmod is a physics
    21.     self.Entity:SetSolid( SOLID_VPHYSICS ) // Toolbox
    22.  
    23.     local phys = self.Entity:GetPhysicsObject()
    24.     if (phys:IsValid()) then
    25.     phys:Wake()
    26.     end
    27. 	self.Inputs = Wire_CreateInputs( self.Entity, { "Activate" , "Airbrake" } )
    28. end
    29.  
    30. function ENT:UpdateTransmitState() return TRANSMIT_ALWAYS end;
    31.  
    32. function ENT:TriggerInput(iname, value)
    33. 	local ConstrainedEntities = constraint.GetAllConstrainedEntities( Entity ) 
    34. 	if(iname == "Activate") then
    35. 		 for _, ent in pairs( ConstrainedEntities ) do 
    36. 		 if((value or 0) >= 1) then
    37.             constr.Entity:GetPhysicsObject():EnableGravity(false)
    38. 		else
    39.             constr.Entity:GetPhysicsObject():EnableGravity(true)
    40. 		end
    41. 	end
    42. 	end
    43. 	if(iname == "Airbrake") then
    44. 		self.passive = value
    45. 	end
    46. end
    47.  
    48. function ENT:PhysicsUpdate( physobj )
    49. 	local vel = physobj:GetVelocity()
    50. 	if self.passive and self.passive > 0 then
    51. 		if self.passive > 100 then self.passive = 100 end
    52.  
    53. 		vel = vel * ((100.0 - self.passive)/100.0)
    54. end
    55.  
    56. 	physobj:SetVelocity(vel)
    57. end
    58.  
    59. function ENT:OnRemove()
    60. 	constr.Entity:GetPhysicsObject():EnableGravity(true)
    61. end
    Geändert von WeltEnSTurm (05.07.2008 um 22:27 Uhr) Grund: Kekse zusammengefügt

    awesome thing is made by Araxiel-Sama

  2. #42
    Avatar von Happy_Killer
    Registriert seit
    02.02.2008
    Ort
    Duderstadt

    Standard AW: SENT Gravitationsdämpfer

    wirst du das sent public stellen?

    Also ich finde du hast das gut hinpinökelt bislang
    Du solltest dir noch n model suchen das gut passt


    PS: könntest du mir mal deinen stargate skin schicken? oder wirst du das auch noch public machen
    GELB

  3. #43

    Standard AW: SENT Gravitationsdämpfer

    Col Sheppard arbeitet gerade an einem Model, ich hoffe wir finden jemanden, der es compiliert.

    Es läuft alles perfekt (Airbrake auch )
    Nur hab ich keine ahnung, wie ich das einbinden soll, damit nicht nur das SENT, sondern auch alles constrainte schwerelos/zur airbrake wird.

    Lua Code:
    1.  local ConstrainedEntities = constraint.GetAllConstrainedEntities( Entity ) 
    2.  
    3.  // Loop through all the entities in the system 
    4.  for _, ent in pairs( ConstrainedEntities ) do 
    5.  	// constr.Constraint is the actual constraint. 
    6.  	// constr.Entity is a table of each Entity connected to the constraint. 
    7.  	// it includes these items. 
    8.  	// constr.Entity[1].Index number 
    9.  	// constr.Entity[1].Entity entity 
    10.  	// constr.Entity[1].Bone number 
    11.  	// constr.Entity[1].LPos vector 
    12.  	// constr.Entity[1].WPos vector 
    13.  	// constr.Entity[1].Length number 
    14.  	// constr.Entity[1].World boolean  
    15.  end
    Doppelpost:
    Ich habe fertig.
    Soll ich nen eigenen Thread im Releases machen?
    Geändert von WeltEnSTurm (06.07.2008 um 22:11 Uhr) Grund: Doppelposts zusammengefügt

    awesome thing is made by Araxiel-Sama

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •