Frictional Games Forum (read-only)
GiveItem(); vs. GiveItemFromFile(); - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: GiveItem(); vs. GiveItemFromFile(); (/thread-20770.html)



GiveItem(); vs. GiveItemFromFile(); - ehovda321 - 03-16-2013

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>




RE: GiveItem(); vs. GiveItemFromFile(); - Your Computer - 03-16-2013

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


RE: GiveItem(); vs. GiveItemFromFile(); - Akos115 - 03-16-2013

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