Author
|
Topic: Yet another odd question from me
|
FF4LIFE |
posted 06-19- 12:17 AM CT (US)
I've got this status screen, and you click a button, and thats all good, but the button is a different script than the icon of the screen, obviously since i plan to have many buttons. So this button brings up a choice menu when you click it, yada yada yada you choose one. Then what I want to do is kill that script, i can do that, but then run a proc in the status screen script, the original one that brought up all the buttons and stuff. I know how to do this with the run_script_by_number command. But this brought up a question from me. How do i figure out which sprite is the status screen? Help! Is there someway to find the only sprite of a certain frame? I thought of using a global and setting the global using this : &status-number = sp(¤t_sprite); then putting that into the next script, making: run_script_by_number(&status-number, "proc"); but it doesn't seem to work right.... is there a better way to run the proc from the original script? Also, if i do run it, will it be the same sprite. That sounds odd, but on the void click proc i have it kill itself, with sp_active(¤t_sprite, 0); but if i run the proc using that command, will it have made 2 of the sprites, or will it go back to the one that is still running and run its proc. God, i can't word this at all... i suppose what i'm saying is i need a good way to run a proc on another sprite's script, without just making another sprite.
|
FF4LIFE
|
posted 06-19- 02:08 AM CT (US)
And on the topic of odd questions... Does anyone know if you can run an exe or bat file thru dink script? Becuase it would make changing map files a lot easier if i made an exe that moved the files and ran it from dink, then you could change map files instantly, without having to even leave dink! So if anyone knows of a way to do that, or just a better way to change map files in the middle of a game... |
FF4LIFE
|
posted 06-20- 01:06 AM CT (US)
Ok, ignore the first one, i thought of a better way of doing it. But i really would like an answer to the second one. |
Beuc
|
posted 06-20- 03:04 AM CT (US)
Hi, problems in the forum yesterday, couldn't reply.1) To search for the unique sprite with a given seq, then use a get_rand_sprite_with_this_brain (or so ) procedure, then check its procedure using $test = sp_seq($sprite, -1); if ($test = 20) ... 2) You can't generate .exe using dinkc (else there could be viruses :() Did you played LoT? He used a manual map change system, with very good explanations. Furthermore, when you use editor_type(¤t_sprite, 3); and such, then the saved game is altered to do a specific action on the given sprite of the current map #. So when you'll change map, ... Well, then let's say in MAP1/ROOM1/SPRITE10, there's a tree. The player burn the tree. Then the tree stay burnt, ok? Then the player change the map. Let's say that MAP2/ROOM1/SPRITE10 is a king. Well, for this player, the king will look like a burnt tree. You'll have to use great ManaUser's trick. Download "the Catacombs", and study the files in the "Transfert DMOD". You'll understand everything. This wasn't used in LoT, and I think this make bugs in the end if you killed a lot of spikes in MAP1. |
FF4LIFE
|
posted 06-21- 06:14 PM CT (US)
Hmm, tanks any way on the first thing, I found a better way of doing it...I guess thats a real bummer about the editor number thingies because I planned on being able to go back and forth between maps.....is there a way to save it all and load it again? Because i really need multiple maps, and the way my game is, you'd be able to go back and forth if you wished, and probebly would need to. Another thing, maybe if you can't run an exe with dink script, could it be used to move files? I played LoT, and i just think it would be better if you didn't need to do it yourself. Also, if you just minimize and change map files, as soon as you go to another screen the map is changed. So I hoped to use this to literaly make it so people don't know that there's a map change. It would give me unlimited space with little hastle. I'll go look at the catacombs thing, i suppose i should have before posting this... But yeah, i guess if there's no other way to change map files, i'll just tell them to minimize and such. |
FF4LIFE
|
posted 06-21- 06:20 PM CT (US)
Hmm, tanks any way on the first thing, I found a better way of doing it...I guess thats a real bummer about the editor number thingies because I planned on being able to go back and forth between maps.....is there a way to save it all and load it again? Because i really need multiple maps, and the way my game is, you'd be able to go back and forth if you wished, and probebly would need to. Another thing, maybe if you can't run an exe with dink script, could it be used to move files? I played LoT, and i just think it would be better if you didn't need to do it yourself. Also, if you just minimize and change map files, as soon as you go to another screen the map is changed. So I hoped to use this to literaly make it so people don't know that there's a map change. It would give me unlimited space with little hastle. I'll go look at the catacombs thing, i suppose i should have before posting this... But yeah, i guess if there's no other way to change map files, i'll just tell them to minimize and such. |
Beuc
|
posted 06-22- 07:36 AM CT (US)
Dink is NOT, made to use multiple maps. You *could* use another prog while running Dink.exe (Fairy-Goodness online works like this to provide Internet support), but if you want it to be safe and bub-free (ie avoid the king becoming a burnt tree like I said), then you'll have to use the catacomb (rather 'Tranfert DMOD')'s thingie, which is REALLY long. And each time the hole editor_type for each map will be lost... Solution: never use editor_type commands (so you'll have to use scripts and visions instead). FI editor_type commands allow for example to kill an ennemy for 5 or 15mn or forever, and allow to replace a sprite, in the future, by another one without attached script, for example for broken barrels.Good luck, so. I really wonder if it's just 'possible' to use multiple maps... Maybe a background program could to the trick, changing and doing backups of saved games when, for example, a given script countains a given value, and then change the map... You'll have to now a programming language allowing .exe generation (ie VB - but needs runtimes - Delphi, Visual/Borland C++, or maybe Quick Basic (NOT QBasic))... |
FF4LIFE
|
posted 06-22- 02:08 PM CT (US)
Ok, well, thanks. What I think I'm going to do is use a 'super variable' or a couple to record the things that the game would record, like locked doors and chests. I think i'll just have trees appear again, not burned, after you leave the screen. And now, for another question nobody can answer.I'm attempting to change the magic system to mp, and i thought of a great way. The green bar is full when you have full mp, so &magic_cost is equal to your mp, then you cast a spell, and &magic_level goes down, lets say 10. Then the green bar moves a bit, depending on your &magic_cost. The problem here is that the bar fills up, and I want to know if there's a way to make it not. And also to make spells be able to be cast when &magic_level does not equal &magic_cost. If not, I can make new globals, have &magic_cost be 0, and make my own green bar to go around, but that would be harder. So...any ideas? |
redink1
|
posted 06-22- 08:03 PM CT (US)
I don't think there is a way to use a spell if the magic level is not full. Just thinking, you might be able to use Z to use magic, and make Z store the magic value temporarily, and set it to full, then set it back to where it was before.As for making the magic meter stop, I can only think of continually setting it to a certain value... like keep making it 30 or something. Also, maybe you could set &magic_cost really, really high (like multiplying it by 1000), and make &magic_level in the same ratio (so if you multiply &magic_cost by 1000, multiply &magic_level by 1000 too). Also... beware when you are messing around with &magic_level and &magic_cost . While this may not happen with your D-Mod, those variables were 'messed up' when I was messing around with magic tricks in FIAT. I don't remember right now, but because &magic exists, &magic conflicts with those variables when you try to read what their values are. So I think I had to set &magic_level equal to &temp, then read &temp to see what &magic_level was... maybe :) Its been a while since I finished that part. |
FF4LIFE
|
posted 06-22- 09:30 PM CT (US)
Ok, one thing I could do then would be to use a different key, and have something else keep it constantly the same...the only problem with that is then magic isn't shift.... Maybe I could somehow have it so when you hit shift it sets it up for a split second...i doubt it tho. Could i use wait for key to do that? this is all so complicated...if i had &magic_cost at 0 then you could always cast....then i could just have another global act as &magic_level and make my own script for the green bar..... Does anyone know a really good way to do that bar? |
FF4LIFE
|
posted 07-05- 11:46 PM CT (US)
OK, just got back from vacation. Here's the deal. What I think is the best is to keep &magic_level and &magic_cost at 0. I tested this, and it allows you to cast all you want, and i haven't noticed any bugs. Then i can make globals to act as these two. One would be total magic points, the other current magic points. So, I need a good way to do the magic bar. Does anyone know how they did it? There has to be a good way. If not i suppose that i can make a sprite that has like 50 frames, each one with more green going around, then use crazy math skills to figure out which frame to do, but that won't be as accurate or cool. So basicaly, does anyone know how to make the bar go around using only that one graphic of the green bar that is in the game already? |
Beuc
|
posted 07-06- 11:49 AM CT (US)
I think you could also make &magic_cost to a really big number, then use some vars to remember *your* magic cost, and then set up a kind of timer to set &magic_cost to the value in the variable. And so you can manipulate the magic counter... |
FF4LIFE
|
posted 07-07- 07:33 PM CT (US)
Ok...so it would take like an hour to move it a pixel anyway, and i even have it set it back all the time...thats good...i'll just multiply it by 1000 or so...i'll let you know how well this works |
FF4LIFE
|
posted 07-09- 01:09 PM CT (US)
Gah! I just realized that that method won't work because it puts me right back to the start! You can't cast the spell if &magic_level doesn't equal &magic_cost! BLEH! Hrm...do you suppose there's a way i can make it cast the spell if they aren't equal? Or maybe a way to make &magic_level go up for just a split second when you hit shift? |
Tamtur
|
posted 07-10- 12:31 PM CT (US)
You know, I don't think it would be that difficult to add a graphic. (Maybe a bar next to the square that has the green bar going around would be easier than trying to go around the square.) All you'd have to do is have, say, a square that's one-twentieth of the height you want when it's full. Let's say &total is the total possible points and &points is the amount they have now. Just multiply &points by 100 and divide into &total (to find the percentage). You could use global variables for each of the little squares and test to see which ones are there then add or delete as needed based on the percentage, but that would use up 20 global variables. The other option would be to use sp_kill (make them a different brain or attach a nothing script or something so you can find them without using the global variable) before each recalculation and just redraw the sprites each time. Good luck
|
FF4LIFE
|
posted 07-10- 07:21 PM CT (US)
Yeah, i think i'll have to do a new graphic, either around it or beside it... i kind of like around it, thats cool, but it makes more sense if its for a charge time based thing. I think what i'll do is have a script always running that tests if you're on the same screen or a diff screen all the time, then draws it if you're on a different screen. It would be pretty easy also to just use one global for that, and have different frames and us sp_pframe to set it at a spot. But i just think the other way is so much more accurate than 50 frames or so...oh well, i'll make it a new graphic for now, and if i find a better way i'll change it.. i need to get a new demo out soon since i told everyone about it..so i better hurry, hehethanks for all the help, i'll keep ya updated. |