Not logged inOpenClonk Forum
Up Topic Community / Player Creations / scenario editor; hammer; structures; Epic meele
- - By Kvothe1990 [de] Date 2012-11-24 17:47
Hi everyone, :)

After realizing that I wouldn´t need to work for university(not very much) in the next one to two month, I started messing around with Eclipse.
Because my skills in C++ and its scripts in any form tend to be around very basic, my first choice was to design a scenario(oh that beautiful Editor - well done!) which turned out to be pretty big and complex.

However, i would like to ask two things:

1. Does the hammer work if I just give a player the knowledge about the buildings I want to be used in my scenario? If not: what do I need to change in its script to make it work?

2. Its pretty much the same thing: How can I declare what can be built in a specific building?

I may come up with a load of further questions, feel free to tell me if they are answered elsewhere or can be looked after in the documentation.

Best regards

Florian
Reply
Parent - By Zapper [de] Date 2012-11-24 18:19

>1. Does the hammer work if I just give a player the knowledge about the buildings I want to be used in my scenario? If not: what do I need to change in its script to make it work?


Yes, the hammer should show every building that a player has knowledge of

>2. Its pretty much the same thing: How can I declare what can be built in a specific building?


That is defined in the items (to keep it more modular - if you want to create a new item, you should not have to change the building!)
For example in the bow script, you will find:
bow: public func IsArmoryProduct() { return true; }
hammer: public func IsToolProduct() { return true; }
dynamite: public func IsChemicalProduct() { return true; }
etc..
Additionally the player needs knowledge about the object, of course.

If you want to change the production building of an item, you could for example create a script-file in your System.ocg-folder, containing:

#appendto Bow
public func IsArmoryProduct() { return false; } // overwrite old entry
public func IsToolProduct() { return true; } // make workshop-product
Parent - By Maikel Date 2012-11-24 18:20
No problem, you can ask here, maybe keep everything in the same thread, to not create a lot of them, to your questions:

Both can be specified in the Scenario.txt file in your scenario folder.
There you can set the knowledge per player, there are also script functions to set these.

If you want something extraordinary like being able to produce an airship at the tools workshop you need to modify the script of the air ship.
There are several ways to do this, but if you don't want this, it's useless to know how for now ;) (edit: Zapper already showed the most common way :))
- - By Kvothe1990 [de] Date 2012-11-25 12:24
First of all: Thank you, I have come far thanks to your advice.

If I am trying to define a team, eclipse keeps telling me "Team" is an unknown section, so there must be more to it than just changing the teams.txt - right?

And it was a "little" frustrating to learn that the change from a static landscape to an ecaxt one does not work by just changing it in the editor and saving it that way(4 hours of tendering the map with sooooo much care ;D). How do you change from static to exact?

<- Thanks very much in advance!

best regards

Florian
Reply
Parent - - By Maikel Date 2012-11-25 12:49
Oh, that must have been frustrating. Exact mode is broken, at least in the sense that you cannot save it. Also it consumes way to much space for large maps, so you should stick to static mode which is 8pixel precise.

This should be precise enough for landscape design, if you need something more detailed, you should probably use an engine function to clear some material for e.g. an elevator.
Parent - - By Newton [de] Date 2012-11-25 14:30
One can define the preciseness of the static landscape in the Scenario.txt (MapZoom).
Parent - - By Kvothe1990 [de] Date 2012-11-25 20:20
Which leads to an exact landscap ultimatively(except for one tool). Doesn´t it?
Reply
Parent - By Caesar [de] Date 2012-11-25 20:23
Yep, but it's going to have a smaller representation.
- - By Kvothe1990 [de] Date 2012-11-26 22:15 Edited 2012-11-26 23:39
Heres the scenario I was talking about: http://www.gigasize.com/get/1cspysrh0df

Its a work in Progress in all aspects, please dont consider it as a finished "product".

I would be very thankful if someone or anyone could have a look at the scripts,  the scenario itself and its concept.(The "teams" stuff does not work atm for example)
Furthermore I need an Item that can be produced in the Loom and can be used like the loam for loambridges, but i needs to be solid(cant be killed by the shovel/should behave like granite).

I hereby announce that the three People who can provide the most help/input/have brilliant ideas will receive a packet with two kinds of selfmade(!) and ultra tasty cookies.
Shipping in germany only, doing it internationally would be expensive - sorry folks... I could send a postcard ;).

best regards

Florian
Attachment: Fortress2.ocs (44k)
Reply
Parent - By Newton [de] Date 2012-11-26 22:41
I don't find the download link on that bad file hoster website... :-(

You can attach files here via the "Attach" button.
Parent - - By Sven2 [de] Date 2012-11-26 22:58
It's tricky, but I managed to download it (attached to this posting)
Attachment: Fortress2.ocs - Fortress2 by Kvoth1990 (44k)
Parent - By Kvothe1990 [de] Date 2012-11-26 23:38
Thank you, I didnt realize there was an attach button.
Reply
Parent - - By Sven2 [de] Date 2012-11-27 00:07
Hm, I just spawned without items in a nicely drawn, but mostly empty landscape. Is it supposed to be like that?
Parent - - By Kvothe1990 [de] Date 2012-11-27 01:01
Well... there are three items at the supposed-to-be players spawning points, I didnt give players the Items because I wanted to encourage sharing tasks.
There is no fixed spawning point currently, which is because I dont know how to set them. :(
The landscape is mostly empty because its supposed to be a base-meele.

good night :)
Reply
Parent - - By Ringwaul [ca] Date 2012-11-27 02:33 Edited 2012-11-27 02:39
Put this in your scenario script to set a spawn-point:

protected func InitializePlayer(int player)
{
  var clonk = GetCrew(player,0);
  clonk->SetPosition(x,y); //coordinates of player spawn point
}


You could even do some fancy stuff for different teams.
ie:
protected func InitializePlayer(int player)
{
  var clonk = GetCrew(player,0);
  if(GetPlayerTeam(player) == 1)
    //team 1's spawnpoint
    clonk->SetPosition(x1,y1);
  else
    //team 2's spawnpoint
    clonk->SetPosition(x2,y2);
  }
}


Change x,y to the X and Y landscape coordinates you want the player to spawn at. To get coordinates, you can:

• In game with DebugMode enabled, /script GetCursor()->GetX() then /script GetCursor()->GetY(). Prints the clonk's coordinates
• If you're using the editor, use the selection tool (white cursor) and hover over the landscape with your mouse. The position of the mouse cursor in the landscape is displayed in the engine window.
• look at your Landscape.bmp (if you use one) and pick a pixel, then multiply that pixel's coordinates by 8
Reply
Parent - - By Caesar [de] Date 2012-11-27 19:13
What you're doing there is easily possible with a Teams.txt, isn't it?
Parent - - By Ringwaul [ca] Date 2012-11-28 23:02
Probably. I generally just use the most basic functions of the special data files and do everything else in script. For example, my solution for giving knowledge.
Reply
Parent - By Zapper [de] Date 2012-11-28 23:11
..which probably needs an abstraction layer around it, too :)
- - By Kvothe1990 [de] Date 2012-11-27 15:28
Thank very much you for the scripts, which leads me to the question: If I every release the map in a foreign forum or elsewhere.
-> How do I credit the objects/scripts or everything else that has not been made by me(pretty much every part of everything is a stolen piece from another scenario[slightly modified])?
The latest progress is attached.

And one of the two clonks still spawns randomly and I cant figure out why since the script is refering to the players crew, not a specific clonk.
Did I overlook something?

greetings

Florian
Attachment: Fortress2.01.ocs (46k)
Reply
Parent - - By Maikel Date 2012-11-27 15:46 Edited 2012-11-27 16:33
http://pastebin.com/mK0rHeAb should move all the clonks, the problem with the script proposed above by Ringwaul is that it just moves the first clonk of every player, instead one should loop over all crew members if you have more of them.

You don't need to credit every single individual, since you scenario only runs with the openclonk engine, it will be useful only if people know of us, which also makes more or less sure we are credited. If you use data external to our game data, then you should make sure to credit them, if it is not public domain.

You could also write in the header of you script file: based on various scripts from the OpenClonk game content,  www.openclonk.org for a download. A lot of the game content is copy pasting in the end.
Parent - By Kvothe1990 [de] Date 2012-11-29 21:25
the script does not work for two clonks.
I corrected while and the clip(bracket;clamp)... hmpf... This Thing: -> (.
There are no problems left, but the Loop won´t work:

protected func InitializePlayer(int player)
{
    if(GetPlayerTeam(player) == 1)
  {
        var i = 0, clonk;
    while(clonk = GetCrew(player, ++i))
      clonk->SetPosition(148,1061);
  }
    if(GetPlayerTeam(player) == 2)
  {
        var i = 0, clonk;
    while(clonk = GetCrew(player, ++i))
      clonk->SetPosition(2377,1143);
  }
}
Reply
- - By Kvothe1990 [de] Date 2012-11-28 20:42
kt.
Attachment: Fortress2.02.ocs (47k)
Reply
Parent - - By Kvothe1990 [de] Date 2012-11-28 23:05
Posttesting(gameplay)
Attachment: Fortress2.13.ocs (48k)
Reply
Parent - - By Kvothe1990 [de] Date 2012-11-29 22:22
- More Shrooms
- 2 Clonks in a Team
Attachment: Fortress2.14.ocs (49k)
Reply
Parent - - By Kvothe1990 [de] Date 2012-11-30 19:43
- few lesser ressources(rocks, loam)
- Airship removed(for now)
- even more shrooms(as they are tasty and don´t give the clonk too much hp)
- More coal for team 2 and an easier way to get to the next coalmine
Attachment: AncientFortress0.67.ocs.ocs (53k)
Reply
Parent - - By Ringwaul [ca] Date 2012-12-01 04:25
It's probably a better idea to keep testing it before releasing each version. Releasing a work in progress can be helpful for feedback, but you don't want to overwhelm people.
Reply
Parent - - By Kvothe1990 [de] Date 2012-12-01 11:52
Hey :)
It is not a release, but a state of the work in progress which I upload so the people I am testing it with can download the updated version.
They need to download it from here(or elsewhere) because I can not host games, since I dont have access to my router.
I know that its a good solution, sorry for that :[.
Or if you have a way of emulating forwarded ports or hacking a router to forward them, feel free to share it :).

I´ll just edit the posts from now on, didn´t see the button before.
Reply
Parent - By Sven2 [de] Date 2012-12-01 14:15
Hm, upnp doesn't work for you?
Parent - - By Pyrit Date 2012-12-01 16:59
Jep, I think just editing the first post is a good solution.

No access to your router? You usually can access it by typing it's IP adress into your browser. But if that doesn't work I feel sorry for you.^^
Parent - By Kvothe1990 [de] Date 2012-12-01 17:53
Its because I live in a dorm for students. They provide internet here but I don´t have direct access to the central router.
I already requested to forward the necessary ports but the IT-guy is very lazy. >!very!<
Reply
- - By zorry [de] Date 2012-11-28 22:15
this thread should be in "Scenario & Object Development", shouldn't it?
Parent - - By Clonkonaut [de] Date 2012-11-28 22:33
No, because it says in the description: This forum is for the development of the original game content
Reply
Parent - - By Sven2 [de] Date 2012-11-29 03:20
Isn't this an original scenario? As opposed to e.g. a scenario that's being ported from CR to OC.
Parent - By Clonkonaut [de] Date 2012-11-29 07:21
No :C
Reply
Parent - By Kvothe1990 [de] Date 2012-11-29 12:14
The opposition resides between:
In an official release(or supposed to be in it) vs. a players creation that is separated from the gamecontents core.
This scenario will be the second one. I think the thread should be here. :)

greetings

Florian
Reply
- By Kvothe1990 [de] Date 2012-11-30 20:05
1.) Hey Maikel, I have decided against the Idea of starting with a small settlement.
- Deciding to build(even the basic stuff) at a specific position can be a tactical decision, I dont want to remove that.
- On top of it the scenario is meant to be player by teams of min. 2 Players, who can easily build the first basic buildings within 4-5 minutes
- Also you don´t have to bother writing the script anymore.

2.) Theres still the granitebridge item, I have changed the loams script to produce granite instead of earth, give it new components etc.
Then I renamed it and broke the whole thing somehow after trying to drag the item into my scenario without having any graphics...
How does that graphics-stuff work on a simple thing like cement(concrete)? Thank you in advance, whoever is going to answer :).

3.) The next changes will(may) be:
- More hitpoints for the chest so it can be used by players for protecting stuff(effectively) against invading clonks
- Removing the butterflies for now(movement bug)
- Make the spawningpoints slightly random to avoid bad looking staple situations at the beginning of the scenario
             I even have a possible idea ho I am going to do that.
- decreasing the flagradius slightly (400 was a little too big, players jsut need two flags to cover the whole base.)
- Thinking about a way to reimplement the airship(maybe players will be able to buy two firescrolls at the flag for a very cheap price[burn that thing])
                    This way its power would decrease rapidly and it won´t be a thread until a certain heat of battle where no one does have oversight of whats going on in the sky.

Do you have an opinion about topic three or one? Please tell me :).

best regards

Florian
Reply
Up Topic Community / Player Creations / scenario editor; hammer; structures; Epic meele

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill