Author Topic: Lops' Cb Training 101  (Read 3091 times)

Offline Zardox Xheonov

  • Sr. Member
  • ****
  • Posts: 274
Lops' Cb Training 101
« on: June 23, 2010, 09:44:05 PM »
*First things first; i need a huge favor from one of you expericanced programmers.. 2nd please skip anything thats not  in red if you dont have much time for chatter...

so uhhh i have this file below, i hope i did this right; my source code should be in there... this is far from completed... i just need to fix these errors, i know that moving sections of my code will help... but i don't know the specifics of where to place them... i think i placed my unitplacementcode in the wrong area...

i may not be experianced... but i think this this should be a peace of cake to fix for you programmers out there.

either rewrite it or list specific instructions*

 *(step by step please and dont assume i know the controls yet... im still going through sirbomber's tutorial..)*

*
my objective this week is to create a testgame with the following:
1 player (human)
gametype: colonygame
mapname: outcasters (created by yours truly)
disasters:none
Moral:forced 75 good steady
day/night shifting: enabled
numberbeacons: 2
beacon types: common 3 bars
starting area: south east corner (yellow human player 0)
able to run in colonygames: yes
able to run in multiplayer: no
fail conditions: none
victory conditions: none

*

Now for my overall objective (though this is planning ahead and am not focussing on this untill awile):
gametype: colonygame+ landrush enabled
mapname: outcasters
colonygamename: Renegades Starship
Disasters:all except volcanoe
Moral: 75 good steady (until command center is built)
numberofbeacons: ??? (notice thats undecided)
starting areas: south west(yellowhumanplayer), southwest (magneta eden ai), northeast and west: eden ai blue, and plymouth ai red.
Teams: yellow+magneta vs red vs blue (three teams)
have well built ai: yes
have two ai fighting eachother: yes
have third ai (magneta) on human player's side: yes
have to scan labs and ect for tech: yes
have to rescue scientist: yes
blight: no
have renegades music: no
will be available: on outpost2 (latest version)
recover wreckage: yes
obtain reinforcements: yes
both ai attack: on hard yes
victory condition: build starship
failure condition: magneta light tower destroyed
magneta light tower stats: 5000 hp heavy armor
magneta defenses: one thors guard post with 1000 hp and 200 attack
magneta other buildings: solar array (safe in distance with no way to get in litterally inpassable)
magneta get reinforcements: yes


*now please help me get the first part done...(marked in yellow)*
i will edit this message alot, note that items marked between an * might be deleted due to sudden changes/updates
« Last Edit: June 28, 2010, 10:10:50 AM by Lord Of Pain »
Hit me up on discord, if I am online, you know I'll be gaming.

(Lord Of Pain is no more, I am currently now "Zardox" and have been for awhile on other platforms.)

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3218
Lops' Cb Training 101
« Reply #1 on: June 23, 2010, 10:38:26 PM »
Look at my tutorials.  http://forum.outpostuniverse.net/index.php?showtopic=4796
Work on some small examples before diving head-first into such a large project with multiple AIs.

And am I the only one who has a problem with him pretending this is some kind of Renegades continuation?
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Flashy

  • Sr. Member
  • ****
  • Posts: 391
Lops' Cb Training 101
« Reply #2 on: June 24, 2010, 07:04:19 AM »
Post 1)
You have to write "outcaster.map" to load the map file. I've fixed some mistakes but i don't have an idea what you were trying to do with the randomisebases code. I've uploaded the code and the dll here. I've modified it a bit for my environment.
Post 2)
Some errors i found:
-You have to write Unit x; and Unit Unit1; if you want to use these variables
-It's mapEarthworker, not mapEarthWorker.
-Player[0].SetColorNumber(3 - 5); doesn't work, but if you want you can write Player[0].SetColorNumber(TethysGame::GetRand(2)+3);
-You have to use the _player class for the AI
-It's a colony game, you don't need daylight/morale checks
-SD.EvacModule is in a non existing struct/class/whatever

And btw, if you want these trucks to have cargo and light, you should write x.SetTruckCargo....
« Last Edit: June 24, 2010, 07:08:25 AM by Flashy »
Praise the mighty light towers!!!

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Lops' Cb Training 101
« Reply #3 on: June 24, 2010, 07:39:17 AM »
Quote
-You have to write Unit x; and Unit Unit1; if you want to use these variables
What exactly do you mean by that?

Because one way I understand it is that you're saying you can't write "Unit x, Unit1, <etc.>;", which we all know is not true. Yay for negation negating
"Nothing from nowhere, I'm no one at all"

Offline Flashy

  • Sr. Member
  • ****
  • Posts: 391
Lops' Cb Training 101
« Reply #4 on: June 24, 2010, 07:46:07 AM »
Of cause you can also write Unit x, Unit1; but LoP wrote neither Unit ...; Unit ...; nor Unit ..., ...;
Praise the mighty light towers!!!

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Lops' Cb Training 101
« Reply #5 on: June 24, 2010, 07:58:50 AM »
Oh, then say that he has to declare the variables before use. Because you have to declare any and all variables before you can use them. And unit handles are variables.
"Nothing from nowhere, I'm no one at all"

Offline Zardox Xheonov

  • Sr. Member
  • ****
  • Posts: 274
Lops' Cb Training 101
« Reply #6 on: June 24, 2010, 10:22:36 AM »
UPDATE!!! im i need to figure out how to get my file to compile without errors, or at least if thats how you create it into a DLL file...

my file will be updated above shortly...

please re-download the file when the givewn yes is in place below:

file updated: yes


heres my error its all in one line:

Main.cpp      5      fatal error C1083: Cannot open include file: '../Outpost2DLL/Outpost2DLL.h': No such file or directory

The above error has been fixed.
« Last Edit: June 24, 2010, 11:38:29 AM by Lord Of Pain »
Hit me up on discord, if I am online, you know I'll be gaming.

(Lord Of Pain is no more, I am currently now "Zardox" and have been for awhile on other platforms.)

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Lops' Cb Training 101
« Reply #7 on: June 24, 2010, 10:58:06 AM »
LoP, step one of Outpost 2 programming is knowing the basics of programming, specifically C++ programming.

If you knew about the basics then you knew (among other things) that your source is stored in a .cpp file (probably main.cpp) What you uploaded is not a source.

I have a slight suspicion that you either skipped the part where you downloaded the SDK (required for OP2 coding), or you didn't set the compiler up properly.
"Nothing from nowhere, I'm no one at all"

Offline Zardox Xheonov

  • Sr. Member
  • ****
  • Posts: 274
Lops' Cb Training 101
« Reply #8 on: June 24, 2010, 11:36:53 AM »
oops my bad.. lol common mistake :P

hold on going to update now...


i think this file below is what your talking about?

EDIT: yes sirbomber.. when this is done it will be a renegades colony game for op2... though please note that this is only a 'tribute' to the renegades project and almost has nothing to do with renegades besides the 3 factions and yellow color for player 1...

(please note that by 'tribute' i mean admiration to th renegades team) more of a compliment to the renegades dream.

though i sadly believe i wasted my breather explaining this to you, i doubt you'd understand it.. much more appreciate a well thought idea that is being put into action.
« Last Edit: June 25, 2010, 02:50:12 PM by Lord Of Pain »
Hit me up on discord, if I am online, you know I'll be gaming.

(Lord Of Pain is no more, I am currently now "Zardox" and have been for awhile on other platforms.)

Offline Flashy

  • Sr. Member
  • ****
  • Posts: 391
Lops' Cb Training 101
« Reply #9 on: June 24, 2010, 11:44:35 AM »
Note: 3 minus 5 is -2 and color number -2 doesn't exist. And you should create rare mines because you need rare for a starship.
Praise the mighty light towers!!!

Offline Zardox Xheonov

  • Sr. Member
  • ****
  • Posts: 274
Lops' Cb Training 101
« Reply #10 on: June 24, 2010, 11:46:05 AM »
i'd like it yellow please :) yellow for player 1

its updated again flashy.
« Last Edit: June 24, 2010, 11:56:29 AM by Lord Of Pain »
Hit me up on discord, if I am online, you know I'll be gaming.

(Lord Of Pain is no more, I am currently now "Zardox" and have been for awhile on other platforms.)

Offline Flashy

  • Sr. Member
  • ****
  • Posts: 391
Lops' Cb Training 101
« Reply #11 on: June 24, 2010, 02:03:56 PM »
The dll you wanted
« Last Edit: June 25, 2010, 07:23:23 AM by Flashy »
Praise the mighty light towers!!!

Offline Zardox Xheonov

  • Sr. Member
  • ****
  • Posts: 274
Lops' Cb Training 101
« Reply #12 on: June 25, 2010, 12:03:06 PM »
the following source codes i need in order to get an idea of what an ai code looks like.

entire ai proc from eden starship

entire ai pro from plymouth population


if anyone would be so kind as to post it here then that would be much appreciated :)
« Last Edit: June 25, 2010, 12:03:38 PM by Lord Of Pain »
Hit me up on discord, if I am online, you know I'll be gaming.

(Lord Of Pain is no more, I am currently now "Zardox" and have been for awhile on other platforms.)

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Lops' Cb Training 101
« Reply #13 on: June 25, 2010, 12:38:26 PM »
Or make the AI yourself. It's not exactly that hard, mostly tedious. It's not like you're trying to rewrite some of the functions that make AIs work, like some of us (me included, slowly and unsurely).
Hooman wrote a project on some AI from some map I forget (I think Eden Starship?), recreating what Dynamix would have done to make the AI. Look it up.
"Nothing from nowhere, I'm no one at all"

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4948
Lops' Cb Training 101
« Reply #14 on: June 27, 2010, 02:45:18 PM »
Quote
entire ai proc from eden starship

entire ai pro from plymouth population


Ohhh, ohhh, me, me, pick me. I'll get this.


Code: [Select]
Export void AIProc()
{
}

 ;)


Quote
Hooman wrote a project on some AI from some map I forget (I think Eden Starship?), recreating what Dynamix would have done to make the AI. Look it up.
I believe it was CPS2. I should point out the project was an incomplete remake, and I have no idea if what's been written will work without crashing. I think it at least starts up without crashing though.
 

Offline Zardox Xheonov

  • Sr. Member
  • ****
  • Posts: 274
Lops' Cb Training 101
« Reply #15 on: June 27, 2010, 06:04:55 PM »
ok there were some complaints that the colony was in too good of a position, so i move them... though this is not taking effect until flashy compiles this following file below...

the file has the latest code within the time of this posting (excluding editing times)
and has a started 2nd ai, it only has a lynx though... i will update this a little then post it below... (by updating i mean placeing more eden lynxs) and perhaps some structures... (but not a complete base! this is plymouths territory, and the idea is that eden is only an outpost and very small, the official plymouth colony is near this map, and renegades had no choice but to relocate to this location for scientific reasons...).
« Last Edit: June 27, 2010, 07:21:02 PM by Lord Of Pain »
Hit me up on discord, if I am online, you know I'll be gaming.

(Lord Of Pain is no more, I am currently now "Zardox" and have been for awhile on other platforms.)

Offline evecolonycamander

  • Hero Member
  • *****
  • Posts: 602
Lops' Cb Training 101
« Reply #16 on: June 27, 2010, 07:09:49 PM »
this is some of the unit placement code you asked for. just cut and past from the doc.
it is UNFINISHED i will add more later
edit: the map is also needed
=-UPLOAD REMOVED-=
« Last Edit: August 18, 2010, 05:05:15 AM by evecolonycamander »
''The blight cant get us up here!''
-famous last words
--------------o0o--------------
Outpost 2: EoM project status: Re-planning

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3218
Lops' Cb Training 101
« Reply #17 on: June 27, 2010, 07:49:48 PM »
Quote
Ohhh, ohhh, me, me, pick me. I'll get this.


Code: [Select]
Export void AIProc()
{
}

 ;)
Owned.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline evecolonycamander

  • Hero Member
  • *****
  • Posts: 602
Lops' Cb Training 101
« Reply #18 on: June 27, 2010, 08:34:14 PM »
here is the map
edit: fixed the map some more
=-UPLOAD REMOVED-=
« Last Edit: August 18, 2010, 05:05:45 AM by evecolonycamander »
''The blight cant get us up here!''
-famous last words
--------------o0o--------------
Outpost 2: EoM project status: Re-planning

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4948
Lops' Cb Training 101
« Reply #19 on: June 28, 2010, 03:17:21 AM »
Rather than constantly uploading slight revisions, maybe you should consider using the SVN?
 

Offline Zardox Xheonov

  • Sr. Member
  • ****
  • Posts: 274
Lops' Cb Training 101
« Reply #20 on: August 13, 2010, 12:49:16 PM »
this rar contains 3 files: an updated version of the outcasters.map, and updated main.cpp, and a .dat file for refference of the updated main.cpp so you can visually see the changes i made... (note to see change make sure you open thhe mapper and open outcaster.map with the .dat file in the same folder).

these files are mainly for flashy to look at. others may look too.
« Last Edit: August 13, 2010, 12:49:36 PM by Lord Of Pain »
Hit me up on discord, if I am online, you know I'll be gaming.

(Lord Of Pain is no more, I am currently now "Zardox" and have been for awhile on other platforms.)

Offline Zardox Xheonov

  • Sr. Member
  • ****
  • Posts: 274
Lops' Cb Training 101
« Reply #21 on: August 15, 2010, 07:52:25 AM »
tube locations for ecc (updated 0.1)
« Last Edit: August 15, 2010, 08:10:31 AM by Lord Of Pain »
Hit me up on discord, if I am online, you know I'll be gaming.

(Lord Of Pain is no more, I am currently now "Zardox" and have been for awhile on other platforms.)