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.


Messages - chongyunxiang

Pages: 1 2 3 4 5 ... 19
31
Ask a Question / Re: Character behavior
« on: August 06, 2020, 10:45:39 pm »
The number of items in the List that I am doing will variate based on the pet's emotions. So since I don't know the number, I created a Global number attribute, created an Always event to set it to the number of items in the list.

It works, but after a while of calling out the emoticons, the game crashed again and I think it is the same line 73 which is giving problems (I'll fix the emoticon has value and alive later on). I'm not sure if what I did was correct.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at com.stencyl::Engine/getRecycledActorOfTypeOnLayer()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2337]
   at com.stencyl::Engine/getRecycledActorOfType()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2322]
   at com.stencyl.behavior::Script$/createRecycledActor()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\behavior\Script.hx:1814]
   at scripts::Design_14_14_EmoticonList/_customEvent_CreateEmoticon()[C:\Users\YunXiang\AppData\Roaming\Stencyl\stencylworks\games-generated\Virtual Pet with list\Source\scripts\Design_14_14_EmoticonList.hx:73]
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at Function/<anonymous>()
   at com.stencyl.behavior::BehaviorManager/call2()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\behavior\BehaviorManager.hx:245]
   at com.stencyl.models::Actor/say()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\models\Actor.hx:3697]
   at MethodInfo-9486()[C:\Users\YunXiang\AppData\Roaming\Stencyl\stencylworks\games-generated\Virtual Pet with list\Source\scripts\ActorEvents_0.hx:122]
   at com.stencyl.models::Actor/innerUpdate()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\models\Actor.hx:1492]
   at com.stencyl::Engine/update()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2680]
   at com.stencyl::Engine/postUpdate()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2836]
   at com.stencyl::Engine/onUpdate()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2828]

32
Ask a Question / Re: Character behavior
« on: August 06, 2020, 10:17:58 am »
But what if I have multiple items in the list which I want to call out at random? If it's -1, wouldn't it just call out the latest item in the list? I tried setting it to "number of items - random number between 0 and (a number)" and it also crashed.

33
Ask a Question / Re: Character behavior
« on: August 06, 2020, 06:24:02 am »
So it seems like this is the part you mentioned, about the retrieval of emoticon name from the List.

I'm trying to get it to retrieve a random name from whatever is in the List.  Is this the correct way of doing it?

34
Ask a Question / Re: Character behavior
« on: August 04, 2020, 01:42:36 am »
How do I read the error message for the bug? It seems to state almost everything that goes on with the Emoticon and List.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at com.stencyl::Engine/getRecycledActorOfTypeOnLayer()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2337]
   at com.stencyl::Engine/getRecycledActorOfType()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2322]
   at com.stencyl.behavior::Script$/createRecycledActor()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\behavior\Script.hx:1814]
   at scripts::Design_14_14_EmoticonList/_customEvent_CreateEmoticon()[C:\Users\YunXiang\AppData\Roaming\Stencyl\stencylworks\games-generated\Virtual Pet with list\Source\scripts\Design_14_14_EmoticonList.hx:73]
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at Function/<anonymous>()
   at com.stencyl.behavior::BehaviorManager/call2()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\behavior\BehaviorManager.hx:245]
   at com.stencyl.models::Actor/say()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\models\Actor.hx:3697]
   at MethodInfo-9486()[C:\Users\YunXiang\AppData\Roaming\Stencyl\stencylworks\games-generated\Virtual Pet with list\Source\scripts\ActorEvents_0.hx:122]
   at com.stencyl.models::Actor/innerUpdate()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\models\Actor.hx:1492]
   at com.stencyl::Engine/update()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2680]
   at com.stencyl::Engine/postUpdate()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2836]
   at com.stencyl::Engine/onUpdate()[D:\Stencyl\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2828]



35
Ask a Question / Re: Character behavior
« on: August 03, 2020, 07:22:32 pm »
Is it this way? I tried it and the problem still persists. Sry, I'm a but of a cuckoo when it comes to programming.

36
Ask a Question / Re: Character behavior
« on: August 03, 2020, 07:42:47 am »
I tried using List to Add and Remove emoticons based on the Happy level of the pet. However, it crashes when I clicked on the pet to call out emoticons. At times, I'm able to call out 2 or 3 emoticons before it crashes. The crash report says "TypeError: Error #1009: Cannot access a property or method of a null object reference."

What went wrong and how do I fix it?

37
Ask a Question / Re: Character behavior
« on: June 01, 2020, 10:46:02 pm »
I'm trying to see if i can add emoticons to a list which the pet can call out.

Example: when the the hunger bar is low, it'll add the hungry emoticon to the List, when the happy bar is low, it'll add sad emoticon to the list. And when its no longer hungry or sad, the emoticon will be removed from the list.

The Actor block adds the last created actor to the list, and i think this wont solve my issue. I'm not only adding happiness and hunger, but also the pet's character, like curiosity when it sees an item, or bored when it has nothing to do.

Has anyone created such a logic before?

38
Ask a Question / Re: Character behavior
« on: June 01, 2020, 07:45:15 am »
How do I use List to add and call out Actors?

From the encyclopedia, it shows that you can add things into the List, but how do I add Actors?

39
Ask a Question / Re: Better way for calling out emoticons
« on: May 06, 2020, 07:40:55 am »
Is there a way to add Actors to List? So far I only see that I can add Type of Actor and Group of Actor.

40
Ask a Question / Re: Better way for calling out emoticons
« on: May 03, 2020, 09:09:06 am »
I just had an idea of using List.

Each time the player clicks on the pet, based on the conditions, it'll add the emoticon to the List and calls the item in the list at random.

But I've not used List before and don't know how it works and if it's a better option.

41
Ask a Question / Re: Better way for calling out emoticons
« on: May 03, 2020, 06:21:56 am »
Hi Jeffrey,
I think I understand what you mean by using animation.

But wouldn't this also lead to the same problem as mine, where more than 1 emoticon gets created, or in your case, maybe it'll have some issues with creating/deciding which animation to play?

The problem with what I did was that more than 1 emoticon was created because 2 conditions was fulfilled, which cause it to trigger 2 events, therefore having 2 emoticons.

42
Ask a Question / Better way for calling out emoticons
« on: May 02, 2020, 08:21:37 am »
Hi,

I'm creating a pet simulator where the happiness, hunger and dirty meters will determine what emoticon will be shown when player clicks on the pet.

I'm not good at programming, so I thought of setting conditions for which emoticon to be called out. But this creates problems because 2 or more emoticons were called out instead of 1.

Is there a better and more organized way of doing this?

43
Ask a Question / Create Character emoticons
« on: April 24, 2020, 09:51:41 am »
Hi,

I'm trying to create a Dirty emoticon for my character, where the Dirty emoticon will appear at random times once the character is Dirty.

Clicking on the character will also bring up other Sad emoticons based on the Sad meter, but once the character is Dirty and if player never clicks on it, then at random times it'll show the Dirty emoticon.

Right now it is not working and the Dirty emoticon keeps getting created. I'm not sure where and what went wrong.

Thanks!

44
Ask a Question / Re: Character behavior
« on: February 07, 2020, 10:16:45 am »
I've gotten the Starving behavior to work! Thanks!

Now when the pet is dirty, it's supposed to Every Few Random Seconds display the dirty emoticon, but it keeps triggering every second. I'm not sure where it went wrong. I tried creating separate behaviors or events for it, but it just keeps triggering every second instead.

45
Ask a Question / Re: Apps/Games running in the background for mobile
« on: February 07, 2020, 09:04:45 am »
Is there someone who can help you get it into an extension? I think these and the mobile phone sensors (gyro,pedo,accelerometer) are all pretty essential tools and having it as an extension will make it easier to work with.
For the record, you already have blocks for the accelerometer.

That's nice! I'm looking at the pedometer. Are there blocks for it?

Pages: 1 2 3 4 5 ... 19