WB Tutorial Questions

Discussion in 'General Modification' started by Ranth, Jan 17, 2009.

Remove all ads!
  1. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,745
    Likes Received:
    375
    No, it can't be done like that alas. There is no way to read the faction flag: it isn't an integer, its something or other (I forget what) that the engine can read internally but can't be passed to a script, so you can't distinguish between the two groups (meaning, among other things, you can't distinguish which side the party choose to weigh in on). Also, once combat starts, while you can script NPC A to attack NPC B in the happy knowledge that their factions will drag in everyone around them, members of NPC B's faction will attack the party the moment their turn comes if they are closer, not withstanding the fact that the party didn't do anything. Then you get the fact that any monster-on-monster attack gets the 'friendly fire!' floatline. Finally, as you suggest, even if the party haven't gone anywhere near one faction and didn't touch them or anything, the combat won't stop when they wipe out the other guys: you have to deal with everyone.

    There are workarounds: there are always workarounds. Sitting here right now I can think of some very narrow ways to do certain things. But there is no simple universal way to do it,. I tried long and hard to do this sort of stuff with the mad hermit, and in the end the only way I could get him to fight beside the party was to add him as a follower before combat started, and then remove him again when it ended. not the best way, and of course it had bugs (if combat suddenly re-started, for instance, due to subdual damage, though I fixd that in the recent release).

    Ranth's video of his efforts seemed to suggest some cooperative combat, so maybe he figured it out :)
     
  2. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    1
    Hi all,

    If you didn't notice, I dropped off the face of the planet months ago. I burned myself out making that mod, to my ulimate frustration when it didn't work (and some more furstration from RL).

    I was thinking that I might be able to get everything to work, but not have the castle. So the Battle for Hommlet would be in, the forest encouter, and the dwarfs would be, but the PC's would be stuck in the tower. Would anyone like that?

    I dont have much time before school starts up again, and I am working like crazy, but I hate to see my scripting go to waste or become defunct before someone comes out with 6.0.0.

    Thanks,
    -Ranth
     
  3. Emirkol the Chaotic

    Emirkol the Chaotic Proud Polytheist

    Joined:
    Aug 20, 2008
    Messages:
    1,436
    Likes Received:
    1
    Sounds good to me! :thumbsup:

    I'm sure some of the modders here can help to preserve your work while you're away, so it'll be ready for any future releases.

    Good to see you around again! Burn out and RL. Ain't it a bitch??
     
  4. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,745
    Likes Received:
    375
    Judging from the quality shown on the video, I wuld definitely like to see this finshed.
     
  5. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    1
    **Raises the thread from the dead**

    Gentlemen,

    In the middle of the night last night, I was unable to sleep, and I believe I have discovered a way to implement the castle. Its simple, so it should work.

    As a reminder, the problems before were:
    1) I could not make the castle a scenary item.
    2) I could not find a script that ran on loading a saved game to check if it should load a castle map or not.

    But I missed a key concept, I could have the Hommlet map determine on mapload if it should be the Hommlet with castle map, or Hommlet without castle. It would operate as such:

    When the party goes to Hommlet, a first heatbeat script checks if it should have a castle on it. If it should, then it teleports the party immediatly to the Hommlet with castle map. Its a simple solution to my problem, and it allows for me to release my expansion. Does anyone see any flaws with this?
     
  6. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Via generic spawner? I think it should work. The only hitch might be cosmetic - a momentary delay when you appear on the original Hommlet map via world map travel, the first heartbeat fires, and you teleport to the Hommlet replacement.
     
  7. Basil the Timid

    Basil the Timid Dont Mention the War

    Joined:
    May 19, 2008
    Messages:
    1,052
    Likes Received:
    1
    I think we can all live with that very minor glitch in return for Ranth's awesome mod. The best inspiration happens on sleepless nights. Always best to have a pencil and paper on the nightstand.

    Go Ranth!!
     
  8. Emirkol the Chaotic

    Emirkol the Chaotic Proud Polytheist

    Joined:
    Aug 20, 2008
    Messages:
    1,436
    Likes Received:
    1
    Insomnia does have some benefits... besides the mild hallucinations you get @ 3-4AM.
     
  9. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,745
    Likes Received:
    375
    Yeah, its not the first time people have posted something along those lines - "While unable to sleep, I came up with this mod / breakthrough / effort!" We must issue Co8-certified No-Doz, methinks. :twitch:

    Regarding the idea - I tried something similar to combat the secret-door bug (spawn in one place then move the party instantly - it didn't work) and I am afraid it feels like an ugly hack :( But try it - I would also love to see your mod work :)
     
    Last edited: Jul 31, 2009
  10. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    Curiously, I had a similar idea for the Signpost (if you move players across the same map, without a map change, the camera doesn't pan, so I tried teleporting players to an intermediate map). I seem to recall something going wrong with it, but by all means give it a shot and post the results in the scripting secrets thread. Even if it doesn't work, knowing what doesn't work is just as important as knowing what does work.
     
  11. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    1
    I am going to put in a lot of hours this weekend on my mod. There seems to be a problem with my teleporting idea. For a functionality test, on my generic spawner for Hommlet I scripted something similiar to this:

    If on Hommlet Map
    Teleport to roadside map

    This did not seem to work. When my players got to the Hommlet map nothing would happen. However, if they used the signpost and wanted to go somewhere ( ex: village elder), it then teleported them to the roadside map. Apparently the intitial Hommlet map load wont work with my scripting.

    Can anyone think of reasons why it would not work, or possible work arounds? One possible work around would be a text box on load saying something like, "Arriving in Hommlet you see your castle in the distance." Which would load a new Hommlet w/ castle map when you make a text selection. This would get very annoying, but it may work. Any other ideas?
     
  12. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,745
    Likes Received:
    375
    Are they turning up in the same sector? If you hide the spawner down near the castle then come into town up near the church, the spawner won't be functional.

    Of course, you could do it that way: if they come into town away from the castle they just go abut their normal business, if they come in at the castle wprld-map point, they get transported, and if they walk over from elsewhere in Hommlet they get teleported too once they get close enough for it to matter.
     
  13. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    1
    Ted,

    If I were to try your idea of placing the spawner near the castle and it working if they got too close, then it would need to be on a heatbeat script firing every second, not a first heatbeat correct?

    I think you are right because I believe I have my spawner near the elders house for all of the battle spawning during the invasion or defense of Hommlet.

    On another note, you are definitely right Ted. I teleported the party to the Burnes Tower map node. Nothing happened when I teleported in, but once I moved closer to the spawner it teleported me. I moved the spawner to right outside burnes tower, and when I teleported in there was a momentary hang up and then it teleported me to the new map. Success!!!

    So I guess what I will do is as follows.
    1) Have one spawner near the elders house to spawn the appropriate bad guys.
    2) Have another spawner near Burnes Tower (or Castle) to load the Castle map when the guys get close enough. I think I will do a script that gets the coordinates from the leader of the party and teleports them to the same coords on the new map.

    The only major problem is that if the party is running from the Inn to the castle, then they would get teleported mid-run and stop running once the new map is loaded.
     
    Last edited: Aug 8, 2009
  14. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    1
    I did a quick search and could not find the answer to this. Is there a list of the different story state variables and their descriptions?

    I noticed that Burne will not tell you to destroy the skull until you reach story state 6. Not sure what I need to do in order to get there.
     
  15. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    The story states are:

    game.story_state == 0 - new game
    game.story_state == 1 - exploring Moathouse
    game.story_state == 2 - cleared Moathouse
    game.story_state == 3 - exploring Nulb
    game.story_state == 4 - exploring Temple
    game.story_state == 5 - found out about elemental factions
    game.story_state == 6 - found out about Zuggy

    I believe you only find out about Zugg from Whitman the farmer prisoner on temple level three or Hedrack himself.
     
Our Host!