Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Glenjamin

#21
Hi all,

Im working on a game with several characters. Each character has a set of variables that impact their behaviors.

To tackle this, I figured I'd use "Dynamic arrays" straight from the dynamic help section of the engine.

In a script, I define the variable array. In this case it's health.

Code: ags

//define health
int NPHealth[];
 

then in game_start, I include the following:
Code: ags
NPHealth = new int[Game.CharacterCount];


Then to test if it works I set up the following: One action which tells me what a NPHealth variable is, and one which tells me what the same NPHealth variable is after subtracting 20.

Code: ags
 cCharacter.Say("health is %d",NPHealth[5]);


Code: ags


NPHealth[5] -= 20;
cCharacter.Say("health is %d",NPHealth[5]);


I keep getting "Null pointer referenced" errors. I tried moving the location of where the array is defined but nothing has worked so far.

Thanks in advance.



#22
My game has a 24 hour cycle which I use to plot out character events. One the timer hits a certain time, characters do various actions.

In this case, I'm trying to make a character walk to work. In order to do this, he walks to one side of the screen, then changes rooms the next hour.

Unfortunately the game crashes if you're not in his room when the game tells him to walk.

Is there any way to have AGS move characters that are not in the current room?
#23
This is a little intimidating, but mostly because I'm a massive coward.

I'll give each method a shot, but I think Snarky's idea to make a function for each animation would be the cleanest.

Quote
Code: ags
 // calculate view based on current NormalView 
  int view = this.NormalView + 2;  // example formula

I didn't implement the views mathematically. My brain immediately jumps to an "If/else" script for every outfit. There shouldn't be more than 10 so I don't think it would be THAT bad. I still think I'm missing something.

I'm gonna fiddle with it.
#24
Thanks for the help so far.

QuoteSo what is the issue? Is it the logic to decide which view/loop you should play depending on the outfit and action? How do you have them set up in the view editor? CW's code will work, but if you have it set up consistently, there should be a way to calculate it directly without having to special-case it for every possible value using if-clauses.

Currently I have it set up so each skin has two or more views. The normal view, the speech view, and subsequent views for each generic animation. (Taking damage, picking up items,idle)

Each generic view has an animation for the four cardinal directions. (Otherwise i would've made one giant view with every animation pertaining to that skin)

My goal is to be able to declare:

The current skin is: "Skin". So instead of going through the view list every time I can just put "egrab" and the engine uses animations for that skin rather than a sea of "else if" for every single function


#25
Hey all.

In the game I'm working on, the character has multiple outfits they can equip at any time. However, there are more animations than just the normal view and speech view, such as a view for picking up items.

This would get very messy in the local and global scripts.

I currently have a variable for the outfits(Skins) called "pskin". It's an int, and the number indicates which outfit the player is wearing.

If my understanding of enums is correct(Which it probably isn't), I could make a set of enums, each representing an animation such as "egrab" and "esleep".

Combined with a custom function, I could end up with code like this:

Code: ags

function odoor_AnyClick(){

player.specialanimation(eopendoor, delay, repeat style, blocking, direction);
//Functionally identical to ".animate" only the enum means i don't have to set the views every time
}


I don't know if this would work, no less where to start on how to build it. Any help is greatly appreciated.
#26
Sorry for the late response.

QuoteCould it be that this.border_right is smaller than your arrow buttons?

You nailed it. I changed the border size and it worked like a charm. Next time I'll post this in the 9-verb thread if I can't find the problem first.
#27
Completely forgot I should've mentioned I've resealed the gui through the dialog gui script

New variables:

x pos- 0
y pos- 386

Size:

width- 384
height-47

Up arrow:

x pos- 303
y pos- 1

Down arrow:

x pos- 303
y pos- 43

Everything else is default.

Template version seems to be 1.5.2
#28
Hey all.

Im using the 9-verb template for a game with lengthy dialogues.

This particular dialog has 10 possible decisions. The up and down arrows are present; However, the down arrow will not scroll past option 4.

Also, when using the down arrow, It only remains scrolled as long as the mouse is over the button. It resets back to option 1 when the mouse is moved.

Thoughts?

Thanks in advance.
#29

The statue of the pierced wanderer

[imgzoom]https://i.imgur.com/ajjsZYL.png[/imgzoom]

I tried to come up with a story for this, but I'm not that great at traditional writing.

The idea was: the wanderer displeased the gods by being immortal, so a spear was thrown from the heavens, impaling him.

He survived the attack, but the hole in his chest left him incapable of pursuing his own goals in life.

He now wanders the earth, bearing the heavenly spear and doing the bidding of any group of people who give him purpose.

Or something along those lines.
#30

BIG TOOTH GUY

[imgzoom]https://i.imgur.com/jGvabuU.gif[/imgzoom]

As a big tooth boy, aliens came down and granted him the ability to put his feet over his head.
After years of training with shaolin monks he finally learned to walk like that, thus growing from a big tooth boy to a big tooth man.


He now wanders the earth bearing the heavy burden of being the next step in human evolution and joined Billy's gang to further his dream of eradicating mankind.
#31
Not really sure where to draw the line between begginer and advanced technical questions, so here we go.

I want to make an in-game GUI that allows me to modify variables while playing. Similar to the built in debug commands. This is for testing particularly large games.

Of course building the gui is simple enough, it's the code I don't know how to tackle.

Ideally, this gui could manipulate the following:


  • Global variables
  • Character rooms/coordinates
  • Run scripts(Maybe)
  • Add specific items to the inventory
  • Refresh the current room so characters/objects can react according to the current script


Of course there's the long way of doing this, like making a button for every inventory item, but can't help but think there's a smarter way to handle it.

If I can make it work, I'd be happy to publish it as a module so everyone can test their more complex games faster.



#32
I'm currently designing a game with many variables that change events in-game. I want to get the framework right at the start, let me know what you think.

Variable sets:


  • 12 hour day/night cycle based on in-game ticks.
  • Several NPC's throughout the map, each with a "behavior set" unique to each in-game hour.
  • These behavior sets are also modified by player-based variables. Is the player liked, has the player killed someone, what is the player wearing? (All controlled by int variables)

Day/night cycle seem pretty simple enough. After a certain amount of ticks, Hour += 1;. Once the hour reaches 12, hour = 0;.

I'm thinking of having a script that runs in every room, which checks the hour. The hour then determines the NPC script. Within the NPC script, it checks player-based variables, which then chooses the behavior.

This can get messy VERY quickly, so what do you think is the most efficient way of going about this?
#33
Alrighty, the game now has a save feature!

Also for all of those who have download direct, I've neglected to update the direct download version.

Now it's up-to-date with ETRv4.
#34
QuoteI couldn't figure out what to do so I gave up. There's no save button so I think I'll stop here. You weren't kidding about "abstract". This is one WEIRD game!

I'll consider posting something along the lines of a walk through at some point. It's defiantly weird, I was just having fun and getting my hands dirty. (laugh)

Thanks for playing.
#35
Just wanted to mention there's been reports of a few gamebreaking bugs since yesterday.

If you encounter anything let me know. They'll be fixed in an update at the end of the week.
#36
QuoteThis looks like it goes to all the strange new places!!!

Can't wait to give it a try!

That it does! I'm really interested to hear what you think.

QuoteCongrats on releasing it! (nod)

Feels strange that I announced it back in December. These week/month-long projects always end up being a lot bigger than I thought.
#37


It's just another fun "escape the room" game, right?

The player wakes up in a room and they need to solve puzzle to get out. The formula's there. 

But something's amiss. Puzzle elements start to get more and more abstract.

You keep escaping room after room after room for what? There's just more rooms! It's like you're not even escaping at all.

There's more at play than just four walls...

Download:

Direct
Itch.io
AGS - TBA

Screenshots:
Spoiler



[close]
#38
Thanks Khris, it works perfectly.
#39
Thanks for your help so far,

I've decided to go with Khris' method of calling SaveGameSlot(1); in eEventBeforeFadein.

The issue I'm having is the game does not carry out the eAfterFadein events. It functions perfectly when the room is first entered, but not when it's loaded.
#40
Escape the room is in the final stage of development: Playtesting.

ETR took as much extra time as needed. Hopefully you'll agree it was worth the wait.

Copies have been sent to playtesters, and we anticipate to have the game out by the 6th the LATEST. (For real this time)

[imgzoom]https://i.imgur.com/uow3hE6.gif[/imgzoom]

See you at the end of the world.
SMF spam blocked by CleanTalk