Post new topic    
Liquid Metal Slime
Send private message
Scripting Help? 
 PostThu Dec 23, 2010 1:24 am
Send private message Reply with quote
Working on a script, Surlaw helped me by setting it up, but when I go to compile it gives me an error. Can anyone help out as to why it might be messin up? I've been messing with it for a while. Different things happen based on how far away you are from the NPC in question.


if
(distance < 10)
then(heatsensorverynear)

if
(distance > 10),and, (distance < 30)
then(heatsensornear)


if
(distance > 30),and, (distance < 60)
then(heatsensormedium)

if
(distance > 60)
then(heatsensorcold)


end
Check out Red Triangle Games!
A Scrambled Egg
Send private message
 
 PostThu Dec 23, 2010 2:26 am
Send private message Reply with quote
Try this:

if
(distance > 10,and,distance <30)
then(heatsensormedium)

I think it was just closing the parenthesis too early.
Super Walrus Land: Mouth Words Edition
Liquid Metal King Slime
Send private message
 
 PostThu Dec 23, 2010 3:10 am
Send private message Reply with quote
Yea, Surlaw's right.

Also, you'll want to use " >= " or " <= " and not " < " or " > "

And I'm assuming "distance" is a global variable and it's found and stored in the right way.
A Scrambled Egg
Send private message
 
 PostThu Dec 23, 2010 3:19 am
Send private message Reply with quote
If you do use >= and <= be sure to rewrite the numbers as:


if
(distance <= 10)
then(heatsensorverynear)

if
(distance => 11,and,distance <= 30)
then(heatsensornear)

if
(distance >= 31,and,distance <= 60)
then(heatsensormedium)

if
(distance >= 61)
then(heatsensorcold)
Super Walrus Land: Mouth Words Edition
Liquid Metal King Slime
Send private message
 
 PostThu Dec 23, 2010 3:20 am
Send private message Reply with quote
Surlaw, you just wrote the parenthesis wrong again.
Red Slime
Send private message
 
 PostThu Dec 23, 2010 3:21 am
Send private message Reply with quote
On that same note, if you really want "greater than" or "less than," you have to use two symbols instead of one. (>> and << respectively.)
A Scrambled Egg
Send private message
 
 PostThu Dec 23, 2010 3:22 am
Send private message Reply with quote
I wrote it perfectly and then it got screwed up when I tried to post (disabling HTML, BBCode, and smilies was needed) so I just recopied it from the original post and didn't fix it this time Sad
Calehay wrote:
On that same note, if you really want "greater than" or "less than," you have to use two symbols instead of one. (>> and << respectively.)

You're right, I was writing this without access to anything OHR related and it's been too long since I scripted much so I knew I'd miss little things.
Super Walrus Land: Mouth Words Edition
Liquid Metal Slime
Send private message
 
 PostThu Dec 23, 2010 3:22 am
Send private message Reply with quote
K, well Spoonweaver, you helped me indirectly. I had posted this error, and then Worthy helped me sort it out, but now, my Bat Radar isn't working properly.


#if (distance<2)
# story scripts for mission

if
((distance <= 5))
then(heatsensorverynear)


if
((distance >= 5),and, (distance <= 20))
then(heatsensornear)

if
((distance >= 20),and, (distance <= 40))
then(heatsensormedium)


if
((distance >= 40))
then(heatsensorcold)

Any chance this is based on something besides tiles? Because it stays bright red (verynear) until I walk WELL over 5 tiles away. Thoughts? Surlaw you wrote this puppy, any ideas on the math part earlier in the script, I didn't post it here because I didn't want to ruin the secret boss.
Check out Red Triangle Games!
A Scrambled Egg
Send private message
 
 PostThu Dec 23, 2010 3:28 am
Send private message Reply with quote
Write a line to display the value of the distance variable on the screen so you can see what it's displaying as and let me know if the numbers look wrong. I think it just needs to be "show value (distance)" right?

Also you could try "hero pixel x (find hero whatever)" in the heat sensor scripts being called instead of just "hero x" to give yourself more precise control.
Super Walrus Land: Mouth Words Edition
Liquid Metal Slime
Send private message
 
 PostThu Dec 23, 2010 5:01 am
Send private message Reply with quote
The lower the values, the easier it is to see it change. But it doesn't seem to read accurately. I can send the game and script files over if need be.

Nevermind, the thing works, wonderfully now. Should make for a great dungeon mechanic.
Check out Red Triangle Games!
Liquid Metal Slime
Send private message
 
 PostSat Jan 01, 2011 1:54 am
Send private message Reply with quote
Does anyone know if there's a command to change hero portraits like you can change hero battle and walkabout sprites? It'd be useful with the costume changes in my Batman game.

Thanks!
Check out Red Triangle Games!
 
 PostThu Jan 13, 2011 12:58 am
Send private message Reply with quote
I can't find anything in the Wiki's dictionary that'll allow for portrait changes on textboxes. If it were a sprite change as a result of plot device, then you could just change the portrait in the text box editor.
HAHAHAHAHAHAHAHAHAHHA.......... No.
Display posts from previous: