Recent content by MartinF

  1. MartinF

    Long term use of regs?

    exaclty... as long as the temp troops/items/parties are not in any of the native loops (something_begin, something_end) their native slots would never be used or set so it wouldn't matter which slot nrs you use.

    From a good coding point of view it might still be a good idea to declare the slots in module_contants, just so you (or someone else using the code) know what each slot does for that array unit.

    You could define say, troop_array_1 through however many you need and then define

    slot_array_whatever = 1

    and so on, so you have a reference for what is actually defined in each slot for the array troop.

    And yeah, the biggest benefit over using global vars would be that you can loop.  Since there's an eq and a ge operation for slots, you've got most of the functionality you'd have when comparing vars and when you need to do more complicated stuff you can get_slot and set_slot which are hardly very processor intensive operations.
  2. MartinF

    OSP Code Combat Spear Bracing Kit (Updated)

    it would be possible to code AI for the horses not wanting to run into the spear wall, just iterate over the agents, see if they are close to the wall and then script their behavior to move away from it. You could do this based on horse type, as trained warhorses would be more willing to charge to their deaths than a normal saddle horse, and throw some randomness in there for good measure.

    Equally, giving a limited range of rotation might also be possible but more difficult.
  3. MartinF

    New Jousting (just need animation!)

    it's frustrating that nobody has still been able to work out how to make the horseback animations work. Strange thing is that you would think they are separate animations, since the body position is different to when you're standing upright but if that were true they'd be relatively easy to find. So it has to be some sort of flag, which makes you wonder why the game doesn't just check to see if the agent is on a horse and then plays the proper animation.

    But yeah, apart from that I'm keen to see how you did all this :smile:
  4. MartinF

    Few Noob questions

    Maverick, can you also post your code that is giving those errors? Not the whole files but just the lines that it is giving the errors for. Two of them seem to be simple syntax errors, so probably just a comma left out or something, but the other one is interesting, I've never seen that before.
  5. MartinF

    Hi, One question.

    it might be possible by duplicating an existing entry and then changing the mesh id in the txt file to correlate with your new mesh

    if you open item_kinds.txt you'll see:

     itm_horse_meat Horse_Meat Horse_Meat 1  raw_meat 0  34078731 0 12 0 40.000000 100 30 0 0 0 0 0 0 0 40 0 0

    so raw_meat would be the mesh, for example.

    You should be able to duplicate one of the weapon tuples, paste it at the bottom, change the name (itm_) and the mesh and then you can edit the item in the item editor.

    I've never tried that but so no reason why it wouldn't work.
  6. MartinF

    Modding Q&A [For Quick Questions and Answers]

    If you want to learn more about using Wings3D you should check out Highelfs' video tutorials in the stickies on the main page, they are quite good and will teach you how to add more vertices and manipulate them.
  7. MartinF

    Long term use of regs?

    I think that was also what Twan meant, jik.

    And I think that would still be the best option as long as we can't directly use arrays for data storage. Although using a hundred global vars is not necessarily as bad as it would seem as their memory footprint is very small.
  8. MartinF

    Desert Islands, Gorillas, Lizardmen and other OSP ideas, models and textures

    judging by the stuff you make you quite like the mushrooms yourself hehehe

    but great work! way to think outside the box with the birds and insects
  9. MartinF

    What will return to a script

    yeah, see my response in the thread for the invisible agent thing, should be just near this one as I just responded to it again.

    You could make a list of slots in module_constants to use only with a temp party/item/troop and then store your data to that. Would be cleaner and easier for coding than using regs or global vars, if it's a lot of info.
  10. MartinF

    Agents control questions

    uhm.. why would the temporary party not be avialable in a mission?

    you can read/write slots to troops and parties from a mission template, I'm pretty sure. Same way you can scan inventory on a troop, even though the troop is not in the mission, you're identifying what type of troop an agent is and then you look at the general stats for that troop..

    but since I dont know exactly what you want to do, it's possible that I'm off target here.

    if you just want an array to store information in though, that would certainly be a possibility
  11. MartinF

    OSP Kit Combat Battlefield Tactics kit. Multiple formations per team+command revamp!

    In my experience MNB doesn't use floats or doubles.. so 0.1 would be difficult, but you could use 100 and 10
  12. MartinF

    Is there way to check for mounted agents? Is there a 'no loot' flag?

    how about just generally using the agent_get_horse operation?

    If that returns 0, there's no horse. Or at least I'm guessing that would be the case. You could test that quite easily by display_messaging the outcome of agent_get_horse

    Alternatively you could check the inventory for the horse but that won't tell you if the player dismounted, I think it'll still be in the inv, same if it gets knocked out.
  13. MartinF

    Free Camera after Death

    haha naturally gifted.. yeah.. I only spent a couple hundred hours trying to figure it all out :wink:

    It's strange that you're getting the m/n message.. make sure you corrected the victory condition to comment out the (neg|main_hero_fallen) because otherwise it won't trigger.

    Basically all my triggers relating to this should have (main_hero_fallen) as conditions so they should only show up when you're knocked on your ass
  14. MartinF

    Agents control questions

    you could have an invisible agent, technically, but you'd have to actually make an invisible troop which doesn't show up and you should also not forget to remove it since the game will still see it.

    But you don't have to use an agent just because you're in a mission. You can still use a temporary troop/item/party that's not actually in the mission to store temporary information to.

    Like say you make a temp_mission_party, then you can simply use that to store your information to. It's safer, since you can't forget to remove it, and it's also invisible and won't mess up the information in the battle overview or cause the mission to behave in a way you weren't expecting.

    As for the speed of scripted units, check out the native scripts for town walkers for how to set speed.
  15. MartinF

    "Script can fail" error?

    yeah kt0 already explained it.

    Basically envision this.

    You're writing a script that has to return something to reg0

    but in the root of that script (so not in a try_begin/try_end) you have a condition, like let's say (eq, ":my_var", 1),

    If :my_var isn't 1, then the whole script fails and won;t return any information.

    Just in case you didn't realize this could happen, the compiler throws this warning and prompts you to use cf_ in front of the script name so you as a programmer are aware that it won't always return a value.

    Usually when I get this, it means that I messed up my if statements, unless it's a script that's specifically meant to check for a condition
Top Bottom