Re: Scripting help [message #436662 is a reply to message #436628] |
Thu, 16 September 2010 13:25 |
|
wubwub
Messages: 142 Registered: May 2009 Location: Ontario
Karma:
|
Recruit |
|
|
Thanks for the reply guys,
That info was helpful but Reborn that is written in c++ if i am not mistaken, i am trying to write it in lua but cant seem to get the script right.
(Sorry i didn't mention that beforehand )
this is what i got so far, but i dont know how to translate c++ into lua
function OnLevelLoaded(target)
Find_Refinery(Building_Type(0,3))
Attach_Script_Building(Building_Type(3), "JFW_Tiberium_Refinery", "10,01.00")
end
end
This is what i am trying to base it off of in the engine.h:
int Building_Type(GameObject *obj); //returns the type of a BuildingGameObj
//type values for building objects
#define NONE -1
#define POWER_PLANT 0 //note that this list reflects the list in leveledit
#define SOLDIER_FACTORY 1
#define VEHICLE_FACTORY 2
#define REFINERY 3
#define COM_CENTER 4
#define REPAIR_BAY 5
#define SHRINE 6
#define HELIPAD 7
#define CONYARD 8
#define BASE_DEFENSE 9
GameObject *Find_Building(int team,int type); //Find a building by team and type
I am writing this as a plugin for lua
Everytime i load the server it gives error saying "bad argument #1 'Attach Script' <number expected, got string>"
p.s. i had previously attempted to use your tickrate plugin, but i didn't like that it gave creds ontop of the ref giving creds.
EDIT: could i just disable the refinery's and use your plugin to generate creds instead? or does te plugin still generate creds even after the ref is dead?
When renegade goes Wub, it never goes back
(or at least until I re-install renegade anyways)
[Updated on: Thu, 16 September 2010 19:40] Report message to a moderator
|
|
|