ID:175121
 
Hello,
I am trying to make it so that when they Summon Shenron, the world darkens.
i tried using this code :
Summon_Shenron()
set category = "Inventory"
if(usr.dball1 == 1 && usr.dball2 == 1 && usr.dball3 == 1 && usr.dball4 == 1 && usr.dball5 == 1 && usr.dball6 == 1 && usr.dball7 == 1)
world << "The Mighty Shenron Has Been Summoned!!!"
view(12) << "[usr] has summoned Shenron!!!"
usr << "THE MIGHTY SHENRON APPEARS BEFORE YOU!"
var/area/outside/O
for(O in world) // look for an outside area
break
if(!O) return
overlays += 'black.dmi'
sleep(200)
overlays -= 'black.dmi'
area
outside // lay this area on the map anywhere you want it to change from night to day
layer = 6

//----------------------------------------

But it doesn't work.
Please help!
no errors?
In response to Nave
Yes, there are no errors, but it doesn't do anything in the game!
In response to Gokuss4neo
<code>var/area/outside/O=locate() if(!O) return O.overlays += 'black.dmi' spawn(200) O.overlays -= 'black.dmi'</code>

Your method of locating the area was wacky, and you'd specified "overlays" (meaning src.overlays) instead of "O.overlays". And I like spawn() better than sleep(). =)
In response to Crispy
thx man!
In response to Gokuss4neo
Sorry, after trying that, still nothing happened in game!
I used :
mob
verb
test()
var/area/outside/O=locate()
if(!O) return
O.overlays += 'black.dmi'
spawn(200) O.overlays -= 'black.dmi'

which is exactly what you said, so why isn't this working?
In response to Gokuss4neo
Did you put the area/outside on the map?
In response to Branks
I set the world Default to that area, surely that does it for me!
In response to Gokuss4neo
You have to make sure you set it right...also, in your map, right click on any place and you should see the layers, if it has a layer of 'outside' then your fine...
In response to Dragon of Ice
Thankz man!
In response to Gokuss4neo
No prob...just tryin to help!