Page 178 of 396
Re: Ask a simple question, get a simple answer
Posted: Thu Jan 05, 2017 5:48 am
by Killcannon
zimberzimber wrote:I don't know why the script is not triggering for you. Try adding a few print lines to see if it reaches a certain point and stop.
Also make sure you're spawning them on the correct level, because right now they spawn on the first level.
I also don't see a reason to spawn a lot of explosions on on tile. If you just want it to deal a lot of damage, set the tile damager power to a higher value.
And are you asking for help implementing what you're going for?
I don't want a lot of damage in a single spell. I want 7 x 7 zone blanketed with a small amount of continuous damage and the blast component doesn't really solve this. No I'm not asking for help with implementing what I'm going for. I believe all I really need to do is have a script that when ran has the monster wait a specific time, then check the X.Y.Z of the party. Then if the party is at that coordinate, say the tile is blocked; otherwise teleport the monster to the tile. This probably will need to be done via a script in a custom monster as part of the AI. Though I could setup this to be inside the map as well, probably not as clean though.
I'm trying to figure out why the script I'm using instead of placing and linking 42 spawner objects doesn't work when I have a nearly identical script on the very same map that does work. I'm fairly confident that height 1 is the correct height here as all my other spells on the map at height 1 work fine, but for sake of testing I did test height 0, and height 2. Which produced the exact same result.
Isaac wrote:Is it at all possible that the plate isn't calling the script?
What happens when you trigger the script via console?
Interesting idea, what I did was added a hudPrint("Working") to the line to see if the script was indeed triggering at all, and for good measure I set it to trigger only once. Here's the thing that happened. It spawned dialog multiple times in the first activation as if it was running a multiple times within a millisecond time frame instead of running just once. To make sure I added additional hudprints to see if it was indeed looping and it is. So for some reason triggering this script once is causing it to run multiple times. Or at least the hudPrint portion of it until the flag to turn off the timer kicks in. How many times I have no idea due to the 5 line limit of hudPrint. I'll try a simple print to the console next though.
I'm not sure how to activate the script from the console in the editor.... but I'm becoming more and more convinced that this has to do more with the dungeon itself and less the script. Perhaps my dungeon file has become corrupted?
Edit:
Here's the raw dungeon editor that I'm working with on this, starting location is in the room that I'm having problems with, maybe this will help?
Link is to Microsoft OneDrive:
https://1drv.ms/f/s!Ago61wngbtWYiDFl2K8dOk8RxrxA
Re: Ask a simple question, get a simple answer
Posted: Thu Jan 05, 2017 6:00 am
by akroma222
Killcannon wrote:
Interesting idea, what I did was added a hudPrint("Working") to the line to see if the script was indeed triggering at all, and for good measure I set it to trigger only once. Here's the thing that happened. It spawned dialog multiple times in the first activation as if it was running a multiple times within a millisecond time frame instead of running just once. To make sure I added additional hudprints to see if it was indeed looping and it is. So for some reason triggering this script once is causing it to run multiple times. Or at least the hudPrint portion of it until the flag to turn off the timer kicks in. How many times I have no idea due to the 5 line limit of hudPrint. I'll try a simple print to the console next though.
I always do this (print "YES 1" .... "YES 2" etc to console) to slowly check that a script is doing what I need it to, line by line
I usually try to print any relevant arguments/ variables/ data etc too
Killcannon wrote:
I'm not sure how to activate the script from the console in the editor.... but I'm becoming more and more convinced that this has to do more with the dungeon itself and less the script. Perhaps my dungeon file has become corrupted?
Code: Select all
scriptName.script.functionYouWanaActivate(arg1, arg2, ....)
Re: Ask a simple question, get a simple answer
Posted: Thu Jan 05, 2017 6:10 am
by Killcannon
akroma222 wrote:
I always do this (print "YES 1" .... "YES 2" etc to console) to slowly check that a script is doing what I need it to, line by line
I usually try to print any relevant arguments/ variables/ data etc too
Using this method it's running the script 3.75 times before it stops. All lines accounted for, so conditions are being met. It's likely that whatever is causing it to loop like this is what's causing the game to not actually spawn spell if my hunch is right.
Edit:
Tried from the console. I had to bind the key first, wasn't bound. Results are the exact same as triggering it.
Re: Ask a simple question, get a simple answer
Posted: Thu Jan 05, 2017 6:32 am
by akroma222
Downloading your files at the moment.....
Re: Ask a simple question, get a simple answer
Posted: Thu Jan 05, 2017 6:35 am
by Isaac
3.75 times?
** Where did you add the print statements?
Re: Ask a simple question, get a simple answer
Posted: Thu Jan 05, 2017 6:39 am
by Killcannon
Isaac wrote:3.75 times?
** Where did you add the print statements?
Right after each line at the end of the line. It's 3.75 times because it stops at Yes 3 the last time and doesn't go to Yes 4 which tells me some code in the program is killing the loop. Another note, I took out the timer and linked it directly to the trigger; and it does the same.
Code: Select all
function frostexplosion()
local fmax = 3
for x = -fmax,fmax do
for y = -fmax,fmax do
if ( (x ~= 0) or (y ~= 0) ) then
spawn("lightning_bolt_blast", 1, 25 + x, 7 + y, 0, 1) print("Yes 1")
spawn("lightning_bolt_blast", 1, 25 + x - 1, 7 + y - 1, 0, 1) print("Yes 2")
spawn("lightning_bolt_blast", 1, 25 + x - 2, 7 + y - 2, 0, 1) print("Yes 3")
spawn("lightning_bolt_blast", 1, 25, 7, 0, 1) print("Yes 4")
end
end
end
end
Re: Ask a simple question, get a simple answer
Posted: Thu Jan 05, 2017 7:02 am
by Isaac
if fmax == 3, the x loop runs eight times, and the y loop runs forty-nine times; but the function is only called once.
* I had wondered (at first) if you had accidentally placed some copies of the floor_trigger on the same tile;
and had wondered if you had accidentally unchecked 'triggered by party', for when it ran in one dungeon, but not in the other.
Re: Ask a simple question, get a simple answer
Posted: Thu Jan 05, 2017 7:18 am
by Killcannon
Isaac wrote:if fmax == 3, the x loop runs eight times, and the y loop runs forty-nine times; but the function is only called once.
* I had wondered (at first) if you had accidentally placed some copies of the floor_trigger on the same tile;
and had wondered if you had accidentally unchecked 'triggered by party', for when it ran in one dungeon, but not in the other.
LOL That wouldn't be above me for certain. I've done some pretty dumb things in this dungeon. But yea, I'm totally stumped why the hell is it running so many times when it's only called once? That shouldn't happen at all with the loop.
Re: Ask a simple question, get a simple answer
Posted: Thu Jan 05, 2017 7:25 am
by Isaac
The function is called once, but each pass through the x loop usually comes with a full pass through the y loop, [7 passes through the y loop, if fmax == 3].
Is this nested loop intended just for spawning a set number of lightning bolts in fixed positions?
**If so, there might be a simpler way to script it.
Re: Ask a simple question, get a simple answer
Posted: Thu Jan 05, 2017 7:48 am
by Killcannon
Isaac wrote:The function is called once, but each pass through the x loop usually comes with a full pass through the y loop, [7 passes through the y loop, if fmax == 3].
Is this nested loop intended just for spawning a set number of lightning bolts in fixed positions?
**If so, there might be a simpler way to script it.
Interestingly enough if I do this:
Code: Select all
function frostexplosion()
spawn("lightning_bolt_blast", 1, 22, 9, 0, 1) print("Yes 2")
end
It doesn't work either, and 22, 9 is the location of the pressure plate. I don't think this script could any simpler than that. It's still faithfully printing "Yes 2" though, and printing it once.