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

Users who are viewing this thread

Chel

Master Knight
Hi guys,

I remember there being an item flag that would not allow it to be looted when a troop carrying it is killed. Does someone know what it is?

Thanks!
 
wait wait wait wait... I'm confused. Is this possible. Is it really possible that when they all mighty Chel asks a question about modding. It is just that easy? And the irony is that I was looking through the items file four times so I can answer the all mighty Chel. And then I see a pretty new guy answer him after 30min. And the answer is the one I though about all along but I though it was to simple. Cause I was stupid enough to think that the all mighty Chel had to ask super hard questions. Damn. This was a waste of one hour. But the result was fun :grin:
 
Err well... Rubik has done quite some nice stuff code-wise, too. So it's not as if a total modding newb helped him out.

And it's not so much remembering every single flag that makes a coder great but rather the ability to get concepts and ideas transformed into scripts.
 
rubik wrote some of the most groundbreaking code this board has seen in a long time, so I'd hardly call him relatively new. He just doesn't post as much as some of us.

But yeah, I see your point  :grin:
 
ooh.. But is there a way for moderators to increase or decrease your rank or what it's called. Cause I think rubik needs to be a higher rank and Swadii (TheWarlord) need to be something lower than a recuit  :wink:
 
well, guys, I have another possibly trivial question :grin:

when cycling through agents in a battle, is there a way to distinguish between those on foot and those on horse, like you can do for human/ally/alive/etc? I can't find one, and the two kinds of code I wrote to try and make the distinction myself just give a bunch of errors.

I know you can get agent's troop id, and check if the troop is mounted. But that doesnt really work if the agent isnt originally a mounted troop.

Thank you beforehand
 
Chel said:
Fei Dao said:
(agent_get_class ,":blah", ":agent"),
(neq,":blah",grc_cavalry),

genius! :grin: I never used classes before.

Just for devil's advocate sake, what happens if the agent's horse is killed.  Does their class change?  There are now on foot...

For Chel, would this mess with what you are trying to code?  I thought about checking the horse slot in the troop's inventory, but I don't think that changes when you dismount, and that would only be useful for NPCs...  I think...  Just testing the bounds of classes.
 
It seems to me that the agent class indeed changes to infantry/archer when dismounted, as when I choose infantry and give command the dismounted ones obey it. If I remember correctly.
 
jik said:
Chel said:
Fei Dao said:
(agent_get_class ,":blah", ":agent"),
(neq,":blah",grc_cavalry),

genius! :grin: I never used classes before.

Just for devil's advocate sake, what happens if the agent's horse is killed.  Does their class change?  There are now on foot...

For Chel, would this mess with what you are trying to code?  I thought about checking the horse slot in the troop's inventory, but I don't think that changes when you dismount, and that would only be useful for NPCs...  I think...  Just testing the bounds of classes.

Pretty sure if horse is killed they are no longer classed as cavalry. And that is perfect for what I'm coding. (actually this check for mounted troops is just a work around for something else I dont know how to do and dont want to spend the time to figure out)

however this class check does not apply to player.. so is there a way to tell if he is mounted?! :grin:
 
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.
 
MartinF said:
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

That was the first thing I tried, I thought that worked before, but it didn't seem now. Maybe I'll try again.
 
Back
Top Bottom