[XP] Global Switches and Variables for RMX-OS

Started by Blizzard, January 07, 2010, 02:25:30 pm

Previous topic - Next topic

Blizzard

Don't do it like that. The timer will restart and the event will be gone forever if all players leave the map. Use a parallel process for that kind of stuff and let it's count down from a variable each frame instead of using the wait command.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Scitz

Thanks allot for reply.
Im not so familiar with variables yet but i will try that.

Also the event does not disapear forever.. Timer indeed resets but when u wait the appropiate time the flowers spawn again.

Thanks again.

Blizzard

If you leave the map, the event will never finish and the last command will never be executed.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Scitz

I dont want to disagree with the best scripter i know.

But when i put event on map "a flower"
When i pick up self switch a goes ON.
Wait 200 = 10 sec
Self switch a OFF
Flower apeares on map again.

If i pick flower, wait 8 sec, leave map, come back, 10 sec later flower spawns.
So if i pick flower, wait 8 sec, leave map for 3 hours, come back, i wait 10 sec and flower comes back.

So sadly i have to disagree, event does not disapear. Last command will be executed when u enter the map.

Blizzard

That's weird. I was sure that events aren't processed when you're gone from the map.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ThallionDarkshine

They arent, unless hes using some obscure script

Scitz

When your gone they arent, but when your back they are.
They just reset.

Like if i leave map 10 times after 8 sec, than the 11th time i enter the map i again need to wait the full 10 sec.

Also im not using anything "obscure" i think. unless Enu SBS Tanketai XP is obscure, im honest i dont know what obscure is and im atm to lazy to look it up.

Blizzard

He just meant that you may be using a script that changes the event behavior.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

AnimeGirl

When you say
Quote
Make a new file with an .rb extension in the Extensions folder of RMX-OS and copy-paste this script into it.
what do you mean


Blizzard

Literally that. When you extract the RMX-OS server, there is a folder called Extensions. Make a new file, call is whatever you like, open the file in Notepad, copy-paste the extension code from my post into the file and save it. And don't forget to add the filename in the EXTENSIONS setting in cfg.ini so it's being loaded when RMX-OS starts.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Scitz

Ok so i got it working only not with flowers but for chopping tree's

But my question: will the server become more laggy if more Variables are counting down at the same time?
Also when i chop tree A and the countdown begins (1000 frames)
Then after some seconds i chop tree B so also that countdown from 1000 frames begins.

But for some reason the countdown from tree B is faster, so the tree i chop last will respawn first.. how is that possible..?

Also, is there a way to make Selfs switches global?

Cus i now have 30 Common events so u can chop 30 diffrent tree's (if i use a self switch then for me the tree disapeares when i chop it but for other people not)
And if i use 1 common event for 30 tree's then when u cut one tree all 30 tree's disapear (if i make them all disapear when common event "tree chopped" is active)
Thanks and sorry for the many questions..

Blizzard

You will obviously need one variable for every tree.
No, self-switches are not supported, because the setup would be very, very difficult.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Peco92

September 27, 2013, 06:45:19 pm #73 Last Edit: September 28, 2013, 02:28:12 am by Peco92
Hi! Thanks for this script, but i have an error.
I made all steps but the client freeze at the login when it says receiving.
It load all (41 / 41)

Version of RMX-OS = 2.0
This script. downloaded one hour ago.

Can you help me?

Edit: in the error.log appear this:

Warning: Incoming message not handled: LGDAT

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Peco92

September 28, 2013, 04:05:28 am #75 Last Edit: September 28, 2013, 10:20:25 am by Peco92
Yep.

I notice one thing.. I have a problem with ruby for the encoding UTF-8. I don't know why.. i try to reinstall ruby, but nothing has changed.
Infact when I open the server in the cmd it says: error in open file Global switch.... cannot be loaded.
then: invalid multibyte char (UTF-8)

Actually i make research on the net for solve it.

Edit: I solve it! Anyhow Thanks for Yours awesome scripts :)

Edit2: I have another problem  :^_^':. I want to save a variable that looks like an array but it causes crash..
I write that codes on a scene for debug:
$game_variables[1] = []
$game_variables[1][0] = x

What do you think: is better make another class with array to save? So I will try.. Any hints?

Blizzard

If I remember right, I think I implemented everything to work only with numbers. That way I wouldn't have to serialize data and can save bandwidth.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Peco92

Ok. I understand, anyhow i can use this script too.
It only means more work :). Thanks
In the meanwhile I will study more ruby. See ya!

whitespirits

Im having a problem with this script similar to what Paco had but there no fix info, when i login i get stuck on Receiving:17/17 with titlescreen pic in background? I added extension and script.