Map Database  •  FAQ  •  RSS  •  Login

All those who are great at scripting...I need some advise

<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 05 Oct 2009, 02:41

All those who are great at scripting...I need some advise

Well I am working on a mission. Actually a campaign. And I hate getting 2 hours into the mission and have to start over cause the enemy won't attack. I have to try and fix the problem then test it again to see if it is working. I don't like spending countless hours over a mission with just testing. I know it may sound like I'm lazy but I really would like to see if there were any who had some advise on making attacks work so I would not need to test so much. Thanks.
I used to spam this forum so much...
<<

Krom

User avatar

Knights Province Developer

Posts: 3281

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 05 Oct 2009, 07:58

Thats the thing that bugs me most about mission editors - you have to play whole mission just to find out that last scripting command is a bit wrong and you need to fix it and re-test whole mission from begining.. I wish there was a shortcut to help to solve such cases
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 05 Oct 2009, 19:01

For TYPE 0 and TYPE 2 attacks: just give the enemy all required soldiers in the beginning and start the mission. If the attack works properly, delete the soldiers again.

For TYPE 1 attacks: set the COUNTER to 0, so they will attack immediately.

Now you don't have to play for hours but just for a couple of minutes.
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 05 Oct 2009, 21:32

For TYPE 0 and TYPE 2 attacks: just give the enemy all required soldiers in the beginning and start the mission. If the attack works properly, delete the soldiers again.

For TYPE 1 attacks: set the COUNTER to 0, so they will attack immediately.

Now you don't have to play for hours but just for a couple of minutes.
I have done this, and it saves me a LOT of time, but strangly it doesn't work if cirtain things happen in the mission. Something must happen that causes the enemy to not attack...

@Lewin

Hey, as I was writing this I got an idea. Do your editors place cammands in cirtain ways that were diferent in eariler versions? For example, I wanted to get rid of the CLEAR ALL command in you editor but I loaded up .8 insted of .9 I thought it was alright since I was just changing the CLEAR ALL command. But when I wnet to test the mission again, the enemys wouldn't attack. Is it possible that using diferent editors may have moved things around a bit? I doubt it but just checking.
I used to spam this forum so much...
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 06 Oct 2009, 01:54

Hey, as I was writing this I got an idea. Do your editors place cammands in cirtain ways that were diferent in eariler versions? For example, I wanted to get rid of the CLEAR ALL command in you editor but I loaded up .8 insted of .9 I thought it was alright since I was just changing the CLEAR ALL command. But when I wnet to test the mission again, the enemys wouldn't attack. Is it possible that using diferent editors may have moved things around a bit? I doubt it but just checking.
Yes, that is defiantly possible. There were some quite bad bugs in version 0.8 that could have caused all sorts of differences. It might have deleted the attacks because of a bug or they were in a different format. Please only use the latest version. It doesn't matter that you are just changing one thing, that whole script is reinterpreted and rebuilt. This means that commands can be lost due to bugs in that version. As far as I know 0.9 is almost bug free, I've had very few actual bug reports.
Try loading the mission in 0.9 again and checking if the AI attacks are still there. They might have been totally deleted.
It would be best (if you can) to revert to the version from before you saved it from 0.8. If you can't do that then just check that the attacks still exist. Possibly just resaving it with 0.9 will fix the problem.
Let me know how it goes.
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 06 Oct 2009, 03:37

Thanks LEwin. I am looking through the editor right now. Can't find anything wrong, but I saved it so maybe it will get it back on track? Well I hope I can get it working.

P.S I am not sure about only having 30000 of one thing in the storehouse...I think you can go on to 900000+ but it just doesn't show up. I always had the Ai start with 999,999 of every kind of food so I KNEW they wouldn't starve. They never did. So I am thinking that you can have as many resourses as you want in there, they just don't show up on the menue any more.
I used to spam this forum so much...
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 06 Oct 2009, 13:16

If the attacks don't work, you could take a look at the script and see what's wrong (or copy-paste it to here so others can take a look).
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 07 Oct 2009, 02:16

I would copy I AI but seeing as I can't figure out how to copy/paste in Lewins editor, what is quite impossible isn't it? *hint *hint
I used to spam this forum so much...
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 07 Oct 2009, 22:50

I would copy I AI but seeing as I can't figure out how to copy/paste in Lewins editor, what is quite impossible isn't it? *hint *hint
Go to the Script tab at the top of my editor. Look through it or do a search for "attack". The AI attacks come in blocks of code that start with !SET_AI_ATTACK TYPE and end with !COPY_AI_ATTACK. You can see which team number it belongs to by looking above it for !SET_CURRENT_PLAYER #. (#+1 is the same as the team number in the treeview, because in the script player 1 is player 0) Copy that block of AI attack code here and The Dark Lord and I can help you work out what is wrong with it.
P.S I am not sure about only having 30000 of one thing in the storehouse...I think you can go on to 900000+ but it just doesn't show up. I always had the Ai start with 999,999 of every kind of food so I KNEW they wouldn't starve. They never did. So I am thinking that you can have as many resourses as you want in there, they just don't show up on the menue any more.
The actual limit in KaM is 65535, (if you enter something higher it will be set to that) which is the maximum size of an unsigned integer. (16 bit positive number) After an amount it stops showing it when you click on the storehouse, but it still keeps track of the actual number. The reason why I limited it to less than that is simple: If you have 65535 stone in your storehouse and a serf delivers another one from a stone mason to the store house, the number of stone is 65535+1. Now because it is a 16 bit integer, it cannot physically store 65536. This means that it resets to 0. This is a problem because if the AI is producing those wares then it will run out as soon as any more are delivered. I thought it easy to limit it in my editor to 30,000 as that should never run out, (it would take months of game play to use that much food) as it seems easier than explaining this to every person who might not understand why their AI runs out of food.
Lewin.
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 08 Oct 2009, 00:47

Yeah 30,000 of each food is a lot...I guess it doesn't matter... Well I guess the reason that the AI never ran out of food is that they ate it up before they got 65536 food. Thanks Lewin. :wink:
I used to spam this forum so much...
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 10 Oct 2009, 16:38

I jave another question. When you use in Lewins editor and select attack: attack closest unit from army (I don't know the script name, sorry) it usually doesn't work for me most of the time. Are there any things that could be causeing this? I usualy use attack closest building from start posistion attack but bowmen are dumb and just get killed in this kind of attack :(. Oh, and I have noticed that if you say the enemy need at least 0 units before attack the attack won't work. A bug :D I usually don't see this posed anywhere so I will put it here!
I used to spam this forum so much...
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 11 Oct 2009, 00:56

I jave another question. When you use in Lewins editor and select attack: attack closest unit from army (I don't know the script name, sorry) it usually doesn't work for me most of the time. Are there any things that could be causeing this? I usualy use attack closest building from start posistion attack but bowmen are dumb and just get killed in this kind of attack :(.
No idea about that.
Oh, and I have noticed that if you say the enemy need at least 0 units before attack the attack won't work. A bug :D I usually don't see this posed anywhere so I will put it here!
This is a bit of a misleading thing in my editor. Troops needed before they attack is actually something more like "total troops that will go on the attack". The attack just won't happen until they have that many troops. So if you set it to 12 and tell them to bring 3 groups of 12 men, they will only take one because that is like a limit. So when you set it to 0 they can only take 0 troops on the attack.
It's something like that anyway. It's best to set it to the number of troops that will be attacking.
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 11 Oct 2009, 01:04

This is a bit of a misleading thing in my editor. Troops needed before they attack is actually something more like "total troops that will go on the attack". The attack just won't happen until they have that many troops. So if you set it to 12 and tell them to bring 3 groups of 12 men, they will only take one because that is like a limit. So when you set it to 0 they can only take 0 troops on the attack.
It's something like that anyway. It's best to set it to the number of troops that will be attacking.
This might be...why many hourss of testing have turned to nought but a waste of time. Thanks for the tip, it will citrainly help :roll:
I used to spam this forum so much...
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 11 Oct 2009, 08:01

I commented that already on your mission "Vortamic", and then Lewin gave a further explanation. You should have known already. :roll:
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 12 Oct 2009, 12:30

Hmm I only remember having too many AI defence positions. When I have time I will look at the reviews :wink:
I used to spam this forum so much...

Return to “General Talk”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest