Spawning items, and bases

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
I have it.. What version of Rust Server you guys have? Maybe answer is there. Mine is 1069

Maybe it will not crash when I limit it. It was for debug you know. I'll set it like flare per 250 seconds. So It'll be just about maybe 12-15 flares per night..

But first I need to turn it on somehow.
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
I have it.. What version of Rust Server you guys have? Maybe answer is there. Mine is 1069

Maybe it will not crash when I limit it. It was for debug you know. I'll set it like flare per 250 seconds. So It'll be just about maybe 12-15 flares per night..

But first I need to turn it on somehow.
Just do a 60second timer to check for night time
Im using 1069
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
I have it.. What version of Rust Server you guys have? Maybe answer is there. Mine is 1069

Maybe it will not crash when I limit it. It was for debug you know. I'll set it like flare per 250 seconds. So It'll be just about maybe 12-15 flares per night..

But first I need to turn it on somehow.
Python:
# coding=utf-8
__author__ = 'DreTaX'
__version__ = '1.0'


import clr
clr.AddReferenceByPartialName("Fougerite")
import Fougerite

class Test:

    def On_PluginInit(self):
        Plugin.CreateTimer("Flare", 6000).Start()

    def FlareCallback(self, timer):
        timer.Kill()
        '''
            Museum Outside Flares
        '''
        flare_1_x = 6026
        flare_1_y = 398
        flare_1_z = -3223
        flare_2_x = 6012
        flare_2_y = 400
        flare_2_z = -3206
        flare_3_x = 6033
        flare_3_y = 446
        flare_3_z = -3216

        Plugin.Log("Test", "Spawning....!")
        World.Spawn("WorldFlare_New", float(flare_1_x), float(flare_1_y), float(flare_1_z))
        World.Spawn("WorldFlare_New", float(flare_2_x), float(flare_2_y), float(flare_2_z))
        World.Spawn("WorldFlare_New", float(flare_3_x), float(flare_3_y), float(flare_3_z))
        Plugin.Log("Test", "Spawned!")
        Plugin.CreateTimer("Flare", 6000).Start()

Exception: Trying to read past the buffer size - likely caused by mismatching Write/Reads, different size or order.
at #=qSFQEDe676da4RLJCNyT7Ow0Ph4c9pfFQnpb__PjA4SE=.#=qFpqsYyPHE5V9jF$rFjBbIw== (Boolean #=q8xVUhTT4wIpWWJBoI23tmA==, System.String #=qe7ARaxisBQ5dLwpDYnZEmg==) [0x00000] in <filename unknown>:0

at #=qDyYck6jY0p_qh6doTcsvIbN8t3TKJHLMicx6djrzRdg=.#=qdhJag_NO35ge6UsW1HeE1w== () [0x00000] in <filename unknown>:0

at #=qDyYck6jY0p_qh6doTcsvIbN8t3TKJHLMicx6djrzRdg=.#=qJLI$zIK9gAyQBWbSDgarkQ== () [0x00000] in <filename unknown>:0

at uLink.BitStream.#=qptl0JDkyVHfFB1CW3NFd36V9$64fzf2pF_0$eyHZKSc= () [0x00000] in <filename unknown>:0

at uLink.BitStream.ReadVector3 () [0x00000] in <filename unknown>:0

at RigidObj.uLink_OnNetworkInstantiate (uLink.NetworkMessageInfo info) [0x00000] in <filename unknown>:0

at FlareObj.uLink_OnNetworkInstantiate (uLink.NetworkMessageInfo info) [0x00000] in <filename unknown>:0
UnityEngine.Component:BroadcastMessage(String, Object, SendMessageOptions)
uLink.NetworkInstantiatorUtility:BroadcastOnNetworkInstantiate(NetworkView, String, NetworkMessageInfo)
uLink.NetworkInstantiatorUtility:BroadcastOnNetworkInstantiate(NetworkView, NetworkMessageInfo)
uLink.#=qZjxFA8ttwRxSYz9$4En7Mn41hCXF1S_ABh6WzGJazgI=:#=qdmnGhYiIS0XvXIgGMhvds1ywrgdUY7_av01tlGk4ROo=(String, NetworkInstantiateArgs, NetworkMessageInfo)
#=qSBVG6i3HoKQx$z3bwADYIgVX_kCktQP8JwBh1CI$O_8=:#=qmJepjRgj7$6Ve6XGiSvGQA==(String, NetworkInstantiateArgs, NetworkMessageInfo)
#=qr9YotdsWVwSdbrj6D5OlmHWwwJVhBeBIJ5J461Az$DQ=:#=ql4zGMGx2z6li6Xi1fiSUyg==(String, NetworkInstantiateArgs, #=q__0aJnzE_j5V$E$xqdkd8PUPKgwbochaYTDqzGbXfa0=)
#=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=:#=qXQDiMUjzLPj0T5YuTz9vAg==(Vector3, Quaternion, NetworkViewID, NetworkPlayer, NetworkGroup, String, String, String, BitStream, #=q__0aJnzE_j5V$E$xqdkd8PUPKgwbochaYTDqzGbXfa0=)
#=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=:#=ql2EqNK$xYumhzpJHyBCMlg==(NetworkViewID, NetworkPlayer, String, String, String, Vector3, Quaternion, NetworkGroup, Object[])
#=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=:#=qUNDGP7vqYhy$RGbHjP$TZQ==(NetworkPlayer, String, String, String, Vector3, Quaternion, NetworkGroup, Object[])
#=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=:#=q_HGDPhHq_ECCILu9hhTKmg==(NetworkPlayer, String, Vector3, Quaternion, NetworkGroup, Object[])
#=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=:#=qejjzXWDDjis8nDiBIE7jtg==(String, Vector3, Quaternion, NetworkGroup, Object[])
#=qSBVG6i3HoKQx$z3bwADYIgVX_kCktQP8JwBh1CI$O_8=:#=qevt4XbWcf0AFLrX0HW8$5A==(String, Vector3, Quaternion, NetworkGroup, Object[])
uLink.Network:Instantiate(String, Vector3, Quaternion, NetworkGroup, Object[])
NetCull:Instantiate(InstantiateArgs&)
NetCull:InstantiateStatic(String, Vector3, Quaternion)
Fougerite.World:Spawn(String, Vector3, Quaternion, Int32)
Fougerite.World:Spawn(String, Single, Single, Single, Int32)
Fougerite.World:Spawn(String, Single, Single, Single)
Microsoft.Scripting.Interpreter.FuncCallInstruction`6:Run(InterpretedFrame)
Microsoft.Scripting.Interpreter.Interpreter:Run(InterpretedFrame)
Microsoft.Scripting.Interpreter.LightLambda:Run7(CallSite, CodeContext, Object, Object, Object, Object, Object)
Microsoft.Scripting.Interpreter.DynamicInstruction`7:Run(InterpretedFrame)
Microsoft.Scripting.Interpreter.Interpreter:Run(InterpretedFrame)
Microsoft.Scripting.Interpreter.LightLambda:Run3(PythonFunction, Object, Object)
IronPython.Runtime.FunctionCaller`2:Call2(CallSite, CodeContext, Object, Object, Object)
System.Object:CallSite.Target(Closure, CallSite, Object, Object)
System.Dynamic.UpdateDelegates:UpdateAndExecute2(CallSite, Object, Object)
System.Object:CallSite.Target(Closure, CallSite, Object, Object)
System.Dynamic.UpdateDelegates:UpdateAndExecute2(CallSite, Object, Object)
System.Object:lambda_method(Closure, DynamicOperations, CallSiteBinder, Object, Object[])
Microsoft.Scripting.Runtime.DynamicOperations:InvokeMember(Object, String, Boolean, Object[])
Microsoft.Scripting.Runtime.DynamicOperations:InvokeMember(Object, String, Object[])
Microsoft.Scripting.Hosting.ObjectOperations:InvokeMember(Object, String, Object[])
IronPythonModule.IPPlugin:OnTimerCB(IPTimedEvent)
IronPythonModule.Events.IPTimedEvent:_timer_Elapsed(Object, ElapsedEventArgs)
System.Timers.Timer:Callback(Object)


Works,but it makes a rust error. I think uLink cant keep up with 6 seconds. Every flare lasts until 90 seconds. Make it a bit longer.

[2/26/2015 2:48 PM] Spawning....!
[2/26/2015 2:48 PM] Spawned!
[2/26/2015 2:48 PM] Spawning....!
[2/26/2015 2:48 PM] Spawned!
[2/26/2015 2:49 PM] Spawning....!
[2/26/2015 2:49 PM] Spawned!
[2/26/2015 2:49 PM] Spawning....!
[2/26/2015 2:49 PM] Spawned!
[2/26/2015 2:49 PM] Spawning....!
[2/26/2015 2:49 PM] Spawned!
[2/26/2015 2:49 PM] Spawning....!
 

Snake

Moderator
Moderator
Jul 13, 2014
288
174
28
Python:
# coding=utf-8
__author__ = 'DreTaX'
__version__ = '1.0'


import clr
clr.AddReferenceByPartialName("Fougerite")
import Fougerite

class Test:

    def On_PluginInit(self):
        Plugin.CreateTimer("Flare", 6000).Start()

    def FlareCallback(self, timer):
        timer.Kill()
        '''
            Museum Outside Flares
        '''
        flare_1_x = 6026
        flare_1_y = 398
        flare_1_z = -3223
        flare_2_x = 6012
        flare_2_y = 400
        flare_2_z = -3206
        flare_3_x = 6033
        flare_3_y = 446
        flare_3_z = -3216

        Plugin.Log("Test", "Spawning....!")
        World.Spawn("WorldFlare_New", float(flare_1_x), float(flare_1_y), float(flare_1_z))
        World.Spawn("WorldFlare_New", float(flare_2_x), float(flare_2_y), float(flare_2_z))
        World.Spawn("WorldFlare_New", float(flare_3_x), float(flare_3_y), float(flare_3_z))
        Plugin.Log("Test", "Spawned!")
        Plugin.CreateTimer("Flare", 6000).Start()

Exception: Trying to read past the buffer size - likely caused by mismatching Write/Reads, different size or order.
at #=qSFQEDe676da4RLJCNyT7Ow0Ph4c9pfFQnpb__PjA4SE=.#=qFpqsYyPHE5V9jF$rFjBbIw== (Boolean #=q8xVUhTT4wIpWWJBoI23tmA==, System.String #=qe7ARaxisBQ5dLwpDYnZEmg==) [0x00000] in <filename unknown>:0

at #=qDyYck6jY0p_qh6doTcsvIbN8t3TKJHLMicx6djrzRdg=.#=qdhJag_NO35ge6UsW1HeE1w== () [0x00000] in <filename unknown>:0

at #=qDyYck6jY0p_qh6doTcsvIbN8t3TKJHLMicx6djrzRdg=.#=qJLI$zIK9gAyQBWbSDgarkQ== () [0x00000] in <filename unknown>:0

at uLink.BitStream.#=qptl0JDkyVHfFB1CW3NFd36V9$64fzf2pF_0$eyHZKSc= () [0x00000] in <filename unknown>:0

at uLink.BitStream.ReadVector3 () [0x00000] in <filename unknown>:0

at RigidObj.uLink_OnNetworkInstantiate (uLink.NetworkMessageInfo info) [0x00000] in <filename unknown>:0

at FlareObj.uLink_OnNetworkInstantiate (uLink.NetworkMessageInfo info) [0x00000] in <filename unknown>:0
UnityEngine.Component:BroadcastMessage(String, Object, SendMessageOptions)
uLink.NetworkInstantiatorUtility:BroadcastOnNetworkInstantiate(NetworkView, String, NetworkMessageInfo)
uLink.NetworkInstantiatorUtility:BroadcastOnNetworkInstantiate(NetworkView, NetworkMessageInfo)
uLink.#=qZjxFA8ttwRxSYz9$4En7Mn41hCXF1S_ABh6WzGJazgI=:#=qdmnGhYiIS0XvXIgGMhvds1ywrgdUY7_av01tlGk4ROo=(String, NetworkInstantiateArgs, NetworkMessageInfo)
#=qSBVG6i3HoKQx$z3bwADYIgVX_kCktQP8JwBh1CI$O_8=:#=qmJepjRgj7$6Ve6XGiSvGQA==(String, NetworkInstantiateArgs, NetworkMessageInfo)
#=qr9YotdsWVwSdbrj6D5OlmHWwwJVhBeBIJ5J461Az$DQ=:#=ql4zGMGx2z6li6Xi1fiSUyg==(String, NetworkInstantiateArgs, #=q__0aJnzE_j5V$E$xqdkd8PUPKgwbochaYTDqzGbXfa0=)
#=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=:#=qXQDiMUjzLPj0T5YuTz9vAg==(Vector3, Quaternion, NetworkViewID, NetworkPlayer, NetworkGroup, String, String, String, BitStream, #=q__0aJnzE_j5V$E$xqdkd8PUPKgwbochaYTDqzGbXfa0=)
#=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=:#=ql2EqNK$xYumhzpJHyBCMlg==(NetworkViewID, NetworkPlayer, String, String, String, Vector3, Quaternion, NetworkGroup, Object[])
#=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=:#=qUNDGP7vqYhy$RGbHjP$TZQ==(NetworkPlayer, String, String, String, Vector3, Quaternion, NetworkGroup, Object[])
#=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=:#=q_HGDPhHq_ECCILu9hhTKmg==(NetworkPlayer, String, Vector3, Quaternion, NetworkGroup, Object[])
#=qjg$mq9k6hZwR1eaAS3eQ4dux$3oD_j8CRZte$f$nFV0=:#=qejjzXWDDjis8nDiBIE7jtg==(String, Vector3, Quaternion, NetworkGroup, Object[])
#=qSBVG6i3HoKQx$z3bwADYIgVX_kCktQP8JwBh1CI$O_8=:#=qevt4XbWcf0AFLrX0HW8$5A==(String, Vector3, Quaternion, NetworkGroup, Object[])
uLink.Network:Instantiate(String, Vector3, Quaternion, NetworkGroup, Object[])
NetCull:Instantiate(InstantiateArgs&)
NetCull:InstantiateStatic(String, Vector3, Quaternion)
Fougerite.World:Spawn(String, Vector3, Quaternion, Int32)
Fougerite.World:Spawn(String, Single, Single, Single, Int32)
Fougerite.World:Spawn(String, Single, Single, Single)
Microsoft.Scripting.Interpreter.FuncCallInstruction`6:Run(InterpretedFrame)
Microsoft.Scripting.Interpreter.Interpreter:Run(InterpretedFrame)
Microsoft.Scripting.Interpreter.LightLambda:Run7(CallSite, CodeContext, Object, Object, Object, Object, Object)
Microsoft.Scripting.Interpreter.DynamicInstruction`7:Run(InterpretedFrame)
Microsoft.Scripting.Interpreter.Interpreter:Run(InterpretedFrame)
Microsoft.Scripting.Interpreter.LightLambda:Run3(PythonFunction, Object, Object)
IronPython.Runtime.FunctionCaller`2:Call2(CallSite, CodeContext, Object, Object, Object)
System.Object:CallSite.Target(Closure, CallSite, Object, Object)
System.Dynamic.UpdateDelegates:UpdateAndExecute2(CallSite, Object, Object)
System.Object:CallSite.Target(Closure, CallSite, Object, Object)
System.Dynamic.UpdateDelegates:UpdateAndExecute2(CallSite, Object, Object)
System.Object:lambda_method(Closure, DynamicOperations, CallSiteBinder, Object, Object[])
Microsoft.Scripting.Runtime.DynamicOperations:InvokeMember(Object, String, Boolean, Object[])
Microsoft.Scripting.Runtime.DynamicOperations:InvokeMember(Object, String, Object[])
Microsoft.Scripting.Hosting.ObjectOperations:InvokeMember(Object, String, Object[])
IronPythonModule.IPPlugin:OnTimerCB(IPTimedEvent)
IronPythonModule.Events.IPTimedEvent:_timer_Elapsed(Object, ElapsedEventArgs)
System.Timers.Timer:Callback(Object)


Works,but it makes a rust error. I think uLink cant keep up with 6 seconds. Every flare lasts until 90 seconds. Make it a bit longer.

[2/26/2015 2:48 PM] Spawning....!
[2/26/2015 2:48 PM] Spawned!
[2/26/2015 2:48 PM] Spawning....!
[2/26/2015 2:48 PM] Spawned!
[2/26/2015 2:49 PM] Spawning....!
[2/26/2015 2:49 PM] Spawned!
[2/26/2015 2:49 PM] Spawning....!
[2/26/2015 2:49 PM] Spawned!
[2/26/2015 2:49 PM] Spawning....!
[2/26/2015 2:49 PM] Spawned!
[2/26/2015 2:49 PM] Spawning....!
This uLink ruining the whole game...
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
Or maybe place camp fires and change the name of that entity so on start up loop through all the entitys until you find the name you created and save that entity in a variable. Then you only need 1 timer... To search for world time, If time > 18 turn on fires elif time > 6 turn off fires.
Also you dont get that shitty error when spawning in Flares..
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
or even do Util.GetEntityatCoords(Vector3) on start up so you don't have to loop through every entity and you don't have to name the entity.
(I'm asumming you will have the area unraidable?)
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
I have C4 checker (remover) every 1 second, I'm planning to make it public, so is it good way to do that? I mean, it didn't crashed for me. Working for about couple of hours on Linux server.

BUT: Flares not working for me. I'll think about this fire places. jeezzzzz.... Could you check this log just to be sure that everything is fine with my server? I mean different than yours.

Look how many time we lost again because function what is working for you is not working for me. I'm sorry. And I want to work for big Event plugin now, I'm just wondering how I will do that ... ...
 

Attachments

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
I have C4 checker (remover) every 1 second, I'm planning to make it public, so is it good way to do that? I mean, it didn't crashed for me. Working for about couple of hours on Linux server.

BUT: Flares not working for me. I'll think about this fire places. jeezzzzz.... Could you check this log just to be sure that everything is fine with my server? I mean different than yours.

Look how many time we lost again because function what is working for you is not working for me. I'm sorry. And I want to work for big Event plugin now, I'm just wondering how I will do that ... ...
Code:
Traceback (most recent call last):

  File "<string>", line 51, in FlareCallback

SystemError: Object reference not set to an instance of an object
Whats line 51?

EDIT:
I wouldn't run loop checking for C4, I'd do like On_EntityHurt(Entity, DamageEvent):
I'd check if the damage is an area, if its in that area set damage to 0 and maybe refund the player if it was C4/Grenade?
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
I mean I checking if player have it in inventory before he even use :) I have PvE server and it's not good to have C4 enabled.

51 line is of course World.Spawn.... ;) So some bullshit with my server I see. I'll try to install it again and check.. Maybe I broke something with some plugin or whatever.
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
I mean I checking if player have it in inventory before he even use :) I have PvE server and it's not good to have C4 enabled.

51 line is of course World.Spawn.... ;) So some bullshit with my server I see. I'll try to install it again and check.. Maybe I broke something with some plugin or whatever.
Is your server running on windows?
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
No-steam. Ok. So I decided to make it just spawn with command. The story will be "When the Museum is lighted up, you can find loot box there"....

Now I'm wondering only if Loot box is respawning automatically, or nah. It will be hard to check if player picked up him, to not make any error or 10 boxes in one.

Code:
Traceback (most recent call last):

  File "<string>", line 51, in FlareCallback

SystemError: Object reference not set to an instance of an object
Whats line 51?

EDIT:
I wouldn't run loop checking for C4, I'd do like On_EntityHurt(Entity, DamageEvent):
I'd check if the damage is an area, if its in that area set damage to 0 and maybe refund the player if it was C4/Grenade?
And one thing for Jakkee for future - Like I said i checking players inventory, why?

1. Of course I don't want them to craft like 20 C4 and then waste they time and resource. They pickup C4 or Explosives and it disappear after second, with message that C4 is disallowed.

2. I think you don't want to check what made boom after boom. It will not work if player try to destroy fireplace. Let's say wooden door needs 100 health and C4 is making 150 damage. Sometimes it will be destroyed no matter what, because it's critical hit and game is deleting object first, then check what do you wanted to do with script.

As Fougerite is only plugin system for game, sometimes you can do nothing, except of error. (Like with player disconnected)
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
No-steam. Ok. So I decided to make it just spawn with command. The story will be "When the Museum is lighted up, you can find loot box there"....

Now I'm wondering only if Loot box is respawning automatically, or nah. It will be hard to check if player picked up him, to not make any error or 10 boxes in one.



And one thing for Jakkee for future - Like I said i checking players inventory, why?

1. Of course I don't want them to craft like 20 C4 and then waste they time and resource. They pickup C4 or Explosives and it disappear after second, with message that C4 is disallowed.

2. I think you don't want to check what made boom after boom. It will not work if player try to destroy fireplace. Let's say wooden door needs 100 health and C4 is making 150 damage. Sometimes it will be destroyed no matter what, because it's critical hit and game is deleting object first, then check what do you wanted to do with script.

As Fougerite is only plugin system for game, sometimes you can do nothing, except of error. (Like with player disconnected)
Why do you do a timer?

Check this:

Python:
# coding=utf-8
__author__ = 'DreTaX'
__version__ = '1.0'


import clr
clr.AddReferenceByPartialName("Fougerite")
import Fougerite

class Test:

    def On_EntityHurt(self, HurtEvent):
        if HurtEvent.Attacker is not None and HurtEvent.Entity is not None and not HurtEvent.IsDecay:
            if str(HurtEvent.DamageType) == "Explosion":
                HurtEvent.DamageAmount = 0

    def On_PlayerHurt(self, HurtEvent):
        if HurtEvent.Victim is not None and HurtEvent.Attacker is not None:
            if str(HurtEvent.DamageType) == "Explosion":
                HurtEvent.DamageAmount = 0

    def On_BlueprintUse(self, Blueprint):
        #if Blueprint.ItemName == C4 or Grenade...
Even players having C4 can't do shet with It.