Author Topic: FRED questions of darkmaster  (Read 1745 times)

0 Members and 1 Guest are viewing this topic.

Offline darkmaster

  • 27
  • TBP
    • Personal Website
FRED questions of darkmaster
Hello,
Currently I am making a campaign for TBP and I ran into some logical problems. So if anyone can help me it will be very great.

First problem :

In my campaign I want to include the "health regeneration" feature but unable to do it.
So far I created a variable named "regen" (initial value = 1)
and an event :

Event 1 :

everytime
    "regen" = 1
do
     "repaire hull 1%"
     "regen" = 0

So I want another "event 2" that must be activated 10s after "regen" has been turned to 0, which will assign "regen" the value 1.
(I have no idea how to make it).

Thanks in advance.



« Last Edit: January 21, 2009, 12:07:16 pm by darkmaster »
TBP's apprentice FREDDER.

Campaign in development:
Guardian of Light (Demo state)(Download DEMO here)
The First Invasion - Part 1 (Planning Concept)

Single Mission :
Human-Narn First Contact (Download here)

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: FRED questions of darkmaster
First, don't use every-time.  That's a highly specialized sexp that's only needed for a very small number of things.

You probably don't need variables either.  Why not make a sexp with a very high repeat count (like 9999), and a repeat delay of 10, that repairs the hull by 1% each time?

 

Offline 0rph3u5

  • 211
  • Oceans rise. Empires fall.
Re: FRED questions of darkmaster
every-time ... every-time...
I'm not too confident I can help for I avoid using "every-time" - but now to your problem:

I suppose you are using "is-event-true-delay" to tigger "Event 2" - that does not work with every-time events (or has that changed?)
maybe you could change it to a simpler system:

Regen-Event
-every-time
+"ture"
-set-subsystem-strengh
+ "Alpha 1"
+ "+"
    "hit-left"
                "Alpha 1"
     "1"
Repeat Count: 9999
Intervall Time: 1500 (that's ms, isn't it?)

EDIT:
That is nearly the same as what Goober suggested
"As you sought to steal a kingdom for yourself, so must you do again, a thousand times over. For a theft, a true theft, must be practiced to be earned." - The terms of Nyrissa's curse, Pathfinder: Kingmaker

==================

"I am Curiosity, and I've always wondered what would become of you, here at the end of the world." - The Guide/The Curious Other, Othercide

"When you work with water, you have to know and respect it. When you labour to subdue it, you have to understand that one day it may rise up and turn all your labours into nothing. For what is water, which seeks to make all things level, which has no taste or colour of its own, but a liquid form of Nothing?" - Graham Swift, Waterland

"...because they are not Dragons."

 

Offline darkmaster

  • 27
  • TBP
    • Personal Website
Re: FRED questions of darkmaster
Thanks both of you for the idea. It is simple and practical.
TBP's apprentice FREDDER.

Campaign in development:
Guardian of Light (Demo state)(Download DEMO here)
The First Invasion - Part 1 (Planning Concept)

Single Mission :
Human-Narn First Contact (Download here)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: FRED questions of darkmaster
Another solution to your problem is the mod and mission-time SEXPs. Mission time is obviously the current time in the mission. Mod divides one number by the other and works out what the remainder is. This makes it easy to use for mission timing.

when (repeat count, 1 seconf
- =
--mod
---Mission-time
---10
--0
-do-something

Creates an event that triggers at t = 0 and every 10 seconds after that. It is possible to use a variation of this event to do everything you want it to do. However if this isn't enough, my suggestion would be to have a second variable. In the first event add this

modify-variable
-SecondVar
-Mission-Time

Your second event then does this

when (high repeat count, 1 second repeat delay
-and
-- =
--- 0
--- mod
---- -
-----MissionTime
-----SecondVar
----10
-- >
---SecondVar
---Missiontime  
-Set your variable to 1 here


The first bit checks that Mission time - the variable is divisible by 10. The second one checks that the two aren't the same value since otherwise it would trigger immediately after the first event does.

EDIT : Just seen the other two posts. You've now got three possible levels of sophistication for your system. :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline darkmaster

  • 27
  • TBP
    • Personal Website
Re: FRED questions of darkmaster
Problem 2 : Quick question : Which SEXP to detect the current difficulty level ?
TBP's apprentice FREDDER.

Campaign in development:
Guardian of Light (Demo state)(Download DEMO here)
The First Invasion - Part 1 (Planning Concept)

Single Mission :
Human-Narn First Contact (Download here)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: FRED questions of darkmaster
You can't actually detect the level directly. But you can detect if it is at least something using the skill-level-at-least. Which is more useful most of the time. You can get the actual level by a is at least x but is not at least x + 1

This picture shows how to add or subtract to something depending on the skill level.

Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

  

Offline darkmaster

  • 27
  • TBP
    • Personal Website
Re: FRED questions of darkmaster
Thank you very much Kara. I will edit this post for Problem 3 ( if there is one)
TBP's apprentice FREDDER.

Campaign in development:
Guardian of Light (Demo state)(Download DEMO here)
The First Invasion - Part 1 (Planning Concept)

Single Mission :
Human-Narn First Contact (Download here)