Not sure how possible this is but basically I want it so that if the candle is in your inventory at all upon entering a dark room, the darkness is automatically removed (rather than having to get the candle out and light it manually)
Candle in inventory = automatically lit dark rooms
#1
Posted 03 June 2019 - 03:22 AM
- ShadowTiger and Shane like this
#2
Posted 03 June 2019 - 11:18 AM
Not sure how possible this is but basically I want it so that if the candle is in your inventory at all upon entering a dark room, the darkness is automatically removed (rather than having to get the candle out and light it manually)
You did not specify a version!!
In 2.55a24, you can simly use a passive item script:
item script autocandle { while(1) { if ( !Screen->Lit ) Screen->Lit = true; Waitdraw(); Waitframe(); } }
Set that scrpt to your candle, then enable the Item Editor flag Constant Script for that item, and you are done! The item itself runs this.
In 2.53, you would need to call something similar, as a function in your global active script.
//2.53 const int I_AUTOCANDLE = 99; //Set to item ID void do_autocandle { if ( Link->Item[I_AUTOCANDLE] ) { if ( !Screen->Lit ) Screen->Lit = true; } }
You can see where 2,5 5 has obvious benefits, with more, far smaler scrupts, rather than tacing more function calls into one massive lobal active script.
LMK what version you are using. If it is < 2.53, then those versions are now oifficially unsupported.
- Shane and Jenny like this
#3
Posted 03 June 2019 - 01:00 PM
My bad for not clarifying, I'm using 2.53 as of now.
- Shane likes this
#4
Posted 03 June 2019 - 03:44 PM
Thanks for your help ZoriaRPG
- Shane and coolgamer012345 like this
#5
Posted 03 June 2019 - 07:00 PM
I altered the script so the transition looks a bit nicer:
//2.53 const int I_AUTOCANDLE = 99; //Set to item ID void do_autocandle() { if ( Link->Item[I_AUTOCANDLE] && Link->Action != LA_SCROLLING) { if ( !Screen->Lit ) Screen->Lit = true; } }
This doesn't affect warps transitions, but those wouldn't be a line of code to fix I don't think.
- Shane and Jenny like this
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users