Banner left   Banner center   Banner right

Germanenglish Home · News · Diary · Screenshots · Documentation (Wiki) · Downloads · Guestbook · Forum

Home · Benutzer registrieren · Suchen · Statistik · FAQ · Benutzerliste

Zur Zeit online: keiner ausser dir

 X-Force - Fight For Destiny - Forum —› Arbeitsmarkt / Jobmarket —› Skripter: Waffenwechsel Aliens innerhalb von TGround (english added)

Autor Mitteilung
verfasst am: 14.06.2009, 13:19 · Edited by: DirkF
Admin, Spielsatz GalWar

Registrierdatum: 31.08.2005, 21:51

 Beiträge: 5595
Hier ist eine Aufgabe für einen Skripter. Vorgesehen ist die Lösung innerhalb des Spielsatzes "Galaktischer Krieg", aber es sollte als Vorlage für andere Spielsatzersteller gut kommentiert sein.


Funktion:
Aus einem erhaltenen TGround auf dem Geoscape alle Aliens auslesen, ihre Ausrüstung bei Bedarf wechseln und dann wieder in den Bodeneinsatz zurückschreiben.

Zweck:
In der (wahrscheinlich längeren) Übergangszeit bis zur Umsetzung der Klassifizierungen für Ausrüstung muss man in der Lage sein, die Bewaffnung der Aliens anzupassen oder nachträglich zu verändern.
Dies kann genutzt werden für automatische Bodeneinsätze, für nachträgliche Korrektur bestehender Bodeneinsätze oder zur Anpassung der Schwierigkeitsgrade durch wechselnde Ausrüstung an den Aliens etc.

Umsetzung:
Es sollte am Ende ein dreiteiliges Skript sein. Der erste Teil ist ein GroundAI-Skript, das den Bodeneinsatz erhält und die Aliens durchgeht.
Für jedes Alien soll eine Wahlfunktion in einer untergeordneten Unit aufgerufen werden. Diese Unit überprüft anhand der Alien-ID um welches Alien es sich handelt (die Liste der Alien-IDs aus dem galaktischen Krieg wird von mir geliefert) und entscheidet dann, eine Ausrüstungsfunktion einer oder mehrerer weiteren Units aufzurufen.

Zweck der Unit-Aufteilung ist es, die IDs bei verschiedenen Spielsätzen leichter austauschen zu können.


Interessenten können hier posten oder sich per email melden.
verfasst am: 17.06.2009, 22:25
Admin, Spielsatz GalWar

Registrierdatum: 31.08.2005, 21:51

 Beiträge: 5595
This is a translation of the scripting task above, so that english speaking scripters can also try their skills on this.

This script should use the IDs of the gameset "Galactic War", but be written in a way that other gameset creators can easily replace those IDs with their own.


function:
The script should be written to receive a TGround as a missionObject (see Range-Effect-Scripts for details), retrieve the aliens stored in that TGround and writem them back after changing their base equipment.

planned uses:
it will be some time until the classifications will allow the automatic selection of weapons by random aliens. Until this is possible this script should allow a gameset creator to set each alien to a limited number of items where his equipment will be choosen from.
This is to be used for replacing alien equipment on automatic TGrounds, on older TGrounds which weren't solved by the set time, or to give Aliens different equipment based on difficulty settings.


The skript should be divided in three parts:
- one GroundAI-Script that handles the TGround and its aliens. This script should call a function from the next unit with each alien once.
- one unit with a function that compares the received alienmodel with an ID-List and selects an item function based on that ID. The alien should then be transferred to that item function (which should be in another unit) to get the fitting equipment assigned.
- one or more units with the item functions, where each functions has a set group of weapons, armors and ammunition and randomly selects one of those IDs to be set in the alien.

There are already several functions which set the weapons for aliens in the galactic war, but they need to be rewritten before they could be combined in one script.
If someone is interested in this work I'll give him details where those functions are and what I need to be scripted for the galactic war.
verfasst am: 19.06.2009, 09:34 · Edited by: gnfalex
Programming

Registrierdatum: 01.07.2008, 07:53

 Beiträge: 109
Greetings.
Finished script :
http://rapidshare.de/files/47586676/change_eqp.zip.html

Issue/Questions:
1. Mission startup is main.xms, all other is unit. Its based on 'case .. of ' structure.
2. What is MunID? It place for munition(ammo) or for additional items (grenades,mines,scaners, ets)? (Used as place for ammo)
3. With what function it have to cooperate?
4. For adapting for another mod need to rewrite sec.xms, tret_funct.xms and tret.const. Its better to hold IDs in separatle constants (as it here, weapon_RaceName1=ID1;weapon_RaceName2=ID2; more to edit, but easy to see structure) or in string massive (weapon_RaceName='ID1,ID2,ID3', then parse to extract; easely to change but harder to find error)?
5. structure is some different:
- one (main.xms) GroundAI-Script that handles the TGround and its aliens. This script should call a function from the next unit with each alien once.
- one unit (prim.xms) with a function that compares the received alienmodel with an ID-List and give result (alien_race) to item function. After that alien with alien_race transferred to item function in another unit.
- one unit (sec.xms) with the three item functions (one per equipment type), that aquire alien and alien race and request list of equipment, exclusive to given race. After that change equipment of alienmodel.
- two unit (tret_funct.xms tret_const.xms) that hold lists of equipment ane give it for request.
6. In that structure is no global variables for compatibility to existing scripts. (any function does not require external variables and can be placed on any place).

Sorry, if I post in wrong place. It's better to post here, on any other place, or e-mail?

Best regards

Edited: Ok. Thanks. I find a my error/ununderstoods: if munition is ammo, then it and weapon must be hardly linked. But in script weapon and ammo is choosen seperately and randomly :-(.
verfasst am: 19.06.2009, 12:46
Admin, Spielsatz GalWar

Registrierdatum: 31.08.2005, 21:51

 Beiträge: 5595
Zitat: gnfalex
2. What is MunID? It place for munition(ammo)

Yes
Other Items can't be added by ID yet (and most probably won't be since other methods are planned for the future)
Zitat: gnfalex
With what function it have to cooperate?

none, it should become the basic of different GroundAI scripts to be automatically called when creating a TGround.

no string massive, the script needs to be modified for each gameset by different gameset creators.

I'll check the script in detail later
verfasst am: 19.06.2009, 20:55
Admin, Spielsatz GalWar

Registrierdatum: 31.08.2005, 21:51

 Beiträge: 5595
One mistake, otherwise the script should work (haven't testet it):

random(count) results in a random number between 0 and count-1.

random(count-1) results in a random number between 0 and count-2...

I'll have to modify it a bit because the existing weapon assignment in the galwar already has a changing selection array based on an internal techlevel, but that is only replacing your lowest coding structure.
verfasst am: 26.06.2009, 08:33
Programming

Registrierdatum: 01.07.2008, 07:53

 Beiträge: 109
Greetings.
Is now exist anything more, in what I can help?
verfasst am: 26.06.2009, 08:55
Admin, Spielsatz GalWar

Registrierdatum: 31.08.2005, 21:51

 Beiträge: 5595
yes and no - there are things that need to be done, but this month I have too much to do at work to even adapt the options that are ready for the galactic war.

I hope to resume working on the gameset next month
verfasst am: 13.07.2009, 21:54
Admin, Spielsatz GalWar

Registrierdatum: 31.08.2005, 21:51

 Beiträge: 5595
I'll rewrite some part of your skript, moving the weapon identification from the ID list to a check of the usertag of each weapon - that will only work in the galactic war, but make things much easier for me.
This script remains here to help other gameset creators with their selection scripts.
verfasst am: 14.07.2009, 16:26 · Edited by: gnfalex
Programming

Registrierdatum: 01.07.2008, 07:53

 Beiträge: 109
Ok. Sorry, but how You did choice item by techlevel? Better what i think out is
repeat item:=get_random_item(race); until (get_item_level_by_usertag(item.usertag)=techlevel) //get_item_level and get_random_item are external function.
. Thanks.
verfasst am: 14.07.2009, 17:09
Admin, Spielsatz GalWar

Registrierdatum: 31.08.2005, 21:51

 Beiträge: 5595
I make a filter function before adding the weapon to the random selection list, but that is only possible because I decided to switch the selection away from the IDs (sorry, hadn't thought of that possibility when I posted the request above).



Du musst dich registrieren um auf dieses Thema zu antworten.
Login :: » Name » Passwort

Ladezeit (sec.): 0.020 · Powered by miniBB 1.6 with parts of 1.7 © 2001-2003