The Daily Click ::. Forums ::. Klik Coding Help ::. Edit & Rich Edit Objects a problem I have with them
 

Post Reply  Post Oekaki 
 

Posted By Message

Tristan Clark



Registered
  28/07/2003
Points
  159
28th July, 2003 at 20:20:14 -

Hi guys,
When setting the text for an edit object in the event editor, it seems I can either put in a bunch of words, OR I can retrieve data from an object, but I cannot do both in one command. Here's an example:
I can type in 'Goodie does 4 damage to Baddie.' Or I can put in 'value("Baddie Health Counter")'. When I try to combine the two in any way, it gives me a syntax error.
Is it possible at all to combine them? I'd like to have it end up reading like 'Goodie does X damage to Baddie', where X is a changeable value. Otherwise, are there any alternatives that might work?

Thanks a lot!

 
n/a

Kramy



Registered
  08/06/2002
Points
  1888
28th July, 2003 at 20:59:37 -

[name of char]+" does "+ str$(value("counter name here"))+ " damage to "+ [name of second char]+"."

 
Kramy

Kramy



Registered
  08/06/2002
Points
  1888
28th July, 2003 at 21:02:50 -

Goodie does 4 damage to Baddie.

------------------------------
Use str$(object with value in here) to convert a value to a string
Use val(object with string in here) to convert a string to a value

 
Kramy

Tristan Clark



Registered
  28/07/2003
Points
  159
28th July, 2003 at 21:52:38 -

Awesome, you're a legend, cheers!
Another problem is I need to somehow get an active object to be able to go on top of the edit object - is there any way to do this, or are edit objects permanently stuck in front of most other things?

 
n/a

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
29th July, 2003 at 01:47:28 -

Edit objects are permently on the top, but you can make them transparent.

-Andy

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Tristan Clark



Registered
  28/07/2003
Points
  159
30th July, 2003 at 04:52:15 -

Damn. I don't suppose there's a way to get the text to scroll on - like, appear letter by letter, as if someone were typing the words on the screen.

 
n/a

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
30th July, 2003 at 05:03:27 -

It's not an option, but its easily done.

Create two strings, one displaying what you want to type out (invisible/offscreen), and the other blank and on the screen. And create one counter.

Code:

Every 0.20 secs - stringonscreen.text = Left$( stringoffscreen.text, counter.value )add one to counter.

And it's as simple as that.

-Andy

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Kramy



Registered
  08/06/2002
Points
  1888
30th July, 2003 at 13:47:33 -

Aw...wish I had gotten on earlier to answer first. Boosts ego.

 
Kramy

Tristan Clark



Registered
  28/07/2003
Points
  159
31st July, 2003 at 03:18:55 -

So those Left and Right buttons do serve some purpose...cheers guys! What other kind of things can you do with those buttons?

 
n/a

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
31st July, 2003 at 03:31:35 -

Well they are just shortcuts to other things that can be found in expressions under "Special".

Left Get's the left most character(s) depending on the value that follows.
Right Get's the right most character(s) depending on the value that follows.
Mid Get's the middle character(s) depending on the value that follows.

They are some string ones, but most of the other buttons are maths.

-Andy

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Tristan Clark



Registered
  28/07/2003
Points
  159
31st July, 2003 at 21:05:47 -

Hmm, a new problem has arisen...
The text scrolls on great, but a lot of the time it'll start the next word at the end of the line, and there won't be enough room. It will then type out the whole word again on the following line, ending up with something like this:

Hello there! I hope you had a go
good trip. It would have been ni
nice to go with you.

Any ideas on how to fix that?
Cheers.

 
n/a

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
1st August, 2003 at 02:06:29 -

Um not at the moment, what code are you using?

-Andy

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Kramy



Registered
  08/06/2002
Points
  1888
1st August, 2003 at 14:37:30 -

I had a problem like that when I loaded the text off a string.(not sure why) It might be something to do with what characters the string thinks is a value.(maybe after a newline it lowers the character value by 2? - your 4 letter words had 2 letters cut off) Anyway, when I changed it to an edit box, it worked. If you're already using an edit box though to get the text...then I don't know what it could be.

Edit: If you're not using an edit box try using one, but make sure the settings have horizontal autoscroll on, and multiline off, otherwise it will be just like a string.(I think)

Image Edited by the Author.

 
Kramy

Tristan Clark



Registered
  28/07/2003
Points
  159
1st August, 2003 at 19:17:45 -

I was already getting the text off an edit box, the problem is probably with the visible one, I just have no idea how to solve it. Quite annoying!

 
n/a

Kramy



Registered
  08/06/2002
Points
  1888
2nd August, 2003 at 14:28:01 -

Hmm...yeah, that would be. Well, if you send it to me I'll see if I can get it to work, but no guarentees.

kramy@telus.net

Image Edited by the Author.

 
Kramy
   

Post Reply



 



Advertisement

Worth A Click