Jump to content


Photo

Calling SCAR from AI


11 replies to this topic

#1 Corsix

Corsix

    Code Monkey

  • Hosted
  • 290 posts
  • Location:Berkeley, UK
  • Projects:DoW AI, DoW Mod Studio
  •  Blue Text :)

Posted 30 November 2006 - 06:25 PM

Posted Image
function CpuManager:Update()

	if (Corsix_DoScarString ~= nil) then
		Corsix_DoScarString("print(\"Hello SCAR from AI" .. player_id .. "\")")
	end
You like?
Calling Corsix_DoScarString will not return any value/error, even if the LUA string you give it to execute is invalid or results in an error. Would you prefer a true/false return value to indicate success?

Also, as you'll need to change the DllName= bit in the module file, shall I copy the game manager enabling code from WXPMod_DCMod into this?

Edited by Corsix, 30 November 2006 - 07:05 PM.

Posted Image

#2 ArkhanTheBlack

ArkhanTheBlack

    title available

  • Members
  • 814 posts

Posted 30 November 2006 - 07:33 PM

Holy sh*t! Corsix, you're scary! :lol:


Calling Corsix_DoScarString will not return any value/error, even if the LUA string you give it to execute is invalid or results in an error. Would you prefer a true/false return value to indicate success?

A true/false return would be nice, but only if it isn't too much work. Just being able to call SCAR from the AI is amazing. :mellow:


Also, as you'll need to change the DllName= bit in the module file, shall I copy the game manager enabling code from WXPMod_DCMod into this?

I don't think that's necessary, since I planned our next AI release for the time Relic fixes the mod manager.


Great work, Corsix! If all works like expected, then this will give our next release definitely some new highlights. :p

Edited by ArkhanTheBlack, 30 November 2006 - 07:34 PM.


#3 Corsix

Corsix

    Code Monkey

  • Hosted
  • 290 posts
  • Location:Berkeley, UK
  • Projects:DoW AI, DoW Mod Studio
  •  Blue Text :)

Posted 30 November 2006 - 08:16 PM

Ok, try it.
if (Corsix_DoScarString ~= nil) then
		local did_it_work = Corsix_DoScarString("print(\"Hello SCAR from AI#" .. player_id .. "\")")
	end
(Remember to set the DllName line in the module file)

Attached Files


Posted Image

#4 dctrjons

dctrjons
  • Members
  • 36 posts

Posted 30 November 2006 - 09:47 PM

Anyone else totally lost with this conversation...anyone :mellow: . When people speak in languages I can't understand I get mad and kick puppies. :lol:

Edited by dctrjons, 30 November 2006 - 09:47 PM.


#5 troubadour

troubadour
  • Members
  • 88 posts

Posted 30 November 2006 - 10:38 PM

I guess that Corsix found a way to call SCAR functions from LUA, it seems that it is now possible to use these advanced functions in the AI mod and gain more control on the AI (and make it react to ping "attack here"/"defend here", one of my wildest dream MUAHAHAHAH !!!) hmph sorry i forgot my pills this morning

Whatever it is a real good news, btw as it was expected the RC2 works fine with the DC patch 1.11

#6 Corsix

Corsix

    Code Monkey

  • Hosted
  • 290 posts
  • Location:Berkeley, UK
  • Projects:DoW AI, DoW Mod Studio
  •  Blue Text :)

Posted 30 November 2006 - 10:40 PM

This stuff is aimed at Arkhan / LarkinVB - don't worry if you don't get it.
/me remembers the good old days where this forum was for development only :mellow:
Posted Image

#7 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 30 November 2006 - 10:53 PM

Damn you Corsix :mellow: ! If this will allow AI to send all kinds of data it can open LOTS of possibilities (and work).

I can already see the AI pinging players for their next attack target on minimap ....

#8 dctrjons

dctrjons
  • Members
  • 36 posts

Posted 30 November 2006 - 11:47 PM

Yeah I know it's not info for us but based on wht the others say.... :mellow:

#9 jureidinim

jureidinim
  • Members
  • 43 posts
  • Location:Whitby, Ontario, Canada

Posted 30 November 2006 - 11:48 PM

Damn you Corsix :mellow: ! If this will allow AI to send all kinds of data it can open LOTS of possibilities (and work).

I can already see the AI pinging players for their next attack target on minimap ....



Question here - does the AI currently do any form of "teamwork" with each other behind the scenes - like coordinated strikes?
Or will that also have to be done via SCAR?

#10 ArkhanTheBlack

ArkhanTheBlack

    title available

  • Members
  • 814 posts

Posted 01 December 2006 - 12:06 AM

Ok, try it.

Will do! Thanks! :mellow:


Question here - does the AI currently do any form of "teamwork" with each other behind the scenes - like coordinated strikes?

They act independent, but they recognize each other. Therefore they favor attack positions where other allies are already attacking.

#11 danuker

danuker
  • Members
  • 40 posts

Posted 01 December 2006 - 01:08 AM

I sense that 2.1 will be even greater!

Keep up the great good work guys.

#12 ArkhanTheBlack

ArkhanTheBlack

    title available

  • Members
  • 814 posts

Posted 07 December 2006 - 03:54 PM

@Corsix

Sorry for the late feedback, but fixing the multplayer/lag problems of the mod kept me quiet busy.

I've tried the dll now, but run into a problem. As soon as I set DllName = DCAIMod in the dowai.module file, I get a CTD while starting a skirmish map. :( Before, I removed your game manager dll and went back to the quick and dirty way to activate a mod. It works if DllName = WXPMod, but as soon as I change the dll name to DCAIMod, the game will crash while loading a skirmish map.

Any ideas? :p



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users