cast spell by script?
- spectre900
- Posts: 124
- Joined: Fri Sep 14, 2012 1:47 am
cast spell by script?
I dunno, I have searched around for what seems like hours but I just can't seem to find any good reference on how to make a script cast a spell for you, or on you. Like if I want to force darkness to be cast to disable any light spell cast by your party (not including torches). Or cast a buff spell like fire shield.
Anyone know how to do that?
Anyone know how to do that?
Re: cast spell by script?
Well I know how to buff the party, fire shield would be:
And obviously changed for whatever effect you want, you can include a de-buff by changing the time to zero, and that will remove any effect. Same goe's if you wanted to curse/cure the party with Paralyse or poison effects by script.
Code: Select all
for i = 1,4 do
party:getChampion(i):setCondition("fire_shield", 60)
end
My Dungeons
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
Re: cast spell by script?
In general, lighting in LoG is hardcoded and you cannot touch it in simply way. You cann't play with party's lightsources like light spell is. There is not access to light spell if I'm not wrong and you cannot force champion to cast that spell.
You can only spawn light as fx, for example:
or as a light source you deffined as entity - see bellow.
Darkness is absence of light, so you cann't use:
Unfortunatelly you cannot spawn "darkness" spell as "fireball" as well. Darkness spell only sets hardcoded party light to 0 brightness I guess.
i.e you have to be more specific, what you wanna achieve - e.g. If you need dark corridor/room for some special event, you can use black light sources for that: viewtopic.php?f=14&t=4367#p44675
If you wanna make some special light puzzles based dungeon, as old Shadowlands dungeon was, you have to create you own spells, fx, party hooks, light manager scripts etc, etc...[/color]
You can only spawn light as fx, for example:
Code: Select all
function light()
spawn("fx", party.level, party.x, party.y, party.facing, "party_light"):setLight(1, 1, 1, 25, 25, 360, true)
end
Darkness is absence of light, so you cann't use:
Code: Select all
function darkness()
spawn("fx", party.level, party.x, party.y, party.facing):setLight(0, 0, 0, 0, 100, 10, false)
end
i.e you have to be more specific, what you wanna achieve - e.g. If you need dark corridor/room for some special event, you can use black light sources for that: viewtopic.php?f=14&t=4367#p44675
If you wanna make some special light puzzles based dungeon, as old Shadowlands dungeon was, you have to create you own spells, fx, party hooks, light manager scripts etc, etc...[/color]
I'm the Gate I'm the Key.
Dawn of Lore
Dawn of Lore
- spectre900
- Posts: 124
- Joined: Fri Sep 14, 2012 1:47 am
Re: cast spell by script?
So there's no way to make the darkness spell be cast or activated on your party as if cast by hand/runes?
There's gotta be some way to activate it even if the spell and its effect is hardcoded in the game. =/
There's gotta be some way to activate it even if the spell and its effect is hardcoded in the game. =/
Re: cast spell by script?
I am currently playing the One Room Round Robin 2 mod an Cube's room has some sort of script to cast darkness in his room. You might want to download the source code and check his room out. Good luck.
Re: cast spell by script?
His spell simply puts out the torches
Finished Dungeons - complete mods to play
- spectre900
- Posts: 124
- Joined: Fri Sep 14, 2012 1:47 am
Re: cast spell by script?
oh, that sucks. =/
Ah well, thanks anyway guys.
Ah well, thanks anyway guys.
Re: cast spell by script?
Yes, unfortunately, we have no control over that... but if you need darkness, you can implement something like the LightTracker in the ORRR2, which is quite effective at tracking light/darkness as Komag saw in his last video, and then force the player to make darkness himself as part of the puzzle.
In my original mod I started working on and interrupted when I moved on to DarkDale and the ORRR2, I had a "temple of darkness" where you needed to walk in pure darkness. The moment you lighted up a torch or a light spell, you were teleported (expelled) instantly outside. So no tricks possible like holding torches on mouse, throwing them past check plates or whatever. I had tied that to a puzzle where you needed to retrieve a key item from the temple vaults, which sealed you inside when you picked it up. So you had to actually then use that "light -> expelled" trick to exit the temple. The design was fun and worked well and I'll reuse it in my game for sure.
In my original mod I started working on and interrupted when I moved on to DarkDale and the ORRR2, I had a "temple of darkness" where you needed to walk in pure darkness. The moment you lighted up a torch or a light spell, you were teleported (expelled) instantly outside. So no tricks possible like holding torches on mouse, throwing them past check plates or whatever. I had tied that to a puzzle where you needed to retrieve a key item from the temple vaults, which sealed you inside when you picked it up. So you had to actually then use that "light -> expelled" trick to exit the temple. The design was fun and worked well and I'll reuse it in my game for sure.
- Eleven Warrior
- Posts: 736
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: cast spell by script?
So how did you did you do it Diarmuid ?? I am really interested in this...... Please let us know how u did it thxs I have done all the above tricks but using timers and other stuff. I am interested in how you did it, and how the hell did you do the load and delete levels in RRR2, simply amazing bro for sure ahy
Is it possible we can get a Demo Dungeon??
Oh and don't stop working on Dark Dale it's going to be awesome.. The Shop system you have is so cool with the asking price of items and the buying price, man cant wait till this game is out. I (myself) think it will kill LOG 2, it offers so much more that that game. errrrrrrrrrrrrr sorry I should not talk like that..........I have been following your posts, and I like what I see awesome keep up the good work. PLEASE GET DARK DALE UP AND GOING MATE
Is it possible we can get a Demo Dungeon??
Oh and don't stop working on Dark Dale it's going to be awesome.. The Shop system you have is so cool with the asking price of items and the buying price, man cant wait till this game is out. I (myself) think it will kill LOG 2, it offers so much more that that game. errrrrrrrrrrrrr sorry I should not talk like that..........I have been following your posts, and I like what I see awesome keep up the good work. PLEASE GET DARK DALE UP AND GOING MATE
Re: cast spell by script?
one possible solution is to draw a dark overlay on entire screen with party.onDrawGui hook
But that's really dark
Code: Select all
onDrawGui = function(g)
g.color(2,2,2,240)
g.drawRect(0, 0, g.width, g.height)
end
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450