Author
|
Topic: Visions...
|
EP |
posted 01-28- 10:42 AM CT (US)
I am having trouble with visions, and I'm not sure why. I thought I knew what I was doing, but evidently not. I am trying to have it such that when I kill sprite#1 in room #1, an object appears in room #2. Everything is set up fine in the dinkedit, so I must be making a scripting mistake. Should I do this with global/local integers? If so, should I assign them to the sprite's script or to one of the room scripts? Can somebody give me an example of what they would do or something like that, cause none of the help files/walkthroughs I have found are working for me. Any help would be appreciated, thanks.
|
bdjnk
|
posted 01-28- 04:17 PM CT (US)
you want to use global ints because the local ones are bound to certain rooms and you want a reaction in a seprate room, i would do it as follows:create the global int integer#1 and set it too zero. put a if statement in the script of sprite#1 saying if you kill it the change integer#1 from zero to one. put a script on the room you want the vision to change in telling it that if integer#1 = 1 the vision should be changed to whatever you want. hope that helps (that's just how i would do it) |
EP
|
posted 01-28- 07:28 PM CT (US)
That's what I have been trying, and I haven't had much luck. How should I assign the integer change from 0 to 1 in sprite#1's script? Where should I put it and what should the command be? Also, is their a particular script that I should put the global_int in? I know it refers to all scripts, but does the script it's placed in have to be run before the global_int is recognized? Any further help would be appreciated, thanks. |
bdjnk
|
posted 01-28- 09:50 PM CT (US)
global ints are run in main.cintegers are changed as follows: int#1 += 1; or int#1 -= 1, or doing whatever basic math you need to do, the integer names (int#1) are treated as numbers. ie if int#1 was assigned a 3 in main.c and you tell a sprite while talking to say: "i have int#1 dogs" it will say "i have 3 dogs" but if before this in another already run script you write int#1 -= 1 it would say "i have 2 dogs" main.c is automaticly run before any other script so all globals will be in place as soon as the game starts. get the this .hlp file and i think it will help you a lot, i think this is the latest version but i am not sure. http://www.teleport.com/~sethable/dink/dinked15.zip |