Setting up player controlled harvesters [message #272210] |
Tue, 10 July 2007 07:53 |
|
BlazeDragoon
Messages: 141 Registered: April 2004
Karma: 0
|
Recruit |
|
|
Hey there I was thinking of adding harvesters that players could control and harvest on their own with a seprate harvester other then the AI one. I was wondering if anyone could help me out on which scripts I should use and possibly help me with setting the scripts up. I can probley handle the basic stuff but there may be a thing or two I'll be lost on.
http://www.blazemods.com
|
|
|
|
|
|
|
|
Re: Setting up player controlled harvesters [message #272371 is a reply to message #272210] |
Tue, 10 July 2007 20:22 |
|
Tankkiller
Messages: 192 Registered: February 2006 Location: Oklahoma, OK!
Karma: 0
|
Recruit |
|
|
JFW_Resource_Field
JFW_Resource_collector
JFW_Resource_Refinery
If you want instrutions
Click thisJFW_Resource_Field (when entered by a resource collecter, a timer is started and a flag is cleared. If the resource collecter exits before the timer goes off, the flag is set. When the timer goes off, if the flag is clear, it will send a cash amount to the resource collecter)
Cash (how much cash this field is worth)
Time (how long the timer should run for before it grants the cash, i.e. the "resource collection time")
TimerNum (what number to use for the timer)
Collected_Preset (this preset will be created when the timer trips. Attach a "destroy this after a short time" script to it)
Collected_Preset_Distance (how far in units from the harvester the Harvested_Preset should appear. It will be created in a straight line from the direction the harvester is facing)
Collected_Message (what message to send to the resource collecter to record the cash amount)
Nod_Preset (the preset name of the Nod Resource Collector)
GDI_Preset (the preset name of the GDI Resource Collector)
StartHarvest (the message to send to the harvester when harvesting starts)
StopHarvest (the message to send to the harvester when harvesting stops)
Use the last 2 with e.g. JFW_Enable_Disable_Animation_On_Custom to make the harvester animate while it's harvesting
n.b., if there is already a resource collector in the zone, any zone entry events by other resource collectors will be ignored (so if the original collector leaves, the new collector then has to leave and re-enter to trigger the start of collection)
JFW_Resource_Collector (this should go on the resource collecter preset to make it work)
Collected_Mesasge (what message will be sent to record the cash amount)
Refinery_Message (what message will be sent by the refinery to identify that the refinery has been entered, when this is recieved, it will give the current cash total to the player)
Cash_Limit (do not let the total cash amount get any larger than this, 0 = no limit)
Cash_Type (how to record cash, 0 = when someone gets in, reset cash figure, 1 = when someone other than the person who was last in gets in, reset the cash amount, 2 = never reset the cash amount, 3 = same as 2 except it will reset the cash amount every time a "harvested" message is sent)
Entire_Team (give to entire team or only to player, 0 = player, 1 = team
The cash amount is of course always reset when the refinery is triggered and the cash is delivered to the player.
JFW_Resource_Refinery (this handles the refinery, when it's entered, it sends a message to the resource collecter which then gives the correct cash amount to the player)
Refinery_Message (what message to send to the resource collecter to identify that the refinery has been entered)
Make sure you make the zone big enough for these 3 scripts. Use JFW_Debug_Text_File to identify if the zone entry trigger is triggering or not.
Also, make sure that you set the script zones for the field and refinery to "check stars only" = off (otherwise, it won't trigger on the vehicle, only on its occupant.
A good way to make sure that it's triggering on the vehicle is to put a vehicle into your map at startup and use JFW_Debug_Text_File on the zone. If it's working, you
should see the ID of the vehicle you put at startup in the log file, in addition to the ID of the player.
BTW, you can also use a specific infantry unit as a valid preset name and it will still work as long as the infantry preset has the JFW_Resource_Collector attached and as long as the refinery and field are set up right
Also works: RA_Ore_Truck
RA_Ore_Field
RA_Ore_Delivery_Zone
Intrutions for these:
Click thisScript Name:
Script Name: "RA_Ore_Truck"
Description:
Script for Ore Trucks. It calculates the value of each individual scoop of ore it harvests by dividing the field's value by the number of scoops it can hold. The script plays animations for both harvesting and delivering.
Parameters:
Field_Enter: Message sent by ore field when truck enters the zone. Default is 456654
Field_Exit: Message sent by Ore field when truck exits the zone. Default is 75321
Deposit_Enter: Message sent by deposit zone when truck enters. Default is 321654
Max_Capacity: Maximum number of "scoops" this script can hold. Default is 7
Harvest_Anim: Name of animation to play when harvesting.
Deliver_Anim: Name of animation to play when dumping ore.
Notes:
While harvesting, it must complete the harvesting animation to count a 'scoop'. The time it takes to harvest a field will therefore be the length of its harvest animation times the max capacity. When filled to capacity, the script will no longer play harvesting animations until it delivers the load. When delivering ore, it must complete its deliver animation to distribute credits to players.
******************************************************************************** **************
Script Name: "RA_Ore_Field"
Description:
Script for Ore Field script zones. It only sends messages to objects entering/exiting with the script RA_Ore_Truck.
Parameters:
Field_Value: The total credit value a maximum load from this field will produce. Default is 700
Enter: Mesage to send to an entering object. Default is 456654
Exit: Mesage to send to an exiting object. Default is 75321
Notes:
When an ore truck enters the zone this script is attached to, the enter message will also send the field value so the truck can calculate how much money it receives per scoop. A field with a value of 700 will provide a truck with 100 credits per scoop, assuming the truck is using the default 7 scoop capacity.
******************************************************************************** **************
Script Name: "RA_Ore_Delivery_Zone"
Description:
Script for Ore Delivery script zones. Ore Trucks enterign the attached zone will be sent a message instructing them to deliver their ore load.
Parameters:
Team: The team this zone works for. Soviets = 0, Allies = 1. Default is 0
Enter: Message to send to Ore Trucks that enter the zone. Default is 321654
Notes:
This script will only send a message to an object using the script RA_Ore_Truck that matches the team specified in its parameters.
BYE, BYE FLAME TANK!!!
[Updated on: Tue, 10 July 2007 20:35] Report message to a moderator
|
|
|
|
Re: Setting up player controlled harvesters [message #272444 is a reply to message #272210] |
Wed, 11 July 2007 02:27 |
|
Note that the RA_xxx scripts require that the harvester model have at least 2 animations (they can be the same animation with 2 different names though). One is used for harvest and one is used for dump.
Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
|
|
|
|
|
Re: Setting up player controlled harvesters [message #273555 is a reply to message #272210] |
Mon, 16 July 2007 00:44 |
|
crazfulla
Messages: 667 Registered: September 2006 Location: Aotearoa
Karma: 0
|
Colonel |
|
|
I managed to set them up with the following:
JFW_Resource_Collector - attached to both Harvester presets.
JFW_Resource_Field - attached to Script Zone at the Tib Field.
JFW_Resource_Refinery - attached to Script Zone at Refinery Dump.
JFW_Destroy_Self_Timer - Attached to 'Dollar Sign' animation.
(to destroy it once it had played it's animation)
JFW_Play_Sound - Attached to 'Dollar Sign' animation.
(to play a sound whilst the animation plays)
I may write a proper tutorial for RenHelp about this.
Only problem is, when the Harvester enters the Resource Field Script Zone, the "Harvesting" animation (moving claws) only plays once - ie does not loop until it stops harvesting. Anyone have an idea why this may be?
"GEoDLeto wrote:" | so what you are saying it is gonna take even longer before this thing is finished
So the topic title should be changed to: a sucky little "teaser" from C&C Reborn has been released
|
"halo2pac wrote:" | Unless they are girls, I am not going to bone them.
|
[Updated on: Mon, 16 July 2007 00:47] Report message to a moderator
|
|
|
|
|
Re: Setting up player controlled harvesters [message #485245 is a reply to message #272210] |
Sun, 12 January 2014 17:01 |
Neijwiert
Messages: 124 Registered: October 2009
Karma: 0
|
Recruit |
|
|
Animations are a set of instructions for the engine to tell it how to modify the bone structure of a model.
(For example: it tells the computer how a model should act when it waves)
These animation names for the RA ore truck are completly dependant on what animations you want it to do. You could just use the animations that the original harvester uses (I'm pretty sure it has stored animations instead of hardcoded). However I do not know these names. You can try to look into always.dat and find the harvester model (i.e. harvester.w3d) and then open it with the w3dviewer. This will show you the animations the model contains. Becouse Westwood stores the animations inside the models itself.
If you don't know how to obtain the w3dviewer: www.tiberiantechnologies.org
EDIT: If you don't know how to open the always.dat: try to find the xcc mixer with google
[Updated on: Sun, 12 January 2014 17:02] Report message to a moderator
|
|
|
Re: Setting up player controlled harvesters [message #485249 is a reply to message #272210] |
Mon, 13 January 2014 02:33 |
|
danpaul88
Messages: 5795 Registered: June 2004 Location: England
Karma: 0
|
General (5 Stars) |
|
|
W3D has two ways of storing animations.
model.model is the name of the animation track within the actual model.w3d file itself. This can only contain a single animation, although you can chain multiple animations back to back and use start/end frames to simulate multiple animations.
Pure animations are exported as separate animation.w3d files with model.w3d used as the skeleton for the animation. These are accessed using model.animation and you can have as many of these as you want.
Opening model.w3d in W3D Viewer will only show the animation (if any) that is within model.w3d itself. If you want to view the others you have to also load animation.w3d into W3D Viewer, which unfortunately requires you to know which files they are in in advance.
Or you could try something crazy and attempt to load every single W3D in the game into W3D viewer at the same time. I don't know how much memory it uses for each model and it'll probably take forever and a day to load but then you'll have a list of every single model and every single available animation for that model.
|
|
|