HentHighSchool Development Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

collapse
* Recent Posts
Re: Girl packs by Leortha
[Today at 02:49:48 am]


Re: [WIP][0.2]Girl Creation Tips by Aren117
[Today at 01:43:42 am]


Re: Tagging Tool 2.8 + TagSet Extended by _neronero
[Yesterday at 10:58:51 pm]


Re: Tagging Tool 2.8 + TagSet Extended by nemojason
[Yesterday at 10:48:25 pm]


Re: [WIP][0.2]Girl Creation Tips by Jman
[Yesterday at 10:32:39 pm]


Poll

Which Artistry building idea do you like the the best?  

Art Class: Painting, sculpting, drawing etc
- 41 (14.8%)
Music Class: Rock bands, orchestra, piano lessons, marching band, singing
- 34 (12.3%)
Theater/Drama: Plays, stage shows, performances (tough to find images for)
- 16 (5.8%)
Photography: Cameras, spying, peeping
- 186 (67.1%)

Total Members Voted: 275


Pages: 1 ... 7 8 [9]   Go Down

Author Topic: Terrordoll's Mod  (Read 79243 times)

Tsapas

  • Prehistoric Revisioner
  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 465
    • View Profile
Re: Terrordoll's Mod
« Reply #120 on: February 14, 2014, 09:01:10 pm »

It's as Xela says, it's seriously outdated (latest release was almost 6 years ago) but it still does the out-of-the-box job quite fine (though it is kinda messy to try and expand/alter it).

Don't try to replicate it, rather check the philosophy behind it (especially the event_dispatcher) and build your own upon that.
Logged

Terrordoll

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 72
    • View Profile
Re: Terrordoll's Mod
« Reply #121 on: February 14, 2014, 09:41:39 pm »

If you guys have any recommendations or advice about structure I'd love to hear it. I don't any idea yet I particularly like.
Logged

Xela

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 93
    • View Profile
    • Patreon
Re: Terrordoll's Mod
« Reply #122 on: February 14, 2014, 10:38:34 pm »

If you guys have any recommendations or advice about structure I'd love to hear it. I don't any idea yet I particularly like.

My approach would be:

EventManager class:

Responsible for maintaining array of events, sorting, choosing and deleting events that have exhausted themselves.

Event class:

Carries all the event info.

Function that makes registering new events as easy as can be (basically passes arg/kwargs to the class, instantiates it and adds to the manager).

You can easily expand a system like that and tie it up to your game.
Logged
Like what we're doing?

Terrordoll

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 72
    • View Profile
Re: Terrordoll's Mod
« Reply #123 on: February 17, 2014, 05:02:29 am »

Sunday night update!

(So the TL:DR version is I didn't finish. I ran into a bigger problem I didn't for-see. It might be a bit before I get something workable.)

  So I decided to take the approach Xela suggested. I admit to being a bit confused though because it really doesn't appear to be much different than how Ren'Py does it, at least as far as I can tell. This is how it works:

1. Building class instantiates a list of events. Events just hold the info needed for choosing, i.e. priority, and if you meet the reqs, etc.
2. The EventManager class runs through the list of events and whittles it down to a single one. It then fires off the correct method back inside the building class. That method holds all the specific info like the image to display.

  This part all works more or less. The issue I wasn't prepared for was how complicated the actual event logic was going to be. Simply having a text box display a line of text, that displays a new line once you click that box is hard when you want this system to function with any event. I'm not sure how I'm going to solve this. Hopefully someone here or at my work will have a better idea.

  So obviously I didn't get as far as I wanted this weekend. Currently you can buy buildings, select them in planning and it will choose an event for you and display that image. It won't display any text though and it won't display the "afternoon" location you selected. It's not really ready for a release. I'm busy with a small vacation and moving into a new place at the end of the month so I have no idea when I can get the next build out but hopefully it's some time soon.

  If anyone has any clever ideas or can help with the code let me know, I'll take whatever help I can get!


« Last Edit: February 17, 2014, 05:16:59 am by Terrordoll »
Logged

Xela

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 93
    • View Profile
    • Patreon
Re: Terrordoll's Mod
« Reply #124 on: February 17, 2014, 12:56:56 pm »

So I decided to take the approach Xela suggested. I admit to being a bit confused though because it really doesn't appear to be much different than how Ren'Py does it, at least as far as I can tell. This is how it works:

Events are events, you get to some place where events are triggered, they execute on conditions and their status is updated (so there is only so many approaches you can take).

I admit that (discarding DSE for use in my game almost instantly) I don't remember it's code really well but it seemed to have a bunch of  nested classes defined within an event class most of which should have been methods or functions (I am still rather confused why they did it other than to show off because it doesn't seem to be resolving any scope/namespace issues), it did NOT have a EventDispatcher class and instead ran events through a label.

I might be off here btw... it's been a while.

1. Building class instantiates a list of events. Events just hold the info needed for choosing, i.e. priority, and if you meet the reqs, etc.
2. The EventManager class runs through the list of events and whittles it down to a single one. It then fires off the correct method back inside the building class. That method holds all the specific info like the image to display.

Why does Building class do 1.? Isn't that by definition spaghetti code? EventManager can handle that task, you can easily pass a building as an argument to it for building specific events.

  This part all works more or less. The issue I wasn't prepared for was how complicated the actual event logic was going to be. Simply having a text box display a line of text, that displays a new line once you click that box is hard when you want this system to function with any event. I'm not sure how I'm going to solve this. Hopefully someone here or at my work will have a better idea.

Don't understand the problem here. If events are constructed with logical lines, can't you just display them one by one in your window using while or for loop until you run out of lines.
Logged
Like what we're doing?

Terrordoll

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 72
    • View Profile
Re: Terrordoll's Mod
« Reply #125 on: February 17, 2014, 07:24:46 pm »

So keep in mind I'm a very novice programmer. I'm taking classes now and using this project as a way learn. Something that mind seem simple to you, I've never come across.

Why does Building class do 1.? Isn't that by definition spaghetti code? EventManager can handle that task, you can easily pass a building as an argument to it for building specific events.

It might very well be spaghetti code but it was the best way I could figure to do it. Here are my assumptions/issues:
1. The building class (or Location in AA) makes the most sense for the events to be defined. Most of what makes up a building/location are the events.
2. Adding events as method calls (or Event class constructor calls in my case) seems like the best way to go. It's clean and should be easy for people to work with. It's also how AA works as far as I can tell.
3. Assuming 1 and 2 are correct why not just pass a list of events over to Event manager instead of Event Manager going to Building and building the list there. Just seems like an extra step.

If I'm making mistakes or not using best practices please let me know, I'll take what help I can get.

Don't understand the problem here. If events are constructed with logical lines, can't you just display them one by one in your window using while or for loop until you run out of lines.

There are probably a bunch of different ways I could do this, I'm just not sure how to actually implement it. I tried to avoid a while loop, I wanted to try and do something clever with registering and unregistering  events handlers but I just couldn't  get it to come together. I also wanted to create a text/input manager to handle this but I couldn't figure out a nice way to pass all the lines of text to it. I don't know how to make a method with a dynamic list of arguments.

Would you be willing to look over what I have so far and offer feedback?
Logged

Xela

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 93
    • View Profile
    • Patreon
Re: Terrordoll's Mod
« Reply #126 on: February 17, 2014, 08:29:51 pm »

It might very well be spaghetti code but it was the best way I could figure to do it. Here are my assumptions/issues:
1. The building class (or Location in AA) makes the most sense for the events to be defined. Most of what makes up a building/location are the events.
2. Adding events as method calls (or Event class constructor calls in my case) seems like the best way to go. It's clean and should be easy for people to work with. It's also how AA works as far as I can tell.
3. Assuming 1 and 2 are correct why not just pass a list of events over to Event manager instead of Event Manager going to Building and building the list there. Just seems like an extra step.

If I'm making mistakes or not using best practices please let me know, I'll take what help I can get.

1) I thought that you are expanding and building = School, not a building within School. There are locations in AA that can hardly be called "Buildings", naming things correctly in your program is important.

2) Might be, AA uses Ren'Py labels for body of events and DSE manager for triggers/control.

3) The approach is sound, if you're basically using buildings as holders for the events, have a function to do the sorting/returning the event. It doesn't need to be a class. Also it's not a spaghetti code in this case.

I assumed that there might have been events acceptable for multiple buildings.


There are probably a bunch of different ways I could do this, I'm just not sure how to actually implement it. I tried to avoid a while loop, I wanted to try and do something clever with registering and unregistering  events handlers but I just couldn't  get it to come together. I also wanted to create a text/input manager to handle this but I couldn't figure out a nice way to pass all the lines of text to it. I don't know how to make a method with a dynamic list of arguments.

Would you be willing to look over what I have so far and offer feedback?

Wouldn't do much good, it's been over an year since I've last looked into C# and even that was superficial.
Logged
Like what we're doing?

jer360x

  • Newbie
  • *
  • Offline Offline
  • Posts: 10
    • View Profile
Re: Terrordoll's Mod
« Reply #127 on: July 12, 2019, 08:10:53 pm »

the link is to mod is dead please reup
Logged
Pages: 1 ... 7 8 [9]   Go Up
 


anything
SimplePortal 2.3.3 © 2008-2010, SimplePortal