B.A.D.

mysql question (infistar billboards)

10 posts in this topic

hey there!

i am using infistar billboards a lot and they are located in the db´s "vehicle" table when spawned.i adjusted the server so vehicles that werent moved for 7 days will be deleted and ,well the billboards are deleted too.

how do i go about making them persistent?freeze columns in mysql or?

 

thanks in advance

tha friendly sniper from your neighbourhood

20161019171325_1.jpg

Edited by B.A.D.

Share this post


Link to post
Share on other sites

Change your delete statement to not include classes of whatever the billboard class is, or run a scheduled job to update the last_updated_at field for all records with class of whatever the billboard class is every night.

Share this post


Link to post
Share on other sites
Advertisement

thanks for the tip.i am ,lets say advanced in scripting arma stuff but mysql isnt my cuppa.would someone give me an example here?

 

Share this post


Link to post
Share on other sites

What's your delete vehicle job's sql look like, and since I am at work and don't have access to the code or whatever, what's the class name of the billboards?

Share this post


Link to post
Share on other sites

Exile_Sign_TraderCity

the code in the exile.ini just says

[deleteVehicle]
SQL1_1 = DELETE FROM vehicle WHERE id = ?
Number Of Inputs = 1
SQL1_INPUTS = 1

 

Share this post


Link to post
Share on other sites

The delete vehicle thing after 7 days is in the exile code I assume then. Create an event on the database like this:

delimiter //
CREATE EVENT `update_billboards`
	ON SCHEDULE
		EVERY 1 DAY STARTS '2016-10-19'
	ENABLE
	COMMENT 'Sets last_updated_at for billboards'
	DO BEGIN
update vehicle set last_updated_at = current_timestamp 
where class in ('Exile_Sign_TraderCity');
END
//
delimiter ;

I used "where class in "... so you can add more classes if you want to in the future, where class='Exile_Sign_TraderCity' would also be sufficient, if you want to add more classes later, just make it a comma delimited list like:

where class in ('Exile_Sign_TraderCity', 'myotherclass1', 'myotherclass2')

This will run at midnight. You also need to make sure events are turned on for your database, in my.ini look for event_scheduler and set it to ON

https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_event_scheduler

It's actually in the my.ini, you don't need to start mysql process with the flag mentioned in that link, just set it in the my.ini. You will need to restart mysql for it to take effect.

Share this post


Link to post
Share on other sites

Hello Bad,

There is another solution that just might be a tad bit better/easier.

 

There are quite a few scripts which place a billboard on the map as an 'added object'.  They are outside of the DB, which means you can wipe/reset the DB and they would still be there.

 

This would be just like adding a barrier around something or placing a tent somewhere.

 

The beauty of this method is you can turn around and use it for SP, epoch, or some other ARMA 'thing'.  It would not be dependent on exile.  It would be independent.

 

A good starting point:  https://www.google.com/#q="arma+3"+billboards+script

 

You can test out your billboards locally then put into the server files.

 

:)

 

Share this post


Link to post
Share on other sites

thanks for that tip also!

i did it the custom.pbo style before but it just took so much more time to set up the signs.

if i ever have to reset my db the scheduled jobs will stay untouched and part of every backup so i am quite comfortable with the db style. 

i would just remind myself about not emptying the vehicle table,sorting rows by class and delete every row that isnt exile_sign_tradercity manually.well you see i come from arma2 here haha

Edited by B.A.D.

Share this post


Link to post
Share on other sites

The only real problem with storing them in the db is the fact that people can destroy them and they won't come back afterwards. :/

I personally always make map edits in a script that runs at server startup, at least that way you don't inadvertently lose buildings. Even if there is code to keep the billboards from taking damage, it's Arma :P and things you try and do don't always work lol. In A2 I have sign boards with custom textures, I disabled damage and they still would get destroyed if hit with a vehicle, so having them scripted at least gets them back on the next restart :P

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.