Autor Thema: faqs, ai scripting and other tech questions  (Gelesen 41123 mal)

0 Mitglieder und 1 Gast betrachten dieses Thema.

Offline speedy

  • Spezialist
  • *
  • Beiträge: 486
    • http://www.wz2100.de
faqs, ai scripting and other tech questions
« Antwort #45 am: 2003-08-16, 05:14:48 »
Zitat
you can add the script directly to the wdg file if you declare it in stats.wrf. then you can also have a script file just for it, and it's independent of the ai files


That's interesting... how do i do it ?
The wrong question. I make a file let's say 'boostingMoney.txt' with these procedure (givehelp(blahblah) { blahblah }). Is THIS ENOUGH for that file ?? (Can't think so...)
And when I include this in my mod (reference it in stats.wrf) ALL AIs would include it automaticly ? nice.  :)

an increasing rate ? sounds nice. by time ? (easy) or by research ? (don't know how...)

(I think I should take a more closely look at your proggie...  :wink: )
here AI . . . . . . . . .  Humans
boosted . . . . . . . . . loosing...

Offline speedy

  • Spezialist
  • *
  • Beiträge: 486
    • http://www.wz2100.de
faqs, ai scripting and other tech questions
« Antwort #46 am: 2003-08-16, 05:19:42 »
ups.

seen your new message AFTER I had answered your last...


(btw. ups means something like  :shock:  :shock:  :shock: )

for me it's about half past five in the morning now ... can't go through the code now... see my signature... banging my head ??? that's like I'm feeling in the moment  :wink: but anyway... thanx very much!!! I will read it again tomorrow, uh... today...

 :wink:
here AI . . . . . . . . .  Humans
boosted . . . . . . . . . loosing...

Offline Kevin

  • Durchschnitt
  • *
  • Beiträge: 19
    • http://www.ticon.net/~ejmalec/warzone
faqs, ai scripting and other tech questions
« Antwort #47 am: 2003-08-16, 05:31:43 »
Zitat von: speedy
Zitat
you can add the script directly to the wdg file if you declare it in stats.wrf. then you can also have a script file just for it, and it's independent of the ai files


That's interesting... how do i do it ?
The wrong question. I make a file let's say 'boostingMoney.txt' with these procedure (givehelp(blahblah) { blahblah }). Is THIS ENOUGH for that file ?? (Can't think so...)
And when I include this in my mod (reference it in stats.wrf) ALL AIs would include it automaticly ? nice.  :)

an increasing rate ? sounds nice. by time ? (easy) or by research ? (don't know how...)

(I think I should take a more closely look at your proggie...  :wink: )

for scripts, the basics are this:

you don't have to use the name "mod" obviously.
in stats.wrf (usually) add a linr for the .slo and .vlo file, like this:
the 2 files added are mod.slo and mod.vlo, to the stats folder.
directory  "messages/strings"
file        STR_RES     "Names.txt"

directory  "stats"
file        SWEAPON     "Weapons.txt"
file        SBODY       "Body.txt"
file        SBRAIN      "Brain.txt"
file        SPROP       "Propulsion.txt"
file        SSENSOR     "Sensor.txt"
file        SECM        "ECM.txt"
file        SREPAIR     "Repair.txt"
file        SCONSTR     "Construction.txt"
file        SPROPTYPES  "PropulsionType.txt"
file        SPROPSND    "PropulsionSounds.txt"
file        STERRTABLE  "TerrainTable.txt"
file        SSPECABIL   "SpecialAbility.txt"
file        SBPIMD      "BodyPropulsionIMD.txt"
file        SWEAPSND    "WeaponSounds.txt"
file        SWEAPMOD    "WeaponModifier.txt"
file        STEMPL      "Templates.txt"
file        STEMPWEAP   "assignWeapons.txt"
file        SFUNC       "Functions.txt"
file        SSTRUCT     "Structures.txt"
file        SSTRFUNC    "StructureFunctions.txt"
file        SSTRWEAP    "StructureWeapons.txt"
file        SSTRMOD     "StructureModifier.txt"
file        SFEAT       "Features.txt"

file        SCRIPT      "Mod.slo"
file        SCRIPTVAL   "Mod.vlo"

directory   "messages"
file        SMSG        "messages.txt"
file        SMSG        "ResMessages1.txt"
file        SMSG        "ResMessages12.txt"
file        SMSG        "ResMessages2.txt"
file        SMSG        "ResMessages23.txt"
file        SMSG        "ResMessages3.txt"
file        SMSG        "ResMessagesAll.txt"

then for the script files, the basic format is this:

mod.slo:

//Mod.slo    //all comments are OPTIONAl, this is how I do it
/*by Kevin Malec 2003
this is a script that does nothing
*/

//at the beginning of the file (here) are the variable declarations.  see scriptLang.wrf for more info on the script language

private INT playnum;

event nameOfEvent(trigger)
{
   //event code
}

event sampleEvent(every, 10)
{
   while(playnum<7)
   {
      addPower(10,playnum);
   }
}


basic vlo file:
mod.vlo (from one of my mods, none the less):

//Mod.vlo
script "Mod.slo"
run
{
  gate  STRUCTURESTAT  "CollectiveWall"
}


that is for this mod, if you put the above with this, you will have a working mod.  can you tell what it does?  a word of warning, this mod is in the beta stage (can you tell?)
//Mod.slo
/* by Kevin Malec 2003
logical assistance from Goth Zagog-Thou
/* func info
BOOL droidInRange(PLAYER, X,Y,RANGE) wrld units (128/tile)
initEnumStruct(leavefalse,STRUCTURESTAT,player,player2) p1-looking p2-has struct
STRUCTURE enumStruct()
destroyStructure(STRUCTURE)
STRUCTURE addStructure( STRUCTURESTAT, PLAYER, X, Y )
bool structureComplete(structure)
*/

private  STRUCTURESTAT  gate;

private INT a;
private INT b;
private STRUCTURE struct;
private BOOL gatesopen[20];
private INT gatesx[20];
private INT gatesy[20];
//private INT gatesbp[20];
private INT numgates; //20 for now
private INT playnum;
private INT gatesPlayer[20];

event AutoEnable(CALL_GAMEINIT)
{
   enableStructure(gate, selectedPlayer);
}

event gateCode(every, 10)
{
 playnum=0;
 //while (playnum < multiPlayerMaxPlayers)
 while (playnum < 7)
 {
 
  addPower(5,playnum); //remove this line, testing only
  numgates=20; //this is a diminutive limit, increase it sometime
 
  //gate opening code
 
  initEnumStruct(FALSE,gate,playnum,playnum);
  struct=enumStruct();
  while(struct != NULLOBJECT)
  {
   if(structureComplete(struct) and droidInRange(playnum,struct.x,struct.y,2*128))
   {
    a=0;while(a<numgates){if(not(gatesopen[a])){b=a;}a=a+1;} // find free gate var
   
    gatesPlayer[b]=playnum;
    gatesx[b]=struct.x;
    gatesy[b]=struct.y;
    gatesopen[b]=TRUE;
    destroyStructure(struct);
   }
   struct=enumStruct();
  }
 
  //gate closing code
 
  a=0;
  while(a<numgates)
  {
   if(gatesopen[a] and (gatesPlayer[a]==playnum) and not(droidInRange(playnum,gatesx[a],gatesy[a],2*128)))
   {
    addStructure(gate,playnum,gatesx[a],gatesy[a]);
    gatesopen[a]=FALSE;
   }
   a=a+1;
  }
  playnum=playnum+1;
 }

} //end gatecode


I just posted strata's cap code

the program is on my listed web site


I just noticed your board has a server-side mail program.  The email I use for this site (this should be obvious) I am willing to give out.  if you put it on a spam list I will stop giving out free code (incentive enough?) as it is, it's public on the other board and I have never recieved a single piece of spam.  the email you should use is kevin @ pumpkin-2.co.uk
The creation of a 1000 lines of code begins with an oversimplified idea that you though would take 100

Offline speedy

  • Spezialist
  • *
  • Beiträge: 486
    • http://www.wz2100.de
faqs, ai scripting and other tech questions
« Antwort #48 am: 2003-08-16, 16:36:30 »
thanx very much Kevin!

now the generator script is included in the wdg.
the only thing left in the AI-Files is the "money-boost" for the AI.
aiboost1.8beta1 comes with three different "boosts" for the AI:
- the original (not modified by me)
- little boosting(little more money)
- mega cheat (ai has infinite money  :twisted: )
and these are selectable in the WZStarter program so you can put 'unmodified' AIs to your left and 'mega-cheating' AIs to your right for example... (or a better example, when playing with an unexperienced friend, give him not-cheating enemies but the megacheating guys to you...)

please keep helping us and writing here *free* skripts  :P

hm, haven't that time to figure out what your gate-script can do...
but another idea I want to implement in aiboost 2.0:
is it possible to drop units on a given point on the map by scripting ?
(gate... star gate... you understand ??? or stratospere... beamer...)
here AI . . . . . . . . .  Humans
boosted . . . . . . . . . loosing...

Offline Kevin

  • Durchschnitt
  • *
  • Beiträge: 19
    • http://www.ticon.net/~ejmalec/warzone
faqs, ai scripting and other tech questions
« Antwort #49 am: 2003-08-16, 20:55:02 »
Yes, it is possible to drop units on the map be scripting.
the only problem with a stargate is that the unit's experience is not preserved.  If you don't care about that, you can make a stargate effect by removing the unit and placing an identical unit somewhere else.  you can copy all stats except exparience, because there is no function to get it (although you can set it)
you can't just change the unit's position because there is "no set method" for the x and y properties of a unit.

for the wzck problem:
Zitat
Zitat
I want to add more unit templates to the mod. It seems wzck doesn't handle NEW templates as it does with research topics for example.
That's not a problem for me because I take the output of wzck, add my other stuff to it per own made programs and compile it again with the makewdg program.


In order for a NEW unit template to appear in skirmish, it must be assigned to Group 5 ("Skirmish Player") on the Units Editor.  Scavenger infantry templates are immediately available; Tank-type templates will appear on the player's Design Window; cyborg- and transport- type templates will appear on the factory menu as soon as the cyborg's chassis has been enabled from research.

Zitat
there's a problem in the sensor window. I've made changes to the wide spectrum sensor with wzck 105b (yes very old, but it was STABLE for me ) imported it in 130 but nor this window crashes all the time...


First, what is the EXACT error message reported when WZCK crashes?  (Tell him to always report the exact message -- it actually does help me.  A lot.)  And by all means ship the WEW file my way so I can take a look at it.

Zitat
the next problem in wzck: the research data with are made with wzck are not in the right place, that means directory, it differs from the appropriate .wrf-file-info (have forgotten the exact name of the file...)
not a problem for me, but it should be solved sometime...


That is correct.  I changed the WRF's around primarily to accommodate the "Auto research" setting, which is normally stored outside of the actual WDG's.  This was a move by Pumpkin but it is absurd because the auto-research scripts (i.e., T2 / T3 research-jump scripts) are also stored in the WDG under the names "camtech.slo/vlo", which means that when you run v1.10 or v1.11 Warzone it actually performs the T2/T3 auto-research twice.

One hint (also a workaround) I can give him is always apply the v1.12 rule set when running a WZCK-made research mod.  (Just the ruleset though)

I should point out that the v1.12 rule set is compatible with WZCK research mods whereas the v1.10 ruleset is not.


you did make the units available to the player, right?

major point here is that this version of wzck is designed for the new rule set.
The creation of a 1000 lines of code begins with an oversimplified idea that you though would take 100

Offline Botti

  • Held
  • *
  • Beiträge: 586
    • CondorRO
faqs, ai scripting and other tech questions
« Antwort #50 am: 2003-08-16, 22:13:12 »
We want to make Jump-Gates in our MOD "WarZone 2120".

When this goes thats cool, please help us with scripting, Kevin :wink:

Greetings
  BotmanGT

(Thanks to DarkStrider!)

CondorRO Patch Client: site / topic
CondorRO Website: here.



Offline Kevin

  • Durchschnitt
  • *
  • Beiträge: 19
    • http://www.ticon.net/~ejmalec/warzone
faqs, ai scripting and other tech questions
« Antwort #51 am: 2003-08-17, 02:51:49 »
Zitat von: BotmanGT
We want to make Jump-Gates in our MOD "WarZone 2120".

When this goes thats cool, please help us with scripting, Kevin :wink:

Greetings
  BotmanGT

I started a project like this a while ago, but there is a piece of scripting missing.  all of the logic is there, though.  I will finish it sometime.

transporter mod
The creation of a 1000 lines of code begins with an oversimplified idea that you though would take 100

Offline speedy

  • Spezialist
  • *
  • Beiträge: 486
    • http://www.wz2100.de
faqs, ai scripting and other tech questions
« Antwort #52 am: 2003-08-17, 12:05:55 »
hi again Kevin,

some other questions concerning the research lists:
is it possible to check whether a player has researched a given topic ? (can't see a function for that in the language.wrf...)
(because I hate research topics which names starts with AI ONLY....  :wink:
I want them to be not shown in the research window but be 'researchable' by the AI by scripting them with enableResearch(..) but as the time as they normaly would be 'enabled'...)
 
a next thing: do you think it's possible to define/script a factory-type structure with an exit point to where the newly built units will be transported / beamed ? is it even possible to define any new type of factories ??

one more:
do you think I can get the update1.11-wew file ??  8)
(reason for this request: I want to make AIBoost compatible with 1.10 (and 1.12 too) but want to include some of the 1.11 goodies so they still can be used (like the dual heavy cannon  :wink: ))

thanx!
speedy
here AI . . . . . . . . .  Humans
boosted . . . . . . . . . loosing...

Offline Kevin

  • Durchschnitt
  • *
  • Beiträge: 19
    • http://www.ticon.net/~ejmalec/warzone
faqs, ai scripting and other tech questions
« Antwort #53 am: 2003-08-17, 20:11:45 »
Zitat von: speedy
hi again Kevin,

some other questions concerning the research lists:
is it possible to check whether a player has researched a given topic ? (can't see a function for that in the language.wrf...)
(because I hate research topics which names starts with AI ONLY....  :wink:
Unfortunately, I don't think so
Zitat

I want them to be not shown in the research window but be 'researchable' by the AI by scripting them with enableResearch(..) but as the time as they normaly would be 'enabled'...)
 
YES, this is possible.  you just make them have inpossible pre-requisites or something.  actually, even easier, remove the pre-requisites
Zitat

a next thing: do you think it's possible to define/script a factory-type structure with an exit point to where the newly built units will be transported / beamed ?
Yes, this could be done through scripting.
Zitat
is it even possible to define any new type of factories ??
you can define new factories, with different build speeds, but they have to build either tanks, cyborgs, or vtols
Zitat

one more:
do you think I can get the update1.11-wew file ??  8)
(reason for this request: I want to make AIBoost compatible with 1.10 (and 1.12 too) but want to include some of the 1.11 goodies so they still can be used (like the dual heavy cannon  :wink: ))
just import the weapons and whatever else you need into a 1.10 mod, one way or another.

the 1.11 update was made by hand, as wzck was not up to the challenge at the time, so I doubt there even is a wew file.
The creation of a 1000 lines of code begins with an oversimplified idea that you though would take 100

Offline speedy

  • Spezialist
  • *
  • Beiträge: 486
    • http://www.wz2100.de
faqs, ai scripting and other tech questions
« Antwort #54 am: 2003-08-17, 20:22:51 »
Zitat von: Kevin
Zitat von: speedy
hi again Kevin,

some other questions concerning the research lists:
is it possible to check whether a player has researched a given topic ? (can't see a function for that in the language.wrf...)
(because I hate research topics which names starts with AI ONLY....  :wink:
Unfortunately, I don't think so
Zitat

I want them to be not shown in the research window but be 'researchable' by the AI by scripting them with enableResearch(..) but as the time as they normaly would be 'enabled'...)
 
YES, this is possible.  you just make them have inpossible pre-requisites or something.  actually, even easier, remove the pre-requisites


and WHEN does the AI will research them ?
(because THIS is my problem... HOW can I define when the research is enabled for the AI...)
here AI . . . . . . . . .  Humans
boosted . . . . . . . . . loosing...

Offline Kevin

  • Durchschnitt
  • *
  • Beiträge: 19
    • http://www.ticon.net/~ejmalec/warzone
faqs, ai scripting and other tech questions
« Antwort #55 am: 2003-08-17, 20:37:41 »
Are you online now?  join the warzone2100 channel on gamesnet?

this is how the 1.10 ai does it
event doResearch(doResearchTr)
{
if( (player == selectedPlayer) or (not myResponsibility(player)) )
{
setEventTrigger(doResearch, inactive);
}
else
{
// for every research lab do this..
initEnumStruct(FALSE,resLab,player,player);
structure= enumStruct();
count = 0;
while(structure != NULLOBJECT)
{
skDoResearch(structure,player,0);
structure= enumStruct();
}


}
}
I think doresearch just goes through the list of research topics.  of course, you coulf just do it yourself with the other research functions.
The creation of a 1000 lines of code begins with an oversimplified idea that you though would take 100

Offline speedy

  • Spezialist
  • *
  • Beiträge: 486
    • http://www.wz2100.de
faqs, ai scripting and other tech questions
« Antwort #56 am: 2003-08-17, 21:01:33 »
yes I'm online now...

your code...
the doResearch tries to go through the research tree, but when you have deaktivated some tech it wont be researched.... at least I thought so...
(edit I've written "du"  :lol: )

???

manual with the research functions...

enableResearch
completeResearch

I know what to do with these, but...
but my problem is I want him to get for example the needle gun when he has finished all normal prerequisites... (asuming needle gun is deaktivated so the player could not research that part of the research tree but the AI would go on researching because all other rail tech is still in the tree...)

So I would say:
if (prerequisites==done) { enableResearch(needleGun); }

but how do I "if (prerequisites==done)" ?
here AI . . . . . . . . .  Humans
boosted . . . . . . . . . loosing...

Offline Kevin

  • Durchschnitt
  • *
  • Beiträge: 19
    • http://www.ticon.net/~ejmalec/warzone
faqs, ai scripting and other tech questions
« Antwort #57 am: 2003-08-18, 01:31:53 »
If that command does true research, as it says it does, you may be able to use enableresearch to enable the topic, then the ai will research it on it's own.  when it will get to it, I don't know.  some testing is required
The creation of a 1000 lines of code begins with an oversimplified idea that you though would take 100

Offline speedy

  • Spezialist
  • *
  • Beiträge: 486
    • http://www.wz2100.de
faqs, ai scripting and other tech questions
« Antwort #58 am: 2003-08-18, 12:00:28 »
but any idea anyway ?
I need something which will be true "sometime" then I could enable these techs...
but what is "sometime" ?
-> a time spezification : easy to program but not really cool.
-> a check. this would be perfect! but how ? and what type of check ?
best would be as I've writen the check if some other tech is researched but we both don't think this can be scripted.
so how can I archive that ?
any idea ? (don't need a complete answer or script in detail... the idea behind would help... in the first place...)

thanx again Kevin for your very professional help everytime!!
it's nice your here!!
here AI . . . . . . . . .  Humans
boosted . . . . . . . . . loosing...

Offline Kevin

  • Durchschnitt
  • *
  • Beiträge: 19
    • http://www.ticon.net/~ejmalec/warzone
faqs, ai scripting and other tech questions
« Antwort #59 am: 2003-08-19, 00:08:02 »
Parallel discussion:
Wzck bug(s)?

does my rank mean "Experienced"?  and it was there long before 15 posts.  I'm happy :)

our ranks:
(Watcher -1)
(Gaurdian -1)
(Ajudicator -1)  
(Overlord -1)
Gerbil  1  (if you don't know, it's a rodent like a mouse, but better)
Outlander  50  
Lone Wolf  100  (me with 368 posts)
Grey Warrior  500  
Clansman  1000  
Clan Leader  2000  
Council Elder  2500  

is there a list somewhere on this site of them?
The creation of a 1000 lines of code begins with an oversimplified idea that you though would take 100