Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GiveItem(); vs. GiveItemFromFile();
ehovda321 Offline
Junior Member

Posts: 38
Threads: 22
Joined: Dec 2011
Reputation: 0
#1
GiveItem(); vs. GiveItemFromFile();

OK, here is the situation:

GiveItemFromFile("battery_1", "item_battery.ent"); = This function gives me batteries in a STACK.

GiveItem("battery_0", "item_battery.ent", "battery", "inventory_battery.tga", 1); = This function gives me batteries ONE at a time in the inventory... ?

Is there any possible way to change the "GiveItem();" function, to make the batteries be given to player in a STACK ?

Here is the item_battery.ent :

Spoiler below!
<Entity>
<EditorSession>
<Performance CamClipPlanes="0.05 1000" LightsActive="true" PSActive="true" ShowFog="true" ShowSkybox="true" WorldReflection="true" />
<ViewportConfig BGColor="0.2 0.2 0.2 1" GAmbientLight="true" GPointLight="true" GridSnap="false" GridSnapSeparation="0.25" SelectedViewport="3" UsingEnlargedViewport="true">
<Viewport CameraPosition="0 0 180" CameraTarget="0 0 0" CameraZoom="0" GridHeight="0" GridPlane="2" Preset="0" RenderMode="1" ShowAxes="true" ShowGrid="true" UsingLTCam="false" />
<Viewport CameraPosition="180 0 0" CameraTarget="0 0 0" CameraZoom="0" GridHeight="0" GridPlane="0" Preset="1" RenderMode="1" ShowAxes="true" ShowGrid="true" UsingLTCam="false" />
<Viewport CameraPosition="0 180 0" CameraTarget="0 0 0" CameraZoom="0" GridHeight="0" GridPlane="1" Preset="2" RenderMode="1" ShowAxes="true" ShowGrid="true" UsingLTCam="false" />
<Viewport CameraPosition="0.195015 0.162193 0.000971608" CameraTarget="-0.012871 0 0.114432" CameraZoom="5.16013" GridHeight="0" GridPlane="1" Preset="3" RenderMode="0" ShowAxes="true" ShowGrid="true" UsingLTCam="true" />
</ViewportConfig>
</EditorSession>
<ModelData>
<Entities />
<Mesh Filename="entities/item/item_battery/item_battery.dae">
<SubMesh Active="true" ID="0" Material="" Name="item_battery1" Rotation="0 0 0" Scale="1 1 1" SubMeshID="0" Tag="" WorldPos="0 0.0550494 0" />
<SubMesh Active="true" ID="1" Material="" Name="item_battery3" Rotation="-1.66448e-008 0 -1.5708" Scale="1 1 1" SubMeshID="1" Tag="" WorldPos="0.0529827 0.0186678 0.0725028" />
<SubMesh Active="true" ID="2" Material="" Name="item_battery4" Rotation="-1.5708 0 0" Scale="1 1 1" SubMeshID="2" Tag="" WorldPos="0.0357002 0.0186403 -0.000595413" />
<SubMesh Active="true" ID="3" Material="" Name="item_battery2" Rotation="0 0 0" Scale="1 1 1" SubMeshID="3" Tag="" WorldPos="0 0.055 0.0364234" />
</Mesh>
<Bones />
<Shapes>
<BodyShape Active="true" ID="4" Name="Shape_1" RelativeRotation="0 0 0" RelativeScale="0.018 0.115 0.018" RelativeTranslation="-0.0270607 0.0193595 -0.033936" Rotation="0 0 0" Scale="0.018 0.115 0.018" ShapeType="Cylinder" Tag="" WorldPos="-0.000224108 0.0576527 0.000127599" />
<BodyShape Active="true" ID="5" Name="Shape_2" RelativeRotation="0 0 0" RelativeScale="0.018 0.115 0.018" RelativeTranslation="-0.0270607 0.0193595 0.00203458" Rotation="0 0 0" Scale="0.018 0.115 0.018" ShapeType="Cylinder" Tag="" WorldPos="-0.000224108 0.0576527 0.0360982" />
<BodyShape Active="true" ID="6" Name="Shape_3" RelativeRotation="-1.5708 0 0" RelativeScale="0.018 0.115 0.018" RelativeTranslation="0.00879951 -0.0193595 -0.0378112" Rotation="-1.5708 0 0" Scale="0.018 0.115 0.018" ShapeType="Cylinder" Tag="" WorldPos="0.0356361 0.0189338 -0.00374755" />
<BodyShape Active="true" ID="7" Name="Shape_4" RelativeRotation="1.5708 -1.5708 3.14159" RelativeScale="0.018 0.115 0.018" RelativeTranslation="0.0270607 -0.0193595 0.0378112" Rotation="1.5708 -1.5708 3.14159" Scale="0.018 0.115 0.018" ShapeType="Cylinder" Tag="" WorldPos="0.0538973 0.0189338 0.0718748" />
</Shapes>
<Bodies>
<Body Active="true" AngularDamping="0.3" BlocksSound="false" BuoyancyDensityMul="1" CanAttachCharacter="true" CollideCharacter="false" CollideNonCharacter="true" ContinuousCollision="true" HasGravity="true" ID="8" LinearDamping="0.3" Mass="0.5" Material="Metal" MaxAngularSpeed="8" MaxLinearSpeed="8" Name="Body_1" PushedByCharacterGravity="true" Rotation="0 0 0" Scale="1 1 1" Tag="" UseSurfaceEffects="true" Volatile="false" WorldPos="0.0268366 0.0382932 0.0340636">
<Children>
<Child ID="0" />
<Child ID="1" />
<Child ID="2" />
<Child ID="3" />
</Children>
<Shape ID="4" />
<Shape ID="5" />
<Shape ID="6" />
<Shape ID="7" />
</Body>
</Bodies>
<Joints />
<Animations />
</ModelData>
<UserDefinedVariables EntitySubType="LampOil" EntityType="Item">
<Var Name="Health" Value="100" />
<Var Name="Toughness" Value="0" />
<Var Name="MaxFocusDistance" Value="0" />
<Var Name="MainPhysicsBody" Value="" />
<Var Name="ShowMesh" Value="true" />
<Var Name="DissolveOnDestruction" Value="false" />
<Var Name="DissolveTime" Value="1.0" />
<Var Name="EffectsOnSound" Value="" />
<Var Name="EffectsOffSound" Value="" />
<Var Name="EffectsOnTime" Value="1" />
<Var Name="EffectsOffTime" Value="1" />
<Var Name="EffectsOffLightColor" Value="0 0 0 0" />
<Var Name="EffectsOffLightRadius" Value="-1" />
<Var Name="ShowHints" Value="true" />
<Var Name="StaticMoveCheckCollision" Value="false" />
<Var Name="StaticMoveStartSound" Value="" />
<Var Name="StaticMoveStopSound" Value="" />
<Var Name="StaticMoveLoopSound" Value="" />
<Var Name="RandomizeAnimationStart" Value="true" />
<Var Name="SubItemTypeName" Value="Battery" />
<Var Name="ImageFile" Value="C:/Program Files (x86)/Amnesia - The Dark Descent/redist/entities/item/item_battery/inventory_battery.tga" />
<Var Name="PickSound" Value="Key" />
<Var Name="OilAmount" Value="25" />
</UserDefinedVariables>
</Entity>

(This post was last modified: 03-16-2013, 01:11 AM by ehovda321.)
03-16-2013, 01:10 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: GiveItem(); vs. GiveItemFromFile();

Try changing "item_battery.ent" to "LampOil" for GiveItem and see if that resolves anything.

Tutorials: From Noob to Pro
03-16-2013, 08:47 AM
Website Find
Akos115 Offline
Member

Posts: 101
Threads: 14
Joined: Aug 2012
Reputation: 0
#3
RE: GiveItem(); vs. GiveItemFromFile();

Or just use GiveItemFromFile multiple times if you want to give the player lots of batteries.

03-16-2013, 11:20 PM
Find




Users browsing this thread: 1 Guest(s)