I wanna mod this game!

More
19 years 7 months ago #12745 by MeLeK
Replied by MeLeK on topic I wanna mod this game!
Can somebody to help me? Plzzz :)
I trying to create a field of asteroids, but a field with limited radius. And i cannot, ouh.....
....

Please Log in or Create an account to join the conversation.

More
19 years 7 months ago #12746 by GrandpaTrout
Replied by GrandpaTrout on topic I wanna mod this game!
We need more information. What have you done so far?
Have you used the POG sdk before?
Have you compiled one of the sample programs and tried running it?
Have you written a new program to create an asteroid field?
Can you show us the code?

Please Log in or Create an account to join the conversation.

More
19 years 7 months ago #12748 by MeLeK
Replied by MeLeK on topic I wanna mod this game!

What have you done so far?

i am a lamer:)...

Have you used the POG sdk before?

a small

Have you compiled one of the sample programs and tried running it?

yes, it work!:)

ufff, i am only tryed to some modifed a code of challenge_corse in this:
www.elite-games.ru/downloads/i-w ... edrive.zip
Now want to create a concentrative field of asteroids with limited radius.

Please Log in or Create an account to join the conversation.

More
19 years 7 months ago #12749 by GrandpaTrout
Replied by GrandpaTrout on topic I wanna mod this game!
MeLek, do you have any training in programming? I just want to know, so I can seperate language issues from knowledge.

Ok. There are two choices. You can use the asteroid fields that ParticleSystems created for EoC. To make one of those make a new version of EoC/resource/fields/asteroid.ini and change the size of the field to the size that you would like.

Or you can create an asteroid field by placing each asteroid objects yourself. Sim.Create("ini:/sims/inert/asteroid1","Asteroid"); Then use Sim.PlaceRelativeTo to put the asteroid around the location that you would like.

To learn how to create and place objects, look at the race course example and see how they place the race courser rings.

If you wish to place the asteroids in a more random fashion, the use the Math.RandomInt function to create the X, Y, Z values. If you use the largest size as the maximum, you will get a field that is denser in the middle, and fades out to the edges.


Please Log in or Create an account to join the conversation.

More
19 years 7 months ago #12752 by MeLeK
Replied by MeLeK on topic I wanna mod this game!
Oh, GrandpaTrout - it more simply, that i can think. I create a asteroids :))) (through script). A real big thanks to you!
Annotation 1404.05 MeLeK: Meet a GrandpaTrout, a real friendly man.

Please Log in or Create an account to join the conversation.

More
19 years 7 months ago #12753 by GrandpaTrout
Replied by GrandpaTrout on topic I wanna mod this game!
This piece of code reads some values from an INI file and creates an field out of those items. It might give you some idea how to begin. This code is used in Epic to create asteroid field, or ship wreck fields. It can make fields of anything.

This function is not really complete by itself. It is part of some larger code, so it will not run without changes. You must provide a proper INI file name for the function.

Good luck!
Code:
/* ; This is an example INI file of the kind read by ; the field making function. Just copy this to a ; INI file. &#91;PogClass&#93; name=tPcAsteroidBelt &#91;Properties&#93; length= width= height= ; controls how tightly packed the asteroids are. Use a one ; for scattered fields (default) or higher numbers for ; tightly packed fields. Above 3 is not likely to make ; much difference. density=1 List of field items, and the total number of each item type item&#91;0&#93;="ini:/sims/inert/asteroid1" number&#91;0&#93;=10 */ // Read the ini file, setup the object. setup_asteroid_belt(hsim center) { hinifile control_file; hsim item; int count, total, i, item_count, pass, density; string item_template, template_file; float length, width, height; float length_pos, width_pos, height_pos, spin; debug Debug.PrintString("PcAsteroidBelt.setup_asteroid_belt\n"); template_file = Object.StringProperty(center, "gt_pog_object_template"); control_file = INIFile.Create(template_file); if (none == control_file) { debug Debug.PrintString("ERROR tPcAsteroidBelt.setup_asteroid_belt invalid template_file\n"); debug Debug.PrintString(template_file); debug Debug.PrintString("\n"); } // Read in the belt control properties length = INIFile.Float(control_file, "Properties", "length", 10km); width = INIFile.Float(control_file, "Properties", "width", 10km); height = INIFile.Float(control_file, "Properties", "height", 10km); density = INIFile.Int(control_file, "Properties", "density", 1); if (density < 1) { density = 1; }else if (density > 10) { density = 10; } // Create the center sim // Read and place all the items. count = 0; while (INIFile.NumberedExists(control_file,"Properties","item",count)){ item_template = INIFile.NumberedString(control_file,"Properties","item",count,"none"); item_count = INIFile.NumberedInt(control_file,"Properties","number",count,0); if ("none" == item_template) { debug Debug.PrintString("ERROR tPcAsteroidBelt.setup_asteroid_belt invalid item_template\n"); debug Debug.PrintString(template_file); debug Debug.PrintString("\n"); }else { for (i=0;i<item_count;++i) { item = Sim.Create(item_template,String.FormatInt("tPcAsteroidBelt%d",i)); if (none == item) { debug Debug.PrintString("ERROR tPcAsteroidBelt.setup_asteroid_belt invalid item\n"); } length_pos = 0.0; width_pos = 0.0; height_pos = 0.0; // The more passes are made, the more tightly bunched the center // position becomes. for (pass=0;pass<density;++pass) { length_pos += Math.Random(0.0, length); width_pos += Math.Random(0.0, width); height_pos += Math.Random(0.0, height); } length_pos = length_pos/density; width_pos = width_pos/density; height_pos = height_pos/density; length_pos -= (length/2.0); width_pos -= (width/2.0); height_pos -= (height/2.0); spin = Math.Random(0.0, 5.0); Sim.PlaceRelativeTo(item, center, width_pos, height_pos, length_pos); Sim.SetAngularVelocityEuler( item, spin, spin, spin ); } } ++count; } INIFile.Destroy(control_file);

Please Log in or Create an account to join the conversation.