Important Pluton for Experimental Branch

Status
Not open for further replies.

balu92

Retired Staff
Retired Staff
Trusted Member
Jul 11, 2014
338
75
28
34
we didn't added the attacker, I was thinking about two different solutions for that and then I totally forgot about it... I'll find out something for that soon
 

coersum

Plugin Developer
Plugin Developer
Oct 9, 2014
77
5
8
47
Parts Unknown
we didn't added the attacker, I was thinking about two different solutions for that and then I totally forgot about it... I'll find out something for that soon
I did notice that the DeathEvent.cs has an attacker, maybe just duplicate that code since it gets the attacker from the same HitInfo as the other events:

public BaseEntity Attacker {
get {
return _info.Initiator;
}

I made is a Player type because I wasn't sure how to get Player from BaseEntity once I was in Python though :D
 

balu92

Retired Staff
Retired Staff
Trusted Member
Jul 11, 2014
338
75
28
34
I did notice that the DeathEvent.cs has an attacker, maybe just duplicate that code since it gets the attacker from the same HitInfo as the other events:

public BaseEntity Attacker {
get {
return _info.Initiator;
}

I made is a Player type because I wasn't sure how to get Player from BaseEntity once I was in Python though :D
Python:
baseplayer = baseEntity.ToPlayer()
if basePlayer is not None:
    player = Server.FindPlayer(basePlayer.displayName)
 

Skully

Plugin Developer
Plugin Developer
Sep 8, 2014
91
7
8
Question 2:
I also made a pluggin to sethome/gohome by setting DataStore.Add("homelocation", Player.SteamID, ploc) (ploc = vector) which works great but when I "quit" and start the server again, the locations are gone.. do I have to save the locations or should Datastore save its arrays auto?
It should work but I made it to save in INI file... @mikec helped me
That's what a Vector3.ToString() looks like. To convert the string back to a Vector3, strip the parentheses and commas, and parse each number to a float. Then use them as arguments to instance a new Vector3. This is exactly what DataStore does when someone saves a Vector3 to it, and recalls it later.
It is safer to save locations on INI
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
It is safer to save locations on INI
Well saving it in a INI file will keep the data in there until you delete the file.
Also reading from an ini file is slower than reading from the datastore.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Datastore is for saving bigger dbs. Like If i would convert KKMoney now, I would probably remove the inifile completely. Why? Since putting small ints to a bunch of Ids can even make the inifile full. Making a for cycle in the keys of the ini would be also slower. But, using inifile for like 20 locations and some configurations and any other things, is better than the ds.

Sent from my Samsung Galaxy S4
 

Spoon

New Member
Member
Oct 10, 2014
2
0
1
33
Could we get MySQL or even let us import MySQLdb if we have python installed on the server we are running pluton on.
 

Skully

Plugin Developer
Plugin Developer
Sep 8, 2014
91
7
8
Sometimes my datastore seems to delet but ini can be copyed!... And i didn't any problems yet...
 

balu92

Retired Staff
Retired Staff
Trusted Member
Jul 11, 2014
338
75
28
34
that can happen if you store non-serializable data in the ds (like the player object)
 

Dunne

New Member
Member
Oct 6, 2014
13
0
1
36
At the moment i guess its impossible anyway to have plugins that acctualy works with no errors , experimental way .....u do they update so no... i wait for a stable rust with all the stuff :)
 

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
At the moment i guess its impossible anyway to have plugins that acctualy works with no errors , experimental way .....u do they update so no... i wait for a stable rust with all the stuff :)
I recommend this for most people :)
 
Last edited:
Status
Not open for further replies.